2000-06-19 14:51:34 +05:30
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
2002-12-01 07:39:19 +05:30
|
|
|
# Uncomment this to turn on verbose mode.
|
|
|
|
#export DH_VERBOSE=1
|
|
|
|
|
|
|
|
# This is the debhelper compatibility version to use.
|
2002-11-23 12:44:55 +05:30
|
|
|
export DH_COMPAT=3
|
2000-06-19 14:51:34 +05:30
|
|
|
|
2003-04-06 21:05:52 +05:30
|
|
|
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
|
|
|
|
|
2002-12-01 07:39:19 +05:30
|
|
|
VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
|
|
|
|
|
2002-11-23 12:44:55 +05:30
|
|
|
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
|
2002-12-01 07:39:19 +05:30
|
|
|
DODEBUG = true
|
2002-11-23 12:44:55 +05:30
|
|
|
endif
|
2002-12-02 01:46:01 +05:30
|
|
|
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
2002-11-23 12:44:55 +05:30
|
|
|
endif
|
2000-06-19 14:51:34 +05:30
|
|
|
|
2003-04-06 21:05:52 +05:30
|
|
|
PACKAGE_PREFIX = busybox-cvs
|
|
|
|
|
|
|
|
PACKAGES_DEB = $(PACKAGE_PREFIX) $(PACKAGE_PREFIX)-static
|
|
|
|
PACKAGES_UDEB = $(PACKAGE_PREFIX)-udeb
|
|
|
|
ifneq ($(wildcard ./debian/config-net-udeb-$(DEB_HOST_ARCH)),)
|
|
|
|
PACKAGES_UDEB += $(PACKAGE_PREFIX)-net-udeb
|
|
|
|
endif
|
|
|
|
PACKAGES = $(PACKAGES_DEB) $(PACKAGES_UDEB)
|
|
|
|
DEBHELPER_PACKAGES_DEB = $(patsubst %,-p%,$(PACKAGES_DEB))
|
|
|
|
|
|
|
|
build-arch: build-arch-deb build-arch-static build-arch-udeb build-arch-net-udeb build-arch-doc
|
|
|
|
|
|
|
|
build-arch-deb: build-arch-deb-stamp
|
|
|
|
build-arch-deb-stamp:
|
2002-11-23 12:44:55 +05:30
|
|
|
$(MAKE) clean
|
2003-04-06 21:05:52 +05:30
|
|
|
|
|
|
|
ifeq ($(wildcard ./debian/config-deb-$(DEB_HOST_ARCH)),)
|
2002-11-23 12:44:55 +05:30
|
|
|
cp ./debian/config-deb .config
|
2003-04-06 21:05:52 +05:30
|
|
|
else
|
|
|
|
cp ./debian/config-deb-$(DEB_HOST_ARCH) .config
|
|
|
|
endif
|
|
|
|
|
2002-11-23 12:44:55 +05:30
|
|
|
$(MAKE) dep
|
2002-12-01 07:39:19 +05:30
|
|
|
$(MAKE) DODEBUG=$(DODEBUG)
|
|
|
|
|
2003-04-06 21:05:52 +05:30
|
|
|
install -d install-$(PACKAGE_PREFIX)/bin
|
|
|
|
install busybox install-$(PACKAGE_PREFIX)/bin/busybox
|
|
|
|
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
build-arch-static: build-arch-static-stamp
|
|
|
|
build-arch-static-stamp:
|
2002-12-01 07:39:19 +05:30
|
|
|
$(MAKE) clean
|
2003-04-06 21:05:52 +05:30
|
|
|
|
|
|
|
ifeq ($(wildcard ./debian/config-static-$(DEB_HOST_ARCH)),)
|
2002-12-01 07:39:19 +05:30
|
|
|
cp ./debian/config-static .config
|
2003-04-06 21:05:52 +05:30
|
|
|
else
|
|
|
|
cp ./debian/config-static-$(DEB_HOST_ARCH) .config
|
|
|
|
endif
|
|
|
|
|
2002-12-01 07:39:19 +05:30
|
|
|
$(MAKE) dep
|
2002-12-09 02:15:47 +05:30
|
|
|
$(MAKE) DODEBUG=$(DODEBUG)
|
2002-12-01 07:39:19 +05:30
|
|
|
|
2003-04-06 21:05:52 +05:30
|
|
|
install -d install-$(PACKAGE_PREFIX)-static/bin
|
|
|
|
install busybox install-$(PACKAGE_PREFIX)-static/bin/busybox
|
|
|
|
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
build-arch-udeb: build-arch-udeb-stamp
|
|
|
|
build-arch-udeb-stamp:
|
2002-11-23 12:44:55 +05:30
|
|
|
$(MAKE) clean
|
2003-04-06 21:05:52 +05:30
|
|
|
|
|
|
|
ifeq ($(wildcard ./debian/config-udeb-$(DEB_HOST_ARCH)),)
|
2002-11-23 12:44:55 +05:30
|
|
|
cp ./debian/config-udeb .config
|
2003-04-06 21:05:52 +05:30
|
|
|
else
|
|
|
|
cp ./debian/config-udeb-$(DEB_HOST_ARCH) .config
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(MAKE) dep
|
|
|
|
$(MAKE) DODEBUG=$(DODEBUG)
|
|
|
|
|
|
|
|
$(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-udeb install
|
|
|
|
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
build-arch-net-udeb: build-arch-net-udeb-stamp
|
|
|
|
build-arch-net-udeb-stamp:
|
|
|
|
ifneq ($(wildcard ./debian/config-net-udeb-$(DEB_HOST_ARCH)),)
|
|
|
|
$(MAKE) clean
|
|
|
|
|
|
|
|
cp ./debian/config-net-udeb-$(DEB_HOST_ARCH) .config
|
|
|
|
|
2002-11-23 12:44:55 +05:30
|
|
|
$(MAKE) dep
|
2002-12-01 07:39:19 +05:30
|
|
|
$(MAKE) DODEBUG=$(DODEBUG)
|
|
|
|
|
2003-04-06 21:05:52 +05:30
|
|
|
$(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-net-udeb install
|
|
|
|
endif
|
|
|
|
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
build-arch-doc: build-arch-doc-stamp
|
|
|
|
build-arch-doc-stamp:
|
2002-12-09 02:15:47 +05:30
|
|
|
$(MAKE) docs/BusyBox.1
|
2002-12-01 07:39:19 +05:30
|
|
|
|
2003-04-06 21:05:52 +05:30
|
|
|
cp docs/BusyBox.1 busybox.1
|
|
|
|
|
|
|
|
touch $@
|
2002-12-01 07:39:19 +05:30
|
|
|
|
2002-12-09 02:15:47 +05:30
|
|
|
build: build-arch
|
2002-12-01 07:39:19 +05:30
|
|
|
|
|
|
|
clean:
|
2000-12-02 01:25:04 +05:30
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
2003-04-06 21:05:52 +05:30
|
|
|
rm -f build-*-stamp debian/files~
|
2002-12-01 07:39:19 +05:30
|
|
|
|
|
|
|
$(MAKE) distclean
|
2003-04-06 21:05:52 +05:30
|
|
|
-rm -rf busybox-deb busybox-static install* busybox.1
|
2002-12-01 07:39:19 +05:30
|
|
|
|
|
|
|
dh_clean
|
|
|
|
|
|
|
|
install: build-arch
|
2002-11-26 07:46:06 +05:30
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
2002-12-01 07:39:19 +05:30
|
|
|
dh_clean -k
|
|
|
|
dh_installdirs
|
|
|
|
|
2003-04-06 21:05:52 +05:30
|
|
|
for i in $(PACKAGES); do \
|
|
|
|
( \
|
|
|
|
cd install-$$i; \
|
|
|
|
find -type d -exec install -d $(CURDIR)/debian/$$i/{} \;; \
|
|
|
|
find \( -type f -o -type l \) -exec cp -a {} $(CURDIR)/debian/$$i/{} \;; \
|
|
|
|
); \
|
|
|
|
done
|
2002-12-01 07:39:19 +05:30
|
|
|
|
2003-04-06 21:05:52 +05:30
|
|
|
install -m644 debian/$(PACKAGE_PREFIX)-static.override \
|
|
|
|
debian/$(PACKAGE_PREFIX)-static/usr/share/lintian/overrides/$(PACKAGE_PREFIX)-static
|
2002-12-01 07:39:19 +05:30
|
|
|
|
|
|
|
# Build architecture-dependent files here.
|
|
|
|
binary-arch: build-arch install
|
|
|
|
dh_testdir -a
|
|
|
|
dh_testroot -a
|
|
|
|
# dh_installdebconf -a
|
2003-04-06 21:05:52 +05:30
|
|
|
dh_installdocs $(DEBHELPER_PACKAGES_DEB)
|
2002-12-01 07:39:19 +05:30
|
|
|
# dh_installexamples -a
|
|
|
|
# dh_installmenu -a
|
|
|
|
# dh_installlogrotate -a
|
|
|
|
# dh_installemacsen -a
|
|
|
|
# dh_installpam -a
|
|
|
|
# dh_installmime -a
|
|
|
|
# dh_installinit -a
|
|
|
|
# dh_installcron -a
|
2003-04-06 21:05:52 +05:30
|
|
|
dh_installman $(DEBHELPER_PACKAGES_DEB)
|
2002-12-01 07:39:19 +05:30
|
|
|
# dh_installinfo -a
|
|
|
|
# dh_undocumented -a
|
2003-04-06 21:05:52 +05:30
|
|
|
dh_installchangelogs Changelog $(DEBHELPER_PACKAGES_DEB)
|
2002-12-01 07:39:19 +05:30
|
|
|
dh_strip -a
|
|
|
|
dh_link -a
|
|
|
|
dh_compress -a
|
|
|
|
dh_fixperms -a
|
|
|
|
# dh_makeshlibs -a
|
|
|
|
dh_installdeb -a
|
|
|
|
# dh_perl -a
|
|
|
|
dh_shlibdeps -a
|
2003-04-06 21:05:52 +05:30
|
|
|
dh_gencontrol $(DEBHELPER_PACKAGES_DEB)
|
|
|
|
dh_md5sums $(DEBHELPER_PACKAGES_DEB)
|
|
|
|
dh_builddeb $(DEBHELPER_PACKAGES_DEB)
|
|
|
|
|
|
|
|
$(foreach PACKAGE, $(PACKAGES_UDEB), \
|
|
|
|
dh_gencontrol -p$(PACKAGE) -- -fdebian/files~; \
|
|
|
|
dpkg-distaddfile $(PACKAGE)_$(VERSION)_$(DEB_HOST_ARCH).udeb debian-installer extra; \
|
|
|
|
dh_builddeb -p$(PACKAGE) --filename=$(PACKAGE)_$(VERSION)_$(DEB_HOST_ARCH).udeb; \
|
|
|
|
)
|
2002-11-26 07:46:06 +05:30
|
|
|
|
2002-12-09 02:15:47 +05:30
|
|
|
binary: binary-arch
|
2002-12-01 07:39:19 +05:30
|
|
|
.PHONY: build clean binary-indep binary-arch binary install
|