File: rules

package info (click to toggle)
tcc 0.9.27%2Bgit20200814.62c30a4a-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 5,324 kB
  • sloc: ansic: 86,384; asm: 1,128; makefile: 811; sh: 588; perl: 306
file content (52 lines) | stat: -rwxr-xr-x 1,285 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

ifeq (amd64,$(DEB_HOST_ARCH))
  DEB_I386_MULTIARCH:=$(shell CC=true dpkg-architecture -f --host-arch i386 \
	  -q DEB_HOST_MULTIARCH)
  DEF_I386='-DCONFIG_TRIPLET="\"$(DEB_I386_MULTIARCH)\"" -DTCC_TARGET_I386'
endif

ifeq (arm64,$(DEB_HOST_ARCH))
  HOST_CPU=aarch64
else ifeq (armel,$(DEB_HOST_ARCH))
  HOST_CPU=armv4l
else ifeq (armhf,$(DEB_HOST_ARCH))
  HOST_CPU=armv7l
else
  HOST_CPU=$(DEB_HOST_ARCH)
endif

override_dh_auto_configure:
	dh_auto_configure -- \
		--cpu=$(HOST_CPU) \
		--triplet=$(DEB_HOST_MULTIARCH) \
		--docdir=/usr/share/doc/tcc

override_dh_auto_build-arch:
	dh_auto_build
ifeq (amd64,$(DEB_HOST_ARCH))
	dh_auto_build -- cross-i386 DEF-i386=$(DEF_I386)

override_dh_auto_install-arch:
	dh_auto_install
	dh_link usr/share/man/man1/tcc.1 usr/share/man/man1/i386-tcc.1
endif

override_dh_auto_test:
	dh_auto_test --no-parallel

execute_after_dh_strip:
	strip --strip-unneeded --remove-section=.comment --remove-section=.note debian/tcc/usr/lib/*/tcc/bcheck.o

override_dh_auto_clean:
	[ ! -f config.mak ] || dh_auto_clean

override_dh_installexamples:
	sed -i 1s@/usr/local/bin/tcc@/usr/bin/tcc@ examples/*.c
	dh_installexamples
	sed -i 1s@/usr/bin/tcc@/usr/local/bin/tcc@ examples/*.c

%:
	dh $@