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 |
| 4 | # twice. The first is the normal, dynamically linked package. The second is |
| 5 | # for the statically linked package. This file has been adjusted accordingly. |
| 6 | |
| 7 | # This is the debhelper compatability version to use. |
| 8 | export DH_COMPAT=1 |
| 9 | |
| 10 | bb=debian/tmp |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 11 | bbbd=debian/bb_builddir |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 12 | bbs=debian/busybox-static |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 13 | bbsbd=debian/bb-static_builddir |
| 14 | |
| 15 | #For the debian-installer .udeb package |
| 16 | PACKAGE=busybox-udeb |
| 17 | VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2) |
| 18 | ARCH=$(shell dpkg --print-architecture) |
| 19 | FILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb |
| 20 | PRIORITY=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2) |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 21 | |
| 22 | clean: |
| 23 | dh_testdir |
| 24 | dh_testroot |
| 25 | rm -f build-stamp-busybox build-stamp-busybox-static |
| 26 | -$(MAKE) clean |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 27 | -rm -rf $(bb) $(bbbd) $(bbs) $(bbsbd) |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 28 | dh_clean |
| 29 | |
| 30 | half_clean: |
| 31 | dh_testdir |
| 32 | dh_testroot |
| 33 | rm -rf $(bbs) build-stamp-busybox-static |
| 34 | -$(MAKE) clean |
| 35 | |
| 36 | build: build-stamp-busybox |
| 37 | build-stamp-busybox: |
| 38 | dh_testdir |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 39 | mkdir -p $(bbbd) |
| 40 | cp Makefile Config.h $(bbbd) |
| 41 | (cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../") |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 42 | touch build-stamp-busybox |
| 43 | |
| 44 | install: build |
| 45 | dh_testdir |
| 46 | dh_testroot |
| 47 | dh_clean -k |
| 48 | dh_installdirs |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 49 | (cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bb)" install) |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 50 | mkdir -p $(bb)/usr/share/man/man1 |
| 51 | cp docs/BusyBox.1 $(bb)/usr/share/man/man1/busybox.1 |
| 52 | |
| 53 | # Now for the statically linked stuff |
| 54 | build-static: build-stamp-busybox-static |
| 55 | build-stamp-busybox-static: |
| 56 | dh_testdir |
| 57 | $(MAKE) DOSTATIC=true |
| 58 | touch build-stamp-busybox-static |
| 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... |
| 67 | #$(MAKE) "PREFIX=$(bbs)" install |
| 68 | mkdir -p $(bbs)/bin/ |
| 69 | cp busybox $(bbs)/bin/busybox |
| 70 | mkdir -p $(bbs)/usr/share/man/man1/ |
| 71 | cp docs/BusyBox.1 $(bbs)/usr/share/man/man1/busybox.1 |
| 72 | |
| 73 | do_static: half_clean build-static install-static |
| 74 | |
| 75 | |
| 76 | # Build architecture-independent files here. |
| 77 | binary-indep: |
| 78 | # We have nothing to do by default. |
| 79 | |
| 80 | # Build architecture-dependent files here. |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 81 | binary-arch: busybox busybox-static busybox-udeb |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 82 | |
| 83 | busybox: install |
| 84 | @echo "--- Building: $@" |
| 85 | dh_testdir |
| 86 | dh_testroot |
| 87 | dh_installdirs |
Eric Andersen | 47cac67 | 2000-06-28 02:25:18 +0000 | [diff] [blame] | 88 | # |
| 89 | #Note that for busybox, we do not install any docs, |
| 90 | # or man apges or anything else. This is in blatent violation of every |
| 91 | # Debian policy out there, since this package is intended to be used |
| 92 | # _only_ by the debian-installer. |
| 93 | # |
| 94 | #dh_installdocs -p$@ docs/BusyBox.txt \ |
| 95 | # docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO |
| 96 | #rm -rf $(bb)/usr/share/doc/busybox/busybox.lineo.com/CVS \ |
| 97 | # $(bb)/usr/share/doc/busybox/busybox.lineo.com/.cvsignore \ |
| 98 | # $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/CVS \ |
| 99 | # $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/.cvsignore |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 100 | #dh_undocumented -p$@ |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 101 | #dh_installchangelogs -p$@ Changelog |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 102 | dh_strip -p$@ |
| 103 | dh_compress -p$@ |
| 104 | dh_fixperms -p$@ |
| 105 | dh_installdeb -p$@ |
| 106 | dh_shlibdeps -p$@ |
Eric Andersen | 47cac67 | 2000-06-28 02:25:18 +0000 | [diff] [blame] | 107 | # |
| 108 | #Make _very_ sure there are no docs lurking about. |
| 109 | # |
| 110 | rm -rf $(bb)/usr/share/doc |
| 111 | rm -rf $(bb)/usr/share/man |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 112 | dh_gencontrol -p$@ |
| 113 | dh_md5sums -p$@ |
| 114 | dh_builddeb -p$@ |
| 115 | |
| 116 | |
| 117 | busybox-static: do_static |
| 118 | @echo "--- Building: $@" |
| 119 | dh_testdir |
| 120 | dh_testroot |
| 121 | dh_installdirs |
| 122 | dh_installdocs -p$@ docs/BusyBox.txt \ |
| 123 | docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO |
| 124 | rm -rf $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/CVS \ |
| 125 | $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/.cvsignore \ |
| 126 | $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/images/CVS \ |
| 127 | $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/images/.cvsignore |
| 128 | dh_undocumented -p$@ |
| 129 | dh_installchangelogs -p$@ Changelog |
| 130 | dh_strip -p$@ |
| 131 | dh_compress -p$@ |
| 132 | dh_fixperms -p$@ |
| 133 | dh_installdeb -p$@ |
| 134 | dh_shlibdeps -p$@ |
| 135 | dh_gencontrol -p$@ |
| 136 | dh_md5sums -p$@ |
| 137 | dh_builddeb -p$@ |
| 138 | |
| 139 | |
Eric Andersen | e2f6e12 | 2000-12-01 19:55:04 +0000 | [diff] [blame] | 140 | # Note that this builds a .udeb, which is not policy compliant or anything. |
| 141 | # |
| 142 | busybox-udeb: install |
| 143 | @echo "--- Building: $@" |
| 144 | dh_testdir |
| 145 | dh_testroot |
| 146 | dh_installdirs |
| 147 | # |
| 148 | #Note that for busybox, we do not install any docs, |
| 149 | # or man apges or anything else. This is in blatent violation of every |
| 150 | # Debian policy out there, since this package is intended to be used |
| 151 | # _only_ by the debian-installer. |
| 152 | # |
| 153 | #dh_installdocs -p$@ docs/BusyBox.txt \ |
| 154 | # docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO |
| 155 | #rm -rf $(bb)/usr/share/doc/busybox/busybox.lineo.com/CVS \ |
| 156 | # $(bb)/usr/share/doc/busybox/busybox.lineo.com/.cvsignore \ |
| 157 | # $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/CVS \ |
| 158 | # $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/.cvsignore |
| 159 | #dh_undocumented -p$@ |
| 160 | #dh_installchangelogs -p$@ Changelog |
| 161 | dh_strip -p$@ |
| 162 | dh_compress -p$@ |
| 163 | dh_fixperms -p$@ |
| 164 | dh_installdeb -p$@ |
| 165 | dh_shlibdeps -p$@ |
| 166 | # |
| 167 | #Make _very_ sure there are no docs lurking about. |
| 168 | # |
| 169 | rm -rf $(bb)/usr/share/doc |
| 170 | rm -rf $(bb)/usr/share/man |
| 171 | dh_gencontrol -p$@ |
| 172 | # Don't write your stupid guesses to debian/files. |
| 173 | #dh_gencontrol -p$@ -- -fdebian/files~ |
| 174 | # Register file manually. |
| 175 | dpkg-distaddfile $(FILENAME) debian-installer $(PRIORITY) |
| 176 | dh_md5sums -p$@ |
| 177 | dh_builddeb -p$@ --filename=$(FILENAME) |
| 178 | |
Eric Andersen | b108a5b | 2000-06-19 09:21:34 +0000 | [diff] [blame] | 179 | binary: binary-indep binary-arch |
| 180 | .PHONY: build clean binary-indep binary-arch binary install |