aboutsummaryrefslogtreecommitdiff
path: root/debian/rules
blob: b8747b899b19137ca816af0b8846a08bc49e699e (plain)
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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

realver := $(shell dpkg-parsechangelog | awk -F' ' '/^Version:/ {print $$2}' | awk -F- '{print $$1}')

PREFIX_ARCB=${CURDIR}/debian/arcboot
BIN_ARCB=usr/sbin
LIB_ARCB=usr/lib/arcboot

PREFIX_TIP22=${CURDIR}/debian/tip22
BIN_TIP22=usr/sbin
LIB_TIP22=usr/lib/tip22

architecture=$(dpkg --print-architecture)

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.

	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir

	# update the version string
	echo "#define __ARCSBOOT_VERSION__ \"${realver}\"" > common/version.h
	# build the package
	$(MAKE) build-subarch-indep
	$(MAKE) clean-subarch-dep
	$(MAKE) SUBARCH=IP32 build-subarch-dep
	cp ext2load/ext2load arcboot.ip32
	$(MAKE) clean-subarch-dep
	$(MAKE) SUBARCH=IP22 build-subarch-dep
	cp ext2load/ext2load arcboot.ip22
	touch build-stamp

clean:
	dh_testdir
	rm -f build-stamp configure-stamp

	$(MAKE) SUBARCH=IP32 clean
	$(MAKE) SUBARCH=IP22 clean
	rm -f arcboot.ip22 arcboot.ip32


	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# install arcboot into debian/arcboot
	install -m 644 arcboot.ip22 ${PREFIX_ARCB}/${LIB_ARCB}/arcboot.ip22
	install -m 644 arcboot.ip32 ${PREFIX_ARCB}/${LIB_ARCB}/arcboot.ip32
	install -m 755 scripts/arcboot ${PREFIX_ARCB}/${BIN_ARCB}/arcboot

	# install tip22 into debian/tip22
	$(MAKE) PREFIX=${PREFIX_TIP22} BINDIR=${BIN_TIP22} LIBDIR=${LIB_TIP22} -C arclib install
	$(MAKE) SUBARCH=IP22 PREFIX=${PREFIX_TIP22} BINDIR=${BIN_TIP22} LIBDIR=${LIB_TIP22} -C tip22 install
	$(MAKE) SUBARCH=IP32 PREFIX=${PREFIX_TIP22} BINDIR=${BIN_TIP22} LIBDIR=${LIB_TIP22} -C tip22 install

        # Install lintian overrides
	cp debian/arcboot.lintian-overrides $(CURDIR)/debian/arcboot/usr/share/lintian/overrides/arcboot

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

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_installdocs
	dh_installexamples etc/arcboot.conf -parcboot
	dh_installman
#	dh_undocumented
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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