hush/debian/rules

197 lines
5.3 KiB
Plaintext
Raw Normal View History

#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
2003-04-06 15:35:52 +00:00
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
2004-01-01 00:23:01 +00:00
DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
DEB_HOST_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
2003-04-06 15:35:52 +00:00
VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
2002-11-23 07:14:55 +00:00
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CONFIG_DEBUG = true
2002-11-23 07:14:55 +00:00
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
2002-11-23 07:14:55 +00:00
endif
2003-04-06 15:35:52 +00:00
PACKAGE_PREFIX = busybox-cvs
2004-01-01 00:23:01 +00:00
ARCH_FLOPPY_UDEB = $(shell sh debian/control-extract Architecture $(PACKAGE_PREFIX)-floppy-udeb)
2003-04-06 15:35:52 +00:00
PACKAGES_DEB = $(PACKAGE_PREFIX) $(PACKAGE_PREFIX)-static
PACKAGES_UDEB = $(PACKAGE_PREFIX)-udeb
2004-01-01 00:23:01 +00:00
ifneq ($(filter $(DEB_HOST_ARCH),$(ARCH_FLOPPY_UDEB)),)
PACKAGES_UDEB += $(PACKAGE_PREFIX)-floppy-udeb
2003-04-06 15:35:52 +00:00
endif
PACKAGES = $(PACKAGES_DEB) $(PACKAGES_UDEB)
2004-01-01 00:23:01 +00:00
2003-04-06 15:35:52 +00:00
DEBHELPER_PACKAGES_DEB = $(patsubst %,-p%,$(PACKAGES_DEB))
2004-01-01 00:23:01 +00:00
DEBHELPER_PACKAGES_UDEB = $(patsubst %,-p%,$(PACKAGES_UDEB))
CONFIG = $(firstword $(wildcard ./debian/config-$(1)-$(DEB_HOST_GNU_SYSTEM)-$(DEB_HOST_GNU_CPU) ./debian/config-$(1)-$(DEB_HOST_GNU_SYSTEM) ./debian/config-$(1)))
CONFIG_DEB = $(call CONFIG,deb)
CONFIG_STATIC = $(call CONFIG,static)
CONFIG_UDEB = $(call CONFIG,udeb)
CONFIG_FLOPPY_UDEB = $(call CONFIG,floppy-udeb)
configure: configure-stamp
configure-stamp:
sh ./configure
touch $@
2003-04-06 15:35:52 +00:00
2004-01-01 00:23:01 +00:00
build-arch: build-arch-deb-all build-arch-udeb-all
build-arch-deb-all: build-arch-deb build-arch-static build-arch-doc
build-arch-udeb-all: build-arch-udeb build-arch-floppy-udeb
2003-04-06 15:35:52 +00:00
build-arch-deb: build-arch-deb-stamp
2004-01-01 00:23:01 +00:00
build-arch-deb-stamp: configure-stamp
2002-11-23 07:14:55 +00:00
$(MAKE) clean
2003-04-06 15:35:52 +00:00
2004-01-01 00:23:01 +00:00
cp $(CONFIG_DEB) .config
2003-04-06 15:35:52 +00:00
2002-11-23 07:14:55 +00:00
$(MAKE) dep
$(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
2003-04-06 15:35:52 +00:00
install -d install-$(PACKAGE_PREFIX)/bin
install busybox install-$(PACKAGE_PREFIX)/bin/busybox
touch $@
build-arch-static: build-arch-static-stamp
2004-01-01 00:23:01 +00:00
build-arch-static-stamp: configure-stamp
$(MAKE) clean
2003-04-06 15:35:52 +00:00
2004-01-01 00:23:01 +00:00
cp $(CONFIG_STATIC) .config
2003-04-06 15:35:52 +00:00
$(MAKE) dep
$(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
2003-04-06 15:35:52 +00:00
install -d install-$(PACKAGE_PREFIX)-static/bin
install busybox install-$(PACKAGE_PREFIX)-static/bin/busybox
touch $@
build-arch-udeb: build-arch-udeb-stamp
2004-01-01 00:23:01 +00:00
build-arch-udeb-stamp: configure-stamp
2002-11-23 07:14:55 +00:00
$(MAKE) clean
2003-04-06 15:35:52 +00:00
2004-01-01 00:23:01 +00:00
cp $(CONFIG_UDEB) .config
2003-04-06 15:35:52 +00:00
$(MAKE) dep
$(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
2003-04-06 15:35:52 +00:00
$(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-udeb install
2004-01-01 00:23:01 +00:00
# Remove init link, but init support is still compiled in to be
# used.
rm -f $(CURDIR)/install-$(PACKAGE_PREFIX)-udeb/sbin/init
2003-04-06 15:35:52 +00:00
touch $@
2004-01-01 00:23:01 +00:00
build-arch-floppy-udeb: build-arch-floppy-udeb-stamp
build-arch-floppy-udeb-stamp: configure-stamp
ifneq ($(filter $(DEB_HOST_ARCH),$(ARCH_FLOPPY_UDEB)),)
2003-04-06 15:35:52 +00:00
$(MAKE) clean
2004-01-01 00:23:01 +00:00
cp $(CONFIG_FLOPPY_UDEB) .config
2003-04-06 15:35:52 +00:00
2002-11-23 07:14:55 +00:00
$(MAKE) dep
$(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
2004-01-01 00:23:01 +00:00
$(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-floppy-udeb install
2003-04-06 15:35:52 +00:00
endif
touch $@
build-arch-doc: build-arch-doc-stamp
2004-01-01 00:23:01 +00:00
build-arch-doc-stamp: configure-stamp
$(MAKE) docs/BusyBox.1
2003-04-06 15:35:52 +00:00
cp docs/BusyBox.1 busybox.1
touch $@
build: build-arch
clean:
dh_testdir
dh_testroot
2004-01-01 00:23:01 +00:00
rm -f build-*-stamp configure-stamp debian/files~
2004-01-01 00:23:01 +00:00
-$(MAKE) distclean
2003-04-06 15:35:52 +00:00
-rm -rf busybox-deb busybox-static install* busybox.1
dh_clean
2004-01-01 00:23:01 +00:00
install-deb: build-arch-deb-all
2002-11-26 02:16:06 +00:00
dh_testdir
dh_testroot
2004-01-01 00:23:01 +00:00
dh_clean -k $(DEBHELPER_PACKAGES_DEB)
dh_installdirs $(DEBHELPER_PACKAGES_DEB)
2004-01-01 00:23:01 +00:00
for i in $(PACKAGES_DEB); do \
2003-04-06 15:35:52 +00:00
( \
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
2003-04-06 15:35:52 +00:00
install -m644 debian/$(PACKAGE_PREFIX)-static.override \
debian/$(PACKAGE_PREFIX)-static/usr/share/lintian/overrides/$(PACKAGE_PREFIX)-static
2004-01-01 00:23:01 +00:00
install-udeb: build-arch-udeb-all
dh_testdir
dh_testroot
dh_clean -k $(DEBHELPER_PACKAGES_UDEB)
dh_installdirs $(DEBHELPER_PACKAGES_UDEB)
for i in $(PACKAGES_UDEB); 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
binary-arch: binary-arch-deb binary-arch-udeb
# Build architecture-dependent files here.
2004-01-01 00:23:01 +00:00
binary-arch-deb: build-arch-deb-all install-deb
dh_testdir
dh_testroot
2003-04-06 15:35:52 +00:00
dh_installdocs $(DEBHELPER_PACKAGES_DEB)
dh_installman $(DEBHELPER_PACKAGES_DEB)
dh_installchangelogs Changelog $(DEBHELPER_PACKAGES_DEB)
2004-01-01 00:23:01 +00:00
dh_strip $(DEBHELPER_PACKAGES_DEB)
dh_link $(DEBHELPER_PACKAGES_DEB)
dh_compress $(DEBHELPER_PACKAGES_DEB)
dh_fixperms $(DEBHELPER_PACKAGES_DEB)
dh_installdeb $(DEBHELPER_PACKAGES_DEB)
dh_shlibdeps $(DEBHELPER_PACKAGES_DEB)
2003-04-06 15:35:52 +00:00
dh_gencontrol $(DEBHELPER_PACKAGES_DEB)
dh_md5sums $(DEBHELPER_PACKAGES_DEB)
dh_builddeb $(DEBHELPER_PACKAGES_DEB)
2004-01-01 00:23:01 +00:00
# Build architecture-dependent files here.
binary-arch-udeb: build-arch-udeb-all install-udeb
dh_testdir
dh_testroot
dh_strip $(DEBHELPER_PACKAGES_UDEB)
dh_link $(DEBHELPER_PACKAGES_UDEB)
dh_compress $(DEBHELPER_PACKAGES_UDEB)
dh_fixperms $(DEBHELPER_PACKAGES_UDEB)
dh_installdeb $(DEBHELPER_PACKAGES_UDEB)
dh_shlibdeps $(DEBHELPER_PACKAGES_UDEB)
dh_gencontrol $(DEBHELPER_PACKAGES_DEB)
2003-04-06 15:35:52 +00:00
$(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 02:16:06 +00:00
binary: binary-arch
.PHONY: build clean binary-indep binary-arch binary install