File: rules

package info (click to toggle)
canl-c 2.1.8-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,016 kB
  • sloc: ansic: 10,566; perl: 1,371; makefile: 237; yacc: 234; lex: 133
file content (83 lines) | stat: -rwxr-xr-x 1,892 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
81
82
83
#!/usr/bin/make -f
# -*- makefile -*-

-include /usr/share/dpkg/buildflags.mk

p_dev=libcanl-c-dev
p_examples=libcanl-c-examples
p_lib=libcanl-c2

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

configure: configure-stamp

configure-stamp:
	dh_testdir
	./configure --root=/ --prefix=/usr --libdir=lib/$(DEB_HOST_MULTIARCH) --project=emi
	touch $@

build: build-arch build-indep

build-arch build-indep: build-stamp

build-stamp: configure-stamp
	dh_testdir
	CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
	CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
	touch $@

clean:
	dh_testdir
	dh_testroot
	$(MAKE) clean
	rm -f Makefile.inc config.status canl-c.spec
	rm -f configure-stamp build-stamp
	dh_clean

install: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la
	# Documentation is installed by dh_installdocs
	rm -rf debian/tmp/usr/share/doc

binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdocs -i
	dh_installchangelogs -i
	dh_install -i --fail-missing
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: install
	dh_testdir
	dh_testroot
	dh_installdocs -p $(p_examples) --link $(p_lib)
	dh_installdocs -p $(p_lib)-dbg --link $(p_lib)
	dh_installdocs -p $(p_examples)-dbg --link $(p_examples)
	dh_installdocs -a
	dh_installchangelogs -a ChangeLog
	dh_install -a --fail-missing
	dh_link -a
	dh_strip -p$(p_examples) --dbg-package=$(p_examples)-dbg
	dh_strip -p$(p_lib) --dbg-package=$(p_lib)-dbg
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-arch binary-indep

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