File: rules

package info (click to toggle)
cfs 1.4.1-17
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 600 kB
  • ctags: 648
  • sloc: ansic: 7,684; sh: 362; makefile: 185
file content (79 lines) | stat: -rwxr-xr-x 2,298 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
#!/usr/bin/make -f

STRIP =strip
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  STRIP =: nostrip
endif

CC =gcc
COPT =-g -O2 -DPROTOTYPES=1
LIBS =
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  COPT =-g -O0 -DPROTOTYPES=1
endif
ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
  CC =diet -v -Os gcc -nostdinc
  COPT =-g -DPROTOTYPES=1 -D_BSD_SOURCE -DL_SET=SEEK_SET
  LIBS =-lrpc -lcompat
endif

DIR =$(shell pwd)/debian/cfs

configure: deb-checkdir configure-stamp
configure-stamp:
	touch configure-stamp

build: deb-checkdir build-stamp
build-stamp: configure-stamp 
	$(MAKE) cfs CC='$(CC)' COPT='$(COPT)' LIBS='$(LIBS)'
	touch build-stamp

clean: deb-checkdir deb-checkuid
	-$(MAKE) clean
	rm -rf '$(DIR)'
	rm -f build-stamp configure-stamp
	rm -f debian/files debian/substvars changelog

install: deb-checkdir deb-checkuid build-stamp
	rm -rf '$(DIR)'
	install -d -m0755 '$(DIR)'/etc/cfs
	install -d -m0755 '$(DIR)'/etc/init.d
	install -d -m0755 '$(DIR)'/var/lib/cfs
	$(MAKE) install_cfs BINDIR='$(DIR)'/usr/bin \
	  ETCDIR='$(DIR)'/usr/sbin
	for i in cattach ccat cdetach cmkdir cname cpasswd; do \
	  $(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/$$i || exit 1; \
	done
	$(STRIP) -R .comment -R .note '$(DIR)'/usr/sbin/cfsd
	install -m0644 debian/cfs.conf '$(DIR)'/etc/
	install -m0755 debian/cfs_mount.sh '$(DIR)'/var/lib/cfs/
	install -m0755 debian/cfs_umount.sh '$(DIR)'/var/lib/cfs/
	install -m0755 debian/service/run '$(DIR)'/etc/cfs/
	ln -s /var/run/cfs '$(DIR)'/etc/cfs/supervise
	install -m0755 debian/init.d '$(DIR)'/etc/init.d/cfsd
	# man pages
	install -d -m0755 '$(DIR)'/usr/share/man/man1
	for i in *.1; do \
	  install -m0644 $$i '$(DIR)'/usr/share/man/man1/ || exit 1; \
	done
	gzip -9 '$(DIR)'/usr/share/man/man1/*.1
	install -d -m0755 '$(DIR)'/usr/share/man/man8
	for i in *.8; do \
	  install -m0644 $$i '$(DIR)'/usr/share/man/man8/ || exit 1; \
	done
	gzip -9 '$(DIR)'/usr/share/man/man8/*.8
	# no upstream changelog
	cp /dev/null changelog

binary-indep:

binary-arch: install cfs.deb
	test '$(CC)' != 'gcc' || \
	  dpkg-shlibdeps '$(DIR)'/usr/bin/* '$(DIR)'/usr/sbin/*
	dpkg-gencontrol -isp -pcfs -P'$(DIR)'
	dpkg -b '$(DIR)' ..

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

include debian/implicit