1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
#!/usr/bin/make -f
package = apex-nslu2
docdir = debian/tmp/usr/share/doc/$(package)
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
CONFIG := debian-nslu2-$(DEB_HOST_ARCH)_config
CC = gcc
CFLAGS = -g -Wall
INSTALL_PROGRAM = install
ifeq (arm,$(DEB_HOST_ARCH))
ENDIAN:=l
endif
ifeq (armel,$(DEB_HOST_ARCH))
ENDIAN:=l
endif
ifeq (armeb,$(DEB_HOST_ARCH))
ENDIAN:=b
endif
# We must not change the build options.
#ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
# CFLAGS += -O2
#endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
build:
$(checkdir)
$(MAKE) $(CONFIG)
$(MAKE)
$(MAKE) -C usr CROSS_COMPILE=
touch build
clean:
$(checkdir)
rm -f build
-$(MAKE) -i distclean
rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars
binary-indep: checkroot build
$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: checkroot build
$(checkdir)
rm -rf debian/$(package)
dh_testroot -a
dh_installdirs
install -d debian/$(package)/boot
install -d debian/$(package)/usr/sbin
install -m 0644 src/arch-arm/rom/apex.bin\
debian/$(package)/boot/apex.flash
install -m 0755 usr/apex-env debian/$(package)/usr/sbin
install -m 0755 usr/flash-apex debian/$(package)/usr/sbin
install -m 0755 usr/apex-image debian/$(package)/usr/sbin
dh_strip
dh_installchangelogs ChangeLog
dh_installdocs -a
dh_installman usr/apex-env.8
dh_installman usr/flash-apex.8
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
define checkdir
test -f src/apex/init.c -a -f debian/rules
endef
binary: binary-indep binary-arch
checkroot:
$(checkdir)
test $$(id -u) = 0
.PHONY: binary binary-arch binary-indep clean checkroot
|