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 | b83ffaf | 2001-02-23 06:36:53 +0000 | [diff] [blame] | 31 | -(cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" applet_source_list) |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 32 | (cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../") |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 33 | touch debian/build-stamp-busybox |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 34 | |
| 35 | install: build |
| 36 | dh_testdir |
| 37 | dh_testroot |
| 38 | dh_clean -k |
| 39 | dh_installdirs |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 40 | # 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 Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 47 | mkdir -p $(bb)/usr/share/man/man1 |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 48 | cp $(bbbd)/docs/BusyBox.1 $(bb)/usr/share/man/man1/busybox.1 |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 49 | |
| 50 | # Now for the statically linked stuff |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 51 | build-static: debian/build-stamp-busybox-static |
| 52 | debian/build-stamp-busybox-static: |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 53 | dh_testdir |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 54 | mkdir -p $(bbsbd) |
| 55 | cp Makefile $(bbsbd) |
Eric Andersen | 69c8572 | 2001-02-17 00:41:05 +0000 | [diff] [blame] | 56 | cp debian/Config.h-static $(bbsbd)/Config.h |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 57 | (cd $(bbsbd); $(MAKE) DOSTATIC=true "BB_SRC_DIR=../../") |
| 58 | touch debian/build-stamp-busybox-static |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 59 | |
| 60 | install-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 Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 67 | #(cd $(bbsbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bbs)" install) |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 68 | mkdir -p $(bbs)/bin/ |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 69 | 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 Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 72 | mkdir -p $(bbs)/usr/share/man/man1/ |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 73 | cp $(bbsbd)/docs/BusyBox.1 $(bbs)/usr/share/man/man1/busybox.1 |
| 74 | |
| 75 | half_clean: |
| 76 | dh_testdir |
| 77 | dh_testroot |
| 78 | rm -rf $(bbs) debian/build-stamp-busybox-static |
| 79 | -$(MAKE) clean |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 80 | |
| 81 | do_static: half_clean build-static install-static |
| 82 | |
| 83 | |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 84 | |
| 85 | # Now for the .udeb stuff |
Eric Andersen | e75f6a9 | 2000-12-20 20:41:02 +0000 | [diff] [blame] | 86 | PACKAGE=busybox-udeb |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 87 | VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2) |
| 88 | ARCH=$(shell dpkg --print-architecture) |
| 89 | FILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb |
| 90 | PRIORITY=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2) |
| 91 | |
| 92 | build-udeb: debian/build-stamp-busybox-udeb |
| 93 | debian/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 | |
| 101 | install-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 | |
| 110 | three_quarter_clean: |
| 111 | dh_testdir |
| 112 | dh_testroot |
| 113 | rm -rf $(bbu) debian/build-stamp-busybox-udeb |
| 114 | -$(MAKE) clean |
| 115 | |
| 116 | do_udeb: three_quarter_clean build-udeb install-udeb |
| 117 | |
| 118 | |
| 119 | |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 120 | # Build architecture-independent files here. |
| 121 | binary-indep: |
| 122 | # We have nothing to do by default. |
| 123 | |
| 124 | # Build architecture-dependent files here. |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 125 | binary-arch: busybox busybox-static busybox-udeb |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 126 | |
| 127 | busybox: install |
| 128 | @echo "--- Building: $@" |
| 129 | dh_testdir |
| 130 | dh_testroot |
| 131 | dh_installdirs |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 132 | 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 Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 139 | dh_strip -p$@ |
| 140 | dh_compress -p$@ |
| 141 | dh_fixperms -p$@ |
| 142 | dh_installdeb -p$@ |
| 143 | dh_shlibdeps -p$@ |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 144 | dh_gencontrol -p$@ |
| 145 | dh_md5sums -p$@ |
| 146 | dh_builddeb -p$@ |
| 147 | |
| 148 | |
| 149 | busybox-static: do_static |
| 150 | @echo "--- Building: $@" |
| 151 | dh_testdir |
| 152 | dh_testroot |
| 153 | dh_installdirs |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 154 | 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 Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 159 | dh_installchangelogs -p$@ Changelog |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 160 | dh_undocumented -p$@ |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 161 | 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 Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 171 | # Note that this builds a .udeb, which is not policy compliant or anything. |
| 172 | # |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 173 | busybox-udeb: do_udeb |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 174 | @echo "--- Building: $@" |
| 175 | dh_testdir |
| 176 | dh_testroot |
| 177 | dh_installdirs |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 178 | dh_strip -p$@ |
| 179 | dh_compress -p$@ |
| 180 | dh_fixperms -p$@ |
| 181 | dh_installdeb -p$@ |
| 182 | dh_shlibdeps -p$@ |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 183 | #Make _very_ sure there are no docs lurking about. |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 184 | rm -rf $(bbu)/usr/share/man |
| 185 | #dh_gencontrol -p$@ |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 186 | # Don't write your stupid guesses to debian/files. |
Eric Andersen | e73fda8 | 2000-12-01 22:59:04 +0000 | [diff] [blame] | 187 | dh_gencontrol -p$@ -- -fdebian/files~ |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 188 | # Register file manually. |
| 189 | dpkg-distaddfile $(FILENAME) debian-installer $(PRIORITY) |
| 190 | dh_md5sums -p$@ |
| 191 | dh_builddeb -p$@ --filename=$(FILENAME) |
| 192 | |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 193 | binary: binary-indep binary-arch |
| 194 | .PHONY: build clean binary-indep binary-arch binary install |