Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 1 | #!/usr/bin/make -f |
| 2 | |
| 3 | # This is a bit unusual, in that I have to completely recompile everything |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 4 | # for each package I build (obviously static and dynamic builds require |
| 5 | # things to be recompiled...) |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 6 | |
| 7 | # This is the debhelper compatability version to use. |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 8 | #export DH_COMPAT=1 |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 9 | |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 10 | bbbd=debian/busybox_builddir |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 11 | bb=debian/tmp |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 12 | bbsbd=debian/busybox_static_builddir |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 13 | bbs=debian/busybox-static |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 14 | bbubd=debian/busybox_udeb_builddir |
| 15 | bbu=debian/busybox-udeb |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 16 | |
| 17 | clean: |
| 18 | dh_testdir |
| 19 | dh_testroot |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 20 | rm -f debian/build-stamp-busybox debian/build-stamp-busybox-static debian/build-stamp-busybox-udeb |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 21 | -$(MAKE) clean |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 22 | -rm -rf $(bb) $(bbbd) $(bbs) $(bbsbd) $(bbubd) $(bbu) |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 23 | dh_clean |
| 24 | |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 25 | build: debian/build-stamp-busybox |
| 26 | debian/build-stamp-busybox: |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 27 | dh_testdir |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 28 | mkdir -p $(bbbd) |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 29 | cp Makefile $(bbbd) |
| 30 | cp debian/Config.h-deb $(bbbd)/Config.h |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 31 | (cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../") |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 32 | touch debian/build-stamp-busybox |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 33 | |
| 34 | install: build |
| 35 | dh_testdir |
| 36 | dh_testroot |
| 37 | dh_clean -k |
| 38 | dh_installdirs |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 39 | # Do not run 'make install', since we do not want all the symlinks. |
| 40 | # This just installes the busybox binary... |
| 41 | #(cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bb)" install) |
| 42 | mkdir -p $(bb)/bin/ |
| 43 | cp $(bbbd)/busybox $(bb)/bin/busybox |
| 44 | mkdir -p $(bb)/usr/share/doc/busybox/busybox.lineo.com |
| 45 | cp $(bbbd)/docs/busybox.lineo.com/BusyBox.html $(bb)/usr/share/doc/busybox/busybox.lineo.com/ |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 46 | mkdir -p $(bb)/usr/share/man/man1 |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 47 | cp $(bbbd)/docs/BusyBox.1 $(bb)/usr/share/man/man1/busybox.1 |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 48 | |
| 49 | # Now for the statically linked stuff |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 50 | build-static: debian/build-stamp-busybox-static |
| 51 | debian/build-stamp-busybox-static: |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 52 | dh_testdir |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 53 | mkdir -p $(bbsbd) |
| 54 | cp Makefile $(bbsbd) |
| 55 | cp debian/Config.h-deb $(bbsbd)/Config.h |
| 56 | (cd $(bbsbd); $(MAKE) DOSTATIC=true "BB_SRC_DIR=../../") |
| 57 | touch debian/build-stamp-busybox-static |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 58 | |
| 59 | install-static: build |
| 60 | dh_testdir |
| 61 | dh_testroot |
| 62 | dh_clean -k |
| 63 | dh_installdirs |
| 64 | # Do not run 'make install', since we do not want all the symlinks. |
| 65 | # This just installes the busybox binary... |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 66 | #(cd $(bbsbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bbs)" install) |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 67 | mkdir -p $(bbs)/bin/ |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 68 | cp $(bbsbd)/busybox $(bbs)/bin/busybox |
| 69 | mkdir -p $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com |
| 70 | cp $(bbsbd)/docs/busybox.lineo.com/BusyBox.html $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/ |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 71 | mkdir -p $(bbs)/usr/share/man/man1/ |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 72 | cp $(bbsbd)/docs/BusyBox.1 $(bbs)/usr/share/man/man1/busybox.1 |
| 73 | |
| 74 | half_clean: |
| 75 | dh_testdir |
| 76 | dh_testroot |
| 77 | rm -rf $(bbs) debian/build-stamp-busybox-static |
| 78 | -$(MAKE) clean |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 79 | |
| 80 | do_static: half_clean build-static install-static |
| 81 | |
| 82 | |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 83 | |
| 84 | # Now for the .udeb stuff |
Eric Andersen | e75f6a9 | 2000-12-20 20:41:02 +0000 | [diff] [blame] | 85 | PACKAGE=busybox-udeb |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 86 | VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2) |
| 87 | ARCH=$(shell dpkg --print-architecture) |
| 88 | FILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb |
| 89 | PRIORITY=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2) |
| 90 | |
| 91 | build-udeb: debian/build-stamp-busybox-udeb |
| 92 | debian/build-stamp-busybox-udeb: |
| 93 | dh_testdir |
| 94 | mkdir -p $(bbubd) |
| 95 | cp Makefile $(bbubd) |
| 96 | cp debian/Config.h-udeb $(bbubd)/Config.h |
| 97 | (cd $(bbubd); $(MAKE) "BB_SRC_DIR=../../") |
| 98 | touch debian/build-stamp-busybox-udeb |
| 99 | |
| 100 | install-udeb: build |
| 101 | dh_testdir |
| 102 | dh_testroot |
| 103 | dh_clean -k |
| 104 | dh_installdirs |
| 105 | (cd $(bbubd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bbu)" install) |
| 106 | mkdir -p $(bbu)/usr/share/man/man1/ |
| 107 | cp $(bbubd)/docs/BusyBox.1 $(bbu)/usr/share/man/man1/busybox.1 |
| 108 | |
| 109 | three_quarter_clean: |
| 110 | dh_testdir |
| 111 | dh_testroot |
| 112 | rm -rf $(bbu) debian/build-stamp-busybox-udeb |
| 113 | -$(MAKE) clean |
| 114 | |
| 115 | do_udeb: three_quarter_clean build-udeb install-udeb |
| 116 | |
| 117 | |
| 118 | |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 119 | # Build architecture-independent files here. |
| 120 | binary-indep: |
| 121 | # We have nothing to do by default. |
| 122 | |
| 123 | # Build architecture-dependent files here. |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 124 | binary-arch: busybox busybox-static busybox-udeb |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 125 | |
| 126 | busybox: install |
| 127 | @echo "--- Building: $@" |
| 128 | dh_testdir |
| 129 | dh_testroot |
| 130 | dh_installdirs |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 131 | dh_installdocs -p$@ $(bbbd)/docs/BusyBox.txt \ |
| 132 | $(bbbd)/docs/BusyBox.html docs/style-guide.txt \ |
| 133 | docs/busybox.lineo.com AUTHORS README TODO |
| 134 | rm -rf `find $(bb) -name CVS` |
| 135 | rm -f `find $(bb) -name .cvsignore` |
| 136 | dh_installchangelogs -p$@ Changelog |
| 137 | dh_undocumented -p$@ |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 138 | dh_strip -p$@ |
| 139 | dh_compress -p$@ |
| 140 | dh_fixperms -p$@ |
| 141 | dh_installdeb -p$@ |
| 142 | dh_shlibdeps -p$@ |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 143 | dh_gencontrol -p$@ |
| 144 | dh_md5sums -p$@ |
| 145 | dh_builddeb -p$@ |
| 146 | |
| 147 | |
| 148 | busybox-static: do_static |
| 149 | @echo "--- Building: $@" |
| 150 | dh_testdir |
| 151 | dh_testroot |
| 152 | dh_installdirs |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 153 | dh_installdocs -p$@ $(bbsbd)/docs/BusyBox.txt \ |
| 154 | $(bbsbd)/docs/BusyBox.html docs/style-guide.txt \ |
| 155 | docs/busybox.lineo.com AUTHORS README TODO |
| 156 | rm -rf `find $(bbs) -name CVS` |
| 157 | rm -f `find $(bbs) -name .cvsignore` |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 158 | dh_installchangelogs -p$@ Changelog |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 159 | dh_undocumented -p$@ |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 160 | dh_strip -p$@ |
| 161 | dh_compress -p$@ |
| 162 | dh_fixperms -p$@ |
| 163 | dh_installdeb -p$@ |
| 164 | dh_shlibdeps -p$@ |
| 165 | dh_gencontrol -p$@ |
| 166 | dh_md5sums -p$@ |
| 167 | dh_builddeb -p$@ |
| 168 | |
| 169 | |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 170 | # Note that this builds a .udeb, which is not policy compliant or anything. |
| 171 | # |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 172 | busybox-udeb: do_udeb |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 173 | @echo "--- Building: $@" |
| 174 | dh_testdir |
| 175 | dh_testroot |
| 176 | dh_installdirs |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 177 | dh_strip -p$@ |
| 178 | dh_compress -p$@ |
| 179 | dh_fixperms -p$@ |
| 180 | dh_installdeb -p$@ |
| 181 | dh_shlibdeps -p$@ |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 182 | #Make _very_ sure there are no docs lurking about. |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 183 | rm -rf $(bbu)/usr/share/man |
| 184 | #dh_gencontrol -p$@ |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 185 | # Don't write your stupid guesses to debian/files. |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 186 | dh_gencontrol -p$@ -- -fdebian/files~ |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 187 | # Register file manually. |
| 188 | dpkg-distaddfile $(FILENAME) debian-installer $(PRIORITY) |
| 189 | dh_md5sums -p$@ |
| 190 | dh_builddeb -p$@ --filename=$(FILENAME) |
| 191 | |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 192 | binary: binary-indep binary-arch |
| 193 | .PHONY: build clean binary-indep binary-arch binary install |