#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 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) # 4G per CPU seems OK. 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 EXTRA_CONFIG_FLAGS=--without-flint --without-libnormaliz 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: # avoid calling configure to 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}