File: rules

package info (click to toggle)
polymake 4.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 31,528 kB
  • sloc: cpp: 152,204; perl: 43,222; javascript: 30,700; ansic: 2,937; java: 2,654; python: 641; sh: 244; xml: 117; makefile: 62
file content (56 lines) | stat: -rwxr-xr-x 1,663 bytes parent folder | download
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
#!/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}