3 # Uncomment this to turn on verbose mode.
6 # This is the debhelper compatibility version to use.
9 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
11 VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
13 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
16 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
19 PACKAGE_PREFIX = busybox-cvs
21 PACKAGES_DEB = $(PACKAGE_PREFIX) $(PACKAGE_PREFIX)-static
22 PACKAGES_UDEB = $(PACKAGE_PREFIX)-udeb
23 ifneq ($(wildcard ./debian/config-net-udeb-$(DEB_HOST_ARCH)),)
24 PACKAGES_UDEB += $(PACKAGE_PREFIX)-net-udeb
26 PACKAGES = $(PACKAGES_DEB) $(PACKAGES_UDEB)
27 DEBHELPER_PACKAGES_DEB = $(patsubst %,-p%,$(PACKAGES_DEB))
29 build-arch: build-arch-deb build-arch-static build-arch-udeb build-arch-net-udeb build-arch-doc
31 build-arch-deb: build-arch-deb-stamp
35 ifeq ($(wildcard ./debian/config-deb-$(DEB_HOST_ARCH)),)
36 cp ./debian/config-deb .config
38 cp ./debian/config-deb-$(DEB_HOST_ARCH) .config
42 $(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
44 install -d install-$(PACKAGE_PREFIX)/bin
45 install busybox install-$(PACKAGE_PREFIX)/bin/busybox
49 build-arch-static: build-arch-static-stamp
50 build-arch-static-stamp:
53 ifeq ($(wildcard ./debian/config-static-$(DEB_HOST_ARCH)),)
54 cp ./debian/config-static .config
56 cp ./debian/config-static-$(DEB_HOST_ARCH) .config
60 $(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
62 install -d install-$(PACKAGE_PREFIX)-static/bin
63 install busybox install-$(PACKAGE_PREFIX)-static/bin/busybox
67 build-arch-udeb: build-arch-udeb-stamp
68 build-arch-udeb-stamp:
71 ifeq ($(wildcard ./debian/config-udeb-$(DEB_HOST_ARCH)),)
72 cp ./debian/config-udeb .config
74 cp ./debian/config-udeb-$(DEB_HOST_ARCH) .config
78 $(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
80 $(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-udeb install
84 build-arch-net-udeb: build-arch-net-udeb-stamp
85 build-arch-net-udeb-stamp:
86 ifneq ($(wildcard ./debian/config-net-udeb-$(DEB_HOST_ARCH)),)
89 cp ./debian/config-net-udeb-$(DEB_HOST_ARCH) .config
92 $(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
94 $(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-net-udeb install
99 build-arch-doc: build-arch-doc-stamp
100 build-arch-doc-stamp:
101 $(MAKE) docs/BusyBox.1
103 cp docs/BusyBox.1 busybox.1
112 rm -f build-*-stamp debian/files~
115 -rm -rf busybox-deb busybox-static install* busybox.1
125 for i in $(PACKAGES); do \
128 find -type d -exec install -d $(CURDIR)/debian/$$i/{} \;; \
129 find \( -type f -o -type l \) -exec cp -a {} $(CURDIR)/debian/$$i/{} \;; \
133 install -m644 debian/$(PACKAGE_PREFIX)-static.override \
134 debian/$(PACKAGE_PREFIX)-static/usr/share/lintian/overrides/$(PACKAGE_PREFIX)-static
136 # Build architecture-dependent files here.
137 binary-arch: build-arch install
140 # dh_installdebconf -a
141 dh_installdocs $(DEBHELPER_PACKAGES_DEB)
142 # dh_installexamples -a
144 # dh_installlogrotate -a
145 # dh_installemacsen -a
150 dh_installman $(DEBHELPER_PACKAGES_DEB)
153 dh_installchangelogs Changelog $(DEBHELPER_PACKAGES_DEB)
162 dh_gencontrol $(DEBHELPER_PACKAGES_DEB)
163 dh_md5sums $(DEBHELPER_PACKAGES_DEB)
164 dh_builddeb $(DEBHELPER_PACKAGES_DEB)
166 $(foreach PACKAGE, $(PACKAGES_UDEB), \
167 dh_gencontrol -p$(PACKAGE) -- -fdebian/files~; \
168 dpkg-distaddfile $(PACKAGE)_$(VERSION)_$(DEB_HOST_ARCH).udeb debian-installer extra; \
169 dh_builddeb -p$(PACKAGE) --filename=$(PACKAGE)_$(VERSION)_$(DEB_HOST_ARCH).udeb; \
173 .PHONY: build clean binary-indep binary-arch binary install