File: rules

package info (click to toggle)
pacparser 1.3.6-1.2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 1,300 kB
  • sloc: ansic: 1,085; python: 225; makefile: 159; sh: 149
file content (80 lines) | stat: -rwxr-xr-x 1,824 bytes parent folder | download | duplicates (2)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/make -f
# -*- makefile -*-

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# This has to be exported to make some magic below work.
export DH_OPTIONS

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

build3vers := $(shell py3versions -sv)

# Build
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp:
	NO_INTERNET=yes $(MAKE) -C src
	NO_INTERNET=yes $(MAKE) -C src pymod
	set -e && for i in $(build3vers); do \
	  NO_INTERNET=yes $(MAKE) -C src pymod PYTHON=python$$i; \
	done
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	rm -rf src/pymod/build/
	$(MAKE) -C src clean
	dh_clean 

install:
	dh_testdir
	dh_testroot
	dh_clean -k -s 
	dh_installdirs -s

	# Install to debian/tmp
	NO_INTERNET=yes $(MAKE) -C src DESTDIR=$(CURDIR)/debian/tmp install
	set -e && for i in $(build3vers); do \
	  NO_INTERNET=yes $(MAKE) -C src DESTDIR=$(CURDIR)/debian/tmp install-pymod EXTRA_ARGS=--install-layout=deb PYTHON=python$$i; \
	done

	dh_install -s --autodest
	dh_python3 -s

# Must not depend on anything. This is to be called by
# binary in another 'make' thread.
binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs -a
	dh_installdocs -a -XREADME.win32
	dh_installexamples -plibpacparser1 -X*.py
	dh_installexamples -ppython-pacparser -X*.c
	dh_installexamples -ppython3-pacparser -X*.c
	dh_installman -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a -X_pacparser.so
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary-arch: binary
binary-indep: binary
binary: build install
	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common

.PHONY: build build-indep build-arch install binary binary-common binary-indep binary-arch clean