File: rules

package info (click to toggle)
arj 3.10.22-13
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,352 kB
  • ctags: 4,701
  • sloc: ansic: 32,990; makefile: 2,034; sh: 1,547; asm: 436
file content (118 lines) | stat: -rwxr-xr-x 2,743 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/usr/bin/make -f
# GNU copyright 1997 to 1999 by Joey Hess.

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

DESTDIR=$(CURDIR)/debian/arj

INSTALL=install
INSTALL_DATA=$(INSTALL) -m 644

DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# XXX: The upstream build system does not support cross-building...
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  conf_gnu_type += --build $(DEB_HOST_GNU_TYPE)
else
  conf_gnu_type += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS = $(shell dpkg-buildflags --get CFLAGS) -Wall
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)

ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
	DEBUG = "DEBUG=1"
endif

ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	STRIP = "BUILD_STRIP=1"
endif

gnu/configure: gnu/configure.in
	dh_testdir
	
	cd gnu && autoconf -f -i

gnu/config.status: gnu/configure
	dh_testdir
	
	-test -r /usr/share/misc/config.sub && \
	  cp -fu /usr/share/misc/config.sub gnu/config.sub
	-test -r /usr/share/misc/config.guess && \
	  cp -fu /usr/share/misc/config.guess gnu/config.guess
	
	cd gnu && ./configure \
	  $(conf_gnu_type) \
	  --prefix=/usr \
	  --mandir=\$${prefix}/share/man

build-indep:

build-arch: gnu/config.status
	dh_testdir
	
	$(MAKE) $(DEBUG) $(STRIP)\
	  CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"

build: build-arch build-indep

clean:
	dh_testdir
	dh_testroot
	
	[ ! -f GNUmakefile ] || $(MAKE) clean
	
	-rm -f gnu/configure
	-rm -f gnu/config.status gnu/config.log gnu/config.cache
	-rm -rf gnu/autom4te.cache
	-rm -f c_defs.h GNUmakefile
	rm -f gnu/config.sub gnu/config.guess
	
	dh_clean

install-arch: build-arch
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	
	$(MAKE) install DESTDIR=$(DESTDIR)
	$(INSTALL_DATA) $(CURDIR)/resource/rearj.cfg.example \
			$(DESTDIR)/etc/rearj.cfg

binary-common:
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_installcron
	dh_installman
	dh_installinfo
	dh_installchangelogs ChangeLog
	dh_link
	# NOTE: Do not strip here, it is currently done in the upstream build
	# system, after the linker stage and before preprocessing the binary
	# files. Otherwise when stripping the self-extracting modules and the
	# help text are removed.
#	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-indep:

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

binary: binary-arch binary-indep

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