blob: 98bdf0ea642d337ae2708e095a22d43a82849835 [file] [log] [blame]
Eric Andersenb108a5b2000-06-19 09:21:34 +00001#!/usr/bin/make -f
2
3# This is a bit unusual, in that I have to completely recompile everything
Eric Andersene73fda82000-12-01 22:59:04 +00004# for each package I build (obviously static and dynamic builds require
5# things to be recompiled...)
Eric Andersenb108a5b2000-06-19 09:21:34 +00006
7# This is the debhelper compatability version to use.
Eric Andersene73fda82000-12-01 22:59:04 +00008#export DH_COMPAT=1
Eric Andersenb108a5b2000-06-19 09:21:34 +00009
Eric Andersene73fda82000-12-01 22:59:04 +000010bbbd=debian/busybox_builddir
Eric Andersenb108a5b2000-06-19 09:21:34 +000011bb=debian/tmp
Eric Andersene73fda82000-12-01 22:59:04 +000012bbsbd=debian/busybox_static_builddir
Eric Andersenb108a5b2000-06-19 09:21:34 +000013bbs=debian/busybox-static
Eric Andersene73fda82000-12-01 22:59:04 +000014bbubd=debian/busybox_udeb_builddir
15bbu=debian/busybox-udeb
Eric Andersenb108a5b2000-06-19 09:21:34 +000016
17clean:
18 dh_testdir
19 dh_testroot
Eric Andersene73fda82000-12-01 22:59:04 +000020 rm -f debian/build-stamp-busybox debian/build-stamp-busybox-static debian/build-stamp-busybox-udeb
Eric Andersenb108a5b2000-06-19 09:21:34 +000021 -$(MAKE) clean
Eric Andersene73fda82000-12-01 22:59:04 +000022 -rm -rf $(bb) $(bbbd) $(bbs) $(bbsbd) $(bbubd) $(bbu)
Eric Andersenb108a5b2000-06-19 09:21:34 +000023 dh_clean
24
Eric Andersene73fda82000-12-01 22:59:04 +000025build: debian/build-stamp-busybox
26debian/build-stamp-busybox:
Eric Andersenb108a5b2000-06-19 09:21:34 +000027 dh_testdir
Eric Andersene2f6e122000-12-01 19:55:04 +000028 mkdir -p $(bbbd)
Eric Andersene73fda82000-12-01 22:59:04 +000029 cp Makefile $(bbbd)
30 cp debian/Config.h-deb $(bbbd)/Config.h
Eric Andersenb83ffaf2001-02-23 06:36:53 +000031 -(cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" applet_source_list)
Eric Andersene2f6e122000-12-01 19:55:04 +000032 (cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../")
Eric Andersene73fda82000-12-01 22:59:04 +000033 touch debian/build-stamp-busybox
Eric Andersenb108a5b2000-06-19 09:21:34 +000034
35install: build
36 dh_testdir
37 dh_testroot
38 dh_clean -k
39 dh_installdirs
Eric Andersene73fda82000-12-01 22:59:04 +000040 # Do not run 'make install', since we do not want all the symlinks.
41 # This just installes the busybox binary...
42 #(cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bb)" install)
43 mkdir -p $(bb)/bin/
44 cp $(bbbd)/busybox $(bb)/bin/busybox
45 mkdir -p $(bb)/usr/share/doc/busybox/busybox.lineo.com
46 cp $(bbbd)/docs/busybox.lineo.com/BusyBox.html $(bb)/usr/share/doc/busybox/busybox.lineo.com/
Eric Andersenb108a5b2000-06-19 09:21:34 +000047 mkdir -p $(bb)/usr/share/man/man1
Eric Andersene73fda82000-12-01 22:59:04 +000048 cp $(bbbd)/docs/BusyBox.1 $(bb)/usr/share/man/man1/busybox.1
Eric Andersenb108a5b2000-06-19 09:21:34 +000049
50# Now for the statically linked stuff
Eric Andersene73fda82000-12-01 22:59:04 +000051build-static: debian/build-stamp-busybox-static
52debian/build-stamp-busybox-static:
Eric Andersenb108a5b2000-06-19 09:21:34 +000053 dh_testdir
Eric Andersene73fda82000-12-01 22:59:04 +000054 mkdir -p $(bbsbd)
55 cp Makefile $(bbsbd)
Eric Andersen69c85722001-02-17 00:41:05 +000056 cp debian/Config.h-static $(bbsbd)/Config.h
Eric Andersene73fda82000-12-01 22:59:04 +000057 (cd $(bbsbd); $(MAKE) DOSTATIC=true "BB_SRC_DIR=../../")
58 touch debian/build-stamp-busybox-static
Eric Andersenb108a5b2000-06-19 09:21:34 +000059
60install-static: build
61 dh_testdir
62 dh_testroot
63 dh_clean -k
64 dh_installdirs
65 # Do not run 'make install', since we do not want all the symlinks.
66 # This just installes the busybox binary...
Eric Andersene73fda82000-12-01 22:59:04 +000067 #(cd $(bbsbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bbs)" install)
Eric Andersenb108a5b2000-06-19 09:21:34 +000068 mkdir -p $(bbs)/bin/
Eric Andersene73fda82000-12-01 22:59:04 +000069 cp $(bbsbd)/busybox $(bbs)/bin/busybox
70 mkdir -p $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com
71 cp $(bbsbd)/docs/busybox.lineo.com/BusyBox.html $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/
Eric Andersenb108a5b2000-06-19 09:21:34 +000072 mkdir -p $(bbs)/usr/share/man/man1/
Eric Andersene73fda82000-12-01 22:59:04 +000073 cp $(bbsbd)/docs/BusyBox.1 $(bbs)/usr/share/man/man1/busybox.1
74
75half_clean:
76 dh_testdir
77 dh_testroot
78 rm -rf $(bbs) debian/build-stamp-busybox-static
79 -$(MAKE) clean
Eric Andersenb108a5b2000-06-19 09:21:34 +000080
81do_static: half_clean build-static install-static
82
83
Eric Andersene73fda82000-12-01 22:59:04 +000084
85# Now for the .udeb stuff
Eric Andersene75f6a92000-12-20 20:41:02 +000086PACKAGE=busybox-udeb
Eric Andersene73fda82000-12-01 22:59:04 +000087VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
88ARCH=$(shell dpkg --print-architecture)
89FILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb
90PRIORITY=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2)
91
92build-udeb: debian/build-stamp-busybox-udeb
93debian/build-stamp-busybox-udeb:
94 dh_testdir
95 mkdir -p $(bbubd)
96 cp Makefile $(bbubd)
97 cp debian/Config.h-udeb $(bbubd)/Config.h
98 (cd $(bbubd); $(MAKE) "BB_SRC_DIR=../../")
99 touch debian/build-stamp-busybox-udeb
100
101install-udeb: build
102 dh_testdir
103 dh_testroot
104 dh_clean -k
105 dh_installdirs
106 (cd $(bbubd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bbu)" install)
107 mkdir -p $(bbu)/usr/share/man/man1/
108 cp $(bbubd)/docs/BusyBox.1 $(bbu)/usr/share/man/man1/busybox.1
109
110three_quarter_clean:
111 dh_testdir
112 dh_testroot
113 rm -rf $(bbu) debian/build-stamp-busybox-udeb
114 -$(MAKE) clean
115
116do_udeb: three_quarter_clean build-udeb install-udeb
117
118
119
Eric Andersenb108a5b2000-06-19 09:21:34 +0000120# Build architecture-independent files here.
121binary-indep:
122# We have nothing to do by default.
123
124# Build architecture-dependent files here.
Eric Andersene2f6e122000-12-01 19:55:04 +0000125binary-arch: busybox busybox-static busybox-udeb
Eric Andersenb108a5b2000-06-19 09:21:34 +0000126
127busybox: install
128 @echo "--- Building: $@"
129 dh_testdir
130 dh_testroot
131 dh_installdirs
Eric Andersene73fda82000-12-01 22:59:04 +0000132 dh_installdocs -p$@ $(bbbd)/docs/BusyBox.txt \
133 $(bbbd)/docs/BusyBox.html docs/style-guide.txt \
134 docs/busybox.lineo.com AUTHORS README TODO
135 rm -rf `find $(bb) -name CVS`
136 rm -f `find $(bb) -name .cvsignore`
137 dh_installchangelogs -p$@ Changelog
138 dh_undocumented -p$@
Eric Andersenb108a5b2000-06-19 09:21:34 +0000139 dh_strip -p$@
140 dh_compress -p$@
141 dh_fixperms -p$@
142 dh_installdeb -p$@
143 dh_shlibdeps -p$@
Eric Andersenb108a5b2000-06-19 09:21:34 +0000144 dh_gencontrol -p$@
145 dh_md5sums -p$@
146 dh_builddeb -p$@
147
148
149busybox-static: do_static
150 @echo "--- Building: $@"
151 dh_testdir
152 dh_testroot
153 dh_installdirs
Eric Andersene73fda82000-12-01 22:59:04 +0000154 dh_installdocs -p$@ $(bbsbd)/docs/BusyBox.txt \
155 $(bbsbd)/docs/BusyBox.html docs/style-guide.txt \
156 docs/busybox.lineo.com AUTHORS README TODO
157 rm -rf `find $(bbs) -name CVS`
158 rm -f `find $(bbs) -name .cvsignore`
Eric Andersenb108a5b2000-06-19 09:21:34 +0000159 dh_installchangelogs -p$@ Changelog
Eric Andersene73fda82000-12-01 22:59:04 +0000160 dh_undocumented -p$@
Eric Andersenb108a5b2000-06-19 09:21:34 +0000161 dh_strip -p$@
162 dh_compress -p$@
163 dh_fixperms -p$@
164 dh_installdeb -p$@
165 dh_shlibdeps -p$@
166 dh_gencontrol -p$@
167 dh_md5sums -p$@
168 dh_builddeb -p$@
169
170
Eric Andersene2f6e122000-12-01 19:55:04 +0000171# Note that this builds a .udeb, which is not policy compliant or anything.
172#
Eric Andersene73fda82000-12-01 22:59:04 +0000173busybox-udeb: do_udeb
Eric Andersene2f6e122000-12-01 19:55:04 +0000174 @echo "--- Building: $@"
175 dh_testdir
176 dh_testroot
177 dh_installdirs
Eric Andersene2f6e122000-12-01 19:55:04 +0000178 dh_strip -p$@
179 dh_compress -p$@
180 dh_fixperms -p$@
181 dh_installdeb -p$@
182 dh_shlibdeps -p$@
Eric Andersene2f6e122000-12-01 19:55:04 +0000183 #Make _very_ sure there are no docs lurking about.
Eric Andersene73fda82000-12-01 22:59:04 +0000184 rm -rf $(bbu)/usr/share/man
185 #dh_gencontrol -p$@
Eric Andersene2f6e122000-12-01 19:55:04 +0000186 # Don't write your stupid guesses to debian/files.
Eric Andersene73fda82000-12-01 22:59:04 +0000187 dh_gencontrol -p$@ -- -fdebian/files~
Eric Andersene2f6e122000-12-01 19:55:04 +0000188 # Register file manually.
189 dpkg-distaddfile $(FILENAME) debian-installer $(PRIORITY)
190 dh_md5sums -p$@
191 dh_builddeb -p$@ --filename=$(FILENAME)
192
Eric Andersenb108a5b2000-06-19 09:21:34 +0000193binary: binary-indep binary-arch
194.PHONY: build clean binary-indep binary-arch binary install