File: rules

package info (click to toggle)
netcat 1.10-41.1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 1,740 kB
  • ctags: 2,172
  • sloc: ansic: 1,830; sh: 796; makefile: 128
file content (82 lines) | stat: -rwxr-xr-x 2,065 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
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
#!/usr/bin/make -f

#export DH_VERBOSE=1
export DH_OPTIONS

DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifeq ($(origin CC),default)
CC = $(DEB_HOST_GNU_TYPE)-gcc
endif

# TODO: there are a lot of warnings with -Wall on. Fix them.
DEB_CFLAGS = `dpkg-buildflags --get CFLAGS`
DEB_CFLAGS += -Wall
DEB_CFLAGS += `dpkg-buildflags --get CPPFLAGS`
LDFLAGS = `dpkg-buildflags --get LDFLAGS`

INSTALL_PROG = install -m 0755
DEB_VER = $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')

build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp:
	dh_testdir
	$(MAKE) linux \
	    CC="$(CC) $(DEB_CFLAGS)" LDFLAGS="$(LDFLAGS)" STATIC='' \
	    DFLAGS='-DLINUX -DTELNET -DGAPING_SECURITY_HOLE -DIP_TOS -DDEBIAN_VERSION=\"$(DEB_VER)\"'
	touch $@

build-indep: build-indep-stamp
build-indep-stamp:
	touch $@

clean:
	dh_testdir
	dh_clean build-arch-stamp build-indep-stamp
	$(MAKE) clean

install: install-indep install-arch
install-indep: build-indep
	dh_testdir
	dh_testroot
	dh_prep -i
	dh_installdirs -i
	dh_installdocs -i
	dh_installchangelogs -i
	dh_install -i

install-arch: build-arch
	dh_testdir
	dh_testroot
	dh_prep -s
	dh_installdirs -s
	dh_installdocs -s README
	dh_installexamples -s data scripts debian/contrib
	dh_installchangelogs -s Changelog
	$(INSTALL_PROG) nc $(CURDIR)/debian/netcat-traditional/bin/nc.traditional
	cp debian/man/nc.1 $(CURDIR)/debian/netcat-traditional/usr/share/man/man1/nc.traditional.1

binary-common:
	dh_testdir
	dh_testroot
	dh_link
	dh_strip
	dh_compress -Xexamples
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common

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