File: rules

package info (click to toggle)
ibcs 971113-5
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,096 kB
  • ctags: 2,079
  • sloc: ansic: 14,910; makefile: 310; sh: 203; asm: 47; perl: 18; pascal: 2
file content (113 lines) | stat: -rwxr-xr-x 3,283 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
#!/usr/bin/make -f
# debian/rules file - for perl-tk (emacs, this is a -*-makefile-*-)

# Modified from the hello package rules file which was Copyright
# 1994,1995 by Ian Jackson.

# There used to be `source' and `diff' targets in this file, and many
# packages also had `changes' and `dist' targets.  These functions
# have been taken over by dpkg-source, dpkg-genchanges and
# dpkg-buildpackage in a package-independent way, and so these targets
# are obsolete.

arch = $(shell dpkg --print-architecture)
package = ibcs-base

package_path = debian/tmp
doc_path = $(package_path)/usr/doc/$(package)
man8_path = $(package_path)/usr/man/man8
usr_sbin_path = $(package_path)/usr/sbin

kernels = 2.0.33 2.0.34 2.0.35
build_modules = $(kernels:=-build)

debug:
	@echo $(build_modules)
	@echo $(build_modules:-build=)

build_modules $(build_modules):
	$(checkdir)
	-rm -rf $(@:-build=-dir)
	-mkdir $(@:-build=-dir)
	cd $(@:-build=-dir); make -f ../iBCSemul/Makefile srcdir=../iBCSemul \
		CONFIG=CONFIG.$(arch) SMP=no EMU_X286=no \
		KERNELSRC=/usr/src/kernel-source-$(@:-build=)
	cd $(@:-build=-dir); make -f ../devtrace/Makefile srcdir=../devtrace \
		CONFIG=CONFIG.$(arch) SMP=no EMU_X286=no \
		KERNELSRC=/usr/src/kernel-source-$(@:-build=)
	touch $@

build: $(build_modules)
	$(checkdir)
	make CONFIG=CONFIG.$(arch) SMP=no EMU_X286=no SUBDIRS=Tools
	cd VSYS; gcc -s -O2 -o bin bin.c
	touch $@

clean:
	$(checkdir)
	-rm -rf build $(build_modules) $(kernels:=-dir)
	-make clean CONFIG=CONFIG.$(arch) SMP=no EMU_X286=no
	-find . -name "*~" | xargs -r rm 
	-cd VSYS; rm bin
	-cd devtrace; make clean
	-rm -rf debian/tmp debian/files* debian/ibcs2*

binary-indep:	checkroot build
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch:	checkroot build
	$(checkdir)
	-rm -rf debian/tmp
# Let the debhelper scripts do the hard work of building directories
	dh_installdocs
	dh_installchangelogs
# Build any additional ibcs-base package directories
	install -d $(usr_sbin_path) \
		$(doc_path)/VSYS \
		$(man8_path)
# Manually install anything we can't get the debhelper scripts to install
	install Tools/lnxstamp Tools/trace Tools/mkmnttab $(usr_sbin_path)
	install -m 644 VSYS/bin VSYS/vsys VSYS/README $(doc_path)/VSYS
	cp Tools/README $(doc_path)/Tools.README
	(cd $(man8_path); \
		ln -sf ../man7/undocumented.7.gz lnxstamp.8.gz; \
		ln -sf ../man7/undocumented.7.gz mkmnttab.8.gz; \
		ln -sf ../man7/undocumented.7.gz trace.8.gz)
# Install the kernel modules
	for i in $(kernels); do \
		install -d debian/ibcs$${i}/lib/modules/$${i}/misc; \
		install $${i}-dir/iBCS $${i}-dir/devtrace \
			debian/ibcs$${i}/lib/modules/$${i}/misc; \
	done
# Usual boring packaging stuff from here on out
	dh_installmanpages -p$(package)
	dh_strip
	dh_compress
	dh_fixperms
	dh_suidregister
	dh_installdeb
	dh_shlibdeps -p$(package)
	dh_gencontrol
	dh_md5sums
	dh_fixperms
	dh_builddeb

define checkdir
	test -f debian/rules
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

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

checkroot:
	$(checkdir)
	test root = "`whoami`"

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