File: rules

package info (click to toggle)
fnord 1.10-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 356 kB
  • ctags: 169
  • sloc: ansic: 1,894; makefile: 101; sh: 71; perl: 36
file content (73 lines) | stat: -rwxr-xr-x 2,220 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
#!/usr/bin/make -f

CFLAGS =-Os -fomit-frame-pointer -DAUTH -DREDIRECTDIR -DCOLF -DCOLF_COMBINED
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
  CFLAGS +=-g
endif
STRIP =strip
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  STRIP =: nostrip
endif

DIR=$(shell pwd)/debian/fnord
VERSION =$(shell head -n1 debian/changelog |sed -e 's/.*(\(.*\)).*/\1/')

patch: deb-checkdir patch-stamp
patch-stamp:
	for i in `ls -1 debian/diff/*.diff`; do \
	  patch -p1 <$$i || exit 1; \
	done
	touch patch-stamp

build: deb-checkdir build-stamp
build-stamp: patch-stamp
	test -r CHANGES'{orig}' || cp -f CHANGES CHANGES'{orig}'
	echo '$(VERSION)' >CHANGES
	$(MAKE) DIET='diet -v -Os' CFLAGS='$(CFLAGS)' STRIP='$(STRIP)'
	# check fix for infinite sendfile loop
	sh debian/check-sendfile-loop
	touch build-stamp

clean: deb-checkdir deb-checkuid
	-$(MAKE) clean
	test ! -r CHANGES'{orig}' || mv -f CHANGES'{orig}' CHANGES
	! test -e patch-stamp || \
	  for i in `ls -1r debian/diff/*.diff`; do patch -p1 -R <$$i; done
	rm -f build-stamp patch-stamp
	rm -rf '$(DIR)'
	rm -f debian/files debian/substvars changelog

install: deb-checkdir deb-checkuid build-stamp
	rm -rf '$(DIR)'
	install -d -m0755 '$(DIR)'/usr/sbin
	install -m0755 fnord '$(DIR)'/usr/sbin/fnord
	install -m0755 fnord-cgi '$(DIR)'/usr/sbin/fnord-cgi
	install -m0755 fnord-idx '$(DIR)'/usr/sbin/fnord-idx
	install -m0755 fnord-cgi-idx '$(DIR)'/usr/sbin/fnord-cgi-idx
	install -m0755 fnord-conf '$(DIR)'/usr/sbin/fnord-conf
	# contributed
	install -m0755 debian/fnord-ssl-conf '$(DIR)'/usr/sbin/fnord-ssl-conf
	# man pages
	install -d -m0755 '$(DIR)'/usr/share/man/man8
	for i in debian/*.8; do \
	 install -m0644 $$i '$(DIR)'/usr/share/man/man8/ || exit 1; \
	done
	gzip -9 '$(DIR)'/usr/share/man/man8/*.8
	# lintian overrides
	install -m0755 -d '$(DIR)'/usr/share/lintian/overrides
	install -m0644 debian/fnord.lintian \
	  '$(DIR)'/usr/share/lintian/overrides/fnord
	# changelog
	test -r changelog || ln -s CHANGES'{orig}' changelog

binary-indep:

binary-arch: install fnord.deb
	dpkg-gencontrol -isp -pfnord -P'$(DIR)'
	dpkg -b '$(DIR)' ..

binary: binary-indep binary-arch

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

include debian/implicit