1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
include /usr/share/dpkg/architecture.mk
CPPFLAGS=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
CXXFLAGS=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
ifeq ($(wildcard /proc/meminfo),)
MAX_CPUS=1
else
MAX_CPUS=$(shell awk '/^MemTotal/ { print int($$2/(4096*1024)+0.5) }' /proc/meminfo)
endif
WEAK_ARCHES="mips mipsel mips64el armhf"
ifneq (,$(findstring ${DEB_BUILD_ARCH},${WEAK_ARCHES}))
CXXOPT=-O1 -g1
else
CXXOPT="-O2"
endif
ifneq (,$(findstring ${DEB_BUILD_ARCH},mipsel mips64el))
export DEB_LDFLAGS_MAINT_APPEND=-fuse-ld=bfd
endif
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
JS:= three.js OrbitControls.js Projector.js SVGRenderer.js TrackballControls.js WebGL.js
JSSOURCE=$(addprefix external/js/,${JS})
build build-arch build-indep binary binary-arch binary-indep clean:
dh $@ --max-parallel="${MAX_CPUS}"
override_dh_auto_configure:
./configure --prefix=/usr --without-java \
--without-native \
${EXTRA_CONFIG_FLAGS} \
CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
LDFLAGS="${LDFLAGS}" CXXOPT="${CXXOPT}"
override_dh_auto_test:
HOME=$$(mktemp -p build -d) perl perl/polymake --script run_testcases --emacs-style
override_dh_auto_clean:
rm -rf build
override_dh_perl:
dh_perl usr/lib/polymake/perlx
override_dh_auto_build:
uglifyjs ${JSSOURCE} -c -m -o resources/threejs/js/three.polymake.js
ninja -v -C build/Opt all -j${MAX_CPUS}
|