File: rules

package info (click to toggle)
netkit-telnet 0.17-41
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 2,448 kB
  • ctags: 3,805
  • sloc: cpp: 6,451; ansic: 4,263; makefile: 135; sh: 110
file content (104 lines) | stat: -rwxr-xr-x 2,810 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/make -f
# $Id: rules,v 1.12 2003/10/18 03:37:54 herbert Exp $
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

LDDEFS := -Wl,-z,defs -Wl,--as-needed

CFLAGS += $(shell dpkg-buildflags --get CFLAGS) -fPIE -pie
CXXFLAGS += $(shell dpkg-buildflags --get CXXFLAGS) -fPIE -pie
CPPFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS) -Wl,-z,now

DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifeq ($(origin CC),default)
	CC = $(DEB_HOST_GNU_TYPE)-gcc
endif
export CC
ifeq ($(origin CXX),default)
	CXX = $(DEB_HOST_GNU_TYPE)-g++
endif
export CXX

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp:
	dh_testdir

	if [ ! -f MCONFIG ]; then \
		./configure; \
		sed -e 's;^CFLAGS=\(.*\)$$;CFLAGS= -Ddebian -D_GNU_SOURCE -DACCEPT_USERVAR -g $(CFLAGS) $(CPPFLAGS) \1;' \
		    -e 's;^CXXFLAGS=\(.*\)$$;CXXFLAGS= -Ddebian -D_GNU_SOURCE -DACCEPT_USERVAR -g $(CXXFLAGS) $(CPPFLAGS) \1;' \
		    -e 's;^LDFLAGS=\(.*\)$$;& $(LDDEFS) $(LDFLAGS);' \
		    MCONFIG > MCONFIG.new; \
		mv MCONFIG.new MCONFIG; \
	fi
	$(MAKE)

	touch build-stamp

clean:
	dh_testdir
	dh_testroot

	test ! -f MCONFIG || $(MAKE) distclean

	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) -C telnet INSTALLROOT=`pwd`/debian/telnet MANDIR=/usr/share/man \
		install
	mv debian/telnet/usr/bin/telnet debian/telnet/usr/bin/telnet.netkit
	mv debian/telnet/usr/share/man/man1/telnet.1 \
	   debian/telnet/usr/share/man/man1/telnet.netkit.1
	cp telnet/README debian/telnet/usr/share/doc/telnet/README.telnet
	cp telnet/README.old debian/telnet/usr/share/doc/telnet/README.telnet.old
	$(MAKE) -C telnetd INSTALLROOT=`pwd`/debian/telnetd \
		MANDIR=/usr/share/man install
	cp telnetlogin/telnetlogin.8 debian/telnetd/usr/share/man/man8
	cp telnetlogin/telnetlogin debian/telnetd/usr/lib
	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
#	dh_testversion
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installmenu
#	dh_installemacsen
#	dh_installinit
	dh_installcron
#	dh_installmanpages
#	dh_undocumented
	dh_installchangelogs ChangeLog
	dh_lintian
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
#	dh_makeshlibs
	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

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