4 DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
5 DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
6 SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p')
7 VERSION_DEBIAN := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\)$$,\1,p')
8 VERSION := $(shell echo "$(VERSION_DEBIAN)" | sed -e 's,^[^:]*:,,' -e 's,-[^-]*$$,,')
10 BUILD_DIR = debian/build
11 STAMPS_DIR = debian/stamps
13 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
16 ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
20 source: $(STAMPS_DIR)/source
22 $(STAMPS_DIR)/source: SOURCE_FILES = $(filter-out debian, $(wildcard * .[^.]*))
23 $(STAMPS_DIR)/source: DIR = $(BUILD_DIR)/source
27 mkdir -p $(STAMPS_DIR) '$(DIR)'
28 cp -al $(SOURCE_FILES) '$(DIR)'
29 cd $(DIR); QUILT_PATCHES=$(CURDIR)/debian/patches quilt --quiltrc /dev/null push -a || test $$? = 2
32 setup: $(STAMPS_DIR)/setup_busybox
34 $(STAMPS_DIR)/setup_%: SOURCE_DIR=$(BUILD_DIR)/source
35 $(STAMPS_DIR)/setup_%: DIR=$(BUILD_DIR)/build_$*
36 $(STAMPS_DIR)/setup_%: $(STAMPS_DIR)/source
39 cp -al '$(SOURCE_DIR)' '$(DIR)'
40 cp debian/config/config.$* '$(DIR)'/.config
41 make -C '$(DIR)' oldconfig
44 build: $(STAMPS_DIR)/build_busybox
46 $(STAMPS_DIR)/build_%: DIR=$(BUILD_DIR)/build_$*
47 $(STAMPS_DIR)/build_%: $(STAMPS_DIR)/setup_%
49 make -C '$(DIR)' THUMB=$(THUMB) busybox docs/busybox.1 BB_EXTRA_VERSION="$(shell lsb_release -is) $(VERSION_DEBIAN)"
50 make -C '$(DIR)' busybox.links
53 $(BUILD_DIR) $(STAMPS_DIR):
54 @[ -d $@ ] || mkdir $@
57 rm -rf $(filter-out .svn debian, $(wildcard * .[^.]*))
61 rm -rf $(BUILD_DIR) $(STAMPS_DIR)
66 binary-arch: binary-arch_busybox binary-arch_all
68 binary-arch_busybox: DIR = $(BUILD_DIR)/build_busybox
69 binary-arch_busybox: DH_OPTIONS = -pbusybox-power
70 binary-arch_busybox: $(STAMPS_DIR)/build_busybox
74 install -D -m644 debian/scripts/functions debian/busybox-power/opt/busybox-power/functions
75 install -D -m755 debian/scripts/install-binary.sh debian/busybox-power/opt/busybox-power/install-binary.sh
76 install -D -m755 debian/scripts/uninstall-binary.sh debian/busybox-power/opt/busybox-power/uninstall-binary.sh
77 install -D -m755 $(DIR)/busybox_unstripped debian/busybox-power/opt/busybox-power/busybox.power
81 dh_installdocs -pbusybox-power
82 dh_installchangelogs -pbusybox-power
83 dh_strip -pbusybox-power
84 dh_compress -pbusybox-power
90 dh_shlibdeps -pbusybox-power
95 binary: binary-indep binary-arch
97 DIR_ORIG = ../orig/$(SOURCE)-$(VERSION)
98 TAR_ORIG_NAME = $(SOURCE)_$(VERSION).orig.tar.gz
99 TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))
102 rsync --delete --exclude debian --exclude .svk --exclude .svn --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
106 $(error Cannot find orig tarball $(TAR_ORIG_NAME))
109 tar -C ../orig -xzf $(TAR_ORIG)