File: rules

package info (click to toggle)
mpsolve 3.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,100 kB
  • sloc: ansic: 25,748; sh: 4,925; cpp: 3,155; makefile: 914; python: 407; yacc: 158; lex: 85; xml: 41
file content (37 lines) | stat: -rwxr-xr-x 1,244 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
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

# only enable tcmalloc if:
# 1. it's available on the given architecture (i.e., we haven't blacklisted
#    libgoogle-perftools-dev in Build-Depends d/control)
HAVE_TCMALLOC := $(shell dpkg-query -W libgoogle-perftools-dev 2> /dev/null)

# 2.  it doesn't give us a "cannot allocate memory in static TLS block" error.
#     possibly related: https://bugzilla.redhat.com/1483558
NO_TCMALLOC_ERROR := $(filter-out \
	arm64 armel armhf mips64el mipsel s390x riscv64 loong64, \
	$(DEB_HOST_ARCH))

ENABLE_TCMALLOC := $(if $(and $(HAVE_TCMALLOC), $(NO_TCMALLOC_ERROR)), \
	--enable-tcmalloc, --disable-tcmalloc)

override_dh_auto_configure:
	dh_auto_configure -- $(ENABLE_TCMALLOC)

# stash upstream's bsd yacc-generated files so bison regenerates them
# and we don't get an implicit declaration compiler error
# https://github.com/robol/MPSolve/issues/48
YACC_PARSER = src/libmps/monomial/yacc-parser
execute_before_dh_auto_build:
	mv $(YACC_PARSER).c $(YACC_PARSER).c.bak
	mv $(YACC_PARSER).h $(YACC_PARSER).h.bak

execute_after_dh_auto_test:
	mv $(YACC_PARSER).c.bak $(YACC_PARSER).c
	mv $(YACC_PARSER).h.bak $(YACC_PARSER).h