Wichert Akkerman | d321ff9 | 2002-03-31 18:45:45 +0000 | [diff] [blame] | 1 | #! /usr/bin/make -f |
| 2 | |
Roland McGrath | 9a001a7 | 2008-07-18 00:49:31 +0000 | [diff] [blame] | 3 | #export DH_VERBOSE=1 |
Wichert Akkerman | d321ff9 | 2002-03-31 18:45:45 +0000 | [diff] [blame] | 4 | |
Roland McGrath | 38d88e6 | 2004-10-19 23:23:34 +0000 | [diff] [blame] | 5 | DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
Roland McGrath | c9b624f | 2004-08-31 08:40:50 +0000 | [diff] [blame] | 6 | DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
Roland McGrath | 98d5f01 | 2005-02-03 03:19:34 +0000 | [diff] [blame] | 7 | DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 8 | |
Roland McGrath | 75df90e | 2007-08-03 09:59:09 +0000 | [diff] [blame] | 9 | arch64_map = i386=x86_64 powerpc=powerpc64 sparc=sparc64 s390=s390x |
| 10 | ifneq (,$(filter $(DEB_HOST_ARCH)=%, $(arch64_map))) |
| 11 | HOST64 = $(strip $(patsubst $(DEB_HOST_ARCH)=%, %, \ |
| 12 | $(filter $(DEB_HOST_ARCH)=%, $(arch64_map))))-linux-gnu |
Roland McGrath | c9b624f | 2004-08-31 08:40:50 +0000 | [diff] [blame] | 13 | CC64 = gcc -m64 |
Roland McGrath | 75df90e | 2007-08-03 09:59:09 +0000 | [diff] [blame] | 14 | extra_build_targets += stamp-build64 |
Roland McGrath | c9b624f | 2004-08-31 08:40:50 +0000 | [diff] [blame] | 15 | endif |
| 16 | |
Roland McGrath | 38d88e6 | 2004-10-19 23:23:34 +0000 | [diff] [blame] | 17 | ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) |
| 18 | CONFIG_OPTS = --build=$(DEB_BUILD_GNU_TYPE) |
| 19 | else |
| 20 | CONFIG_OPTS = --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) |
| 21 | endif |
| 22 | |
Roland McGrath | 75df90e | 2007-08-03 09:59:09 +0000 | [diff] [blame] | 23 | all build: stamp-build $(extra_build_targets) |
Roland McGrath | c9b624f | 2004-08-31 08:40:50 +0000 | [diff] [blame] | 24 | |
| 25 | stamp-%: %/Makefile |
| 26 | $(MAKE) -C $* |
| 27 | touch $@ |
| 28 | |
| 29 | build/Makefile: |
| 30 | mkdir -p $(@D) |
Roland McGrath | 38d88e6 | 2004-10-19 23:23:34 +0000 | [diff] [blame] | 31 | cd $(@D); sh ../configure --prefix=/usr $(CONFIG_OPTS) |
Roland McGrath | c9b624f | 2004-08-31 08:40:50 +0000 | [diff] [blame] | 32 | |
| 33 | build64/Makefile: |
| 34 | mkdir -p $(@D) |
Roland McGrath | 38d88e6 | 2004-10-19 23:23:34 +0000 | [diff] [blame] | 35 | cd $(@D); CC="$(CC64)" sh ../configure --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64) |
Roland McGrath | c9b624f | 2004-08-31 08:40:50 +0000 | [diff] [blame] | 36 | |
Wichert Akkerman | d321ff9 | 2002-03-31 18:45:45 +0000 | [diff] [blame] | 37 | clean: |
Roland McGrath | 6019fbb | 2008-07-18 00:18:27 +0000 | [diff] [blame] | 38 | dh_clean |
Roland McGrath | 9a001a7 | 2008-07-18 00:49:31 +0000 | [diff] [blame] | 39 | rm -rf debian/strace debian/strace-udeb debian/substvars debian/files debian/files~ |
Roland McGrath | a04e213 | 2008-07-22 00:27:31 +0000 | [diff] [blame] | 40 | rm -rf build64 stamp-build64 strace64.1 |
Roland McGrath | c9b624f | 2004-08-31 08:40:50 +0000 | [diff] [blame] | 41 | rm -rf build stamp-build |
Wichert Akkerman | d321ff9 | 2002-03-31 18:45:45 +0000 | [diff] [blame] | 42 | |
| 43 | binary: binary-indep binary-arch |
| 44 | |
| 45 | binary-indep: |
| 46 | |
Roland McGrath | 75df90e | 2007-08-03 09:59:09 +0000 | [diff] [blame] | 47 | binary-arch: build checkroot |
Wichert Akkerman | d321ff9 | 2002-03-31 18:45:45 +0000 | [diff] [blame] | 48 | test -f stamp-build || make $(MFLAGS) -f debian/rules build |
Dmitry V. Levin | 414fe7d | 2009-07-08 11:21:17 +0000 | [diff] [blame] | 49 | |
Roland McGrath | a04e213 | 2008-07-22 00:27:31 +0000 | [diff] [blame] | 50 | # prepare 64bit executable and manpage, if it has been built |
| 51 | test -f stamp-build64 && ( mv build64/strace build64/strace64 ; \ |
| 52 | cp strace.1 strace64.1 ) || true |
Dmitry V. Levin | 414fe7d | 2009-07-08 11:21:17 +0000 | [diff] [blame] | 53 | |
Roland McGrath | a04e213 | 2008-07-22 00:27:31 +0000 | [diff] [blame] | 54 | dh_testdir -s |
| 55 | dh_testroot -s |
| 56 | dh_installdirs -s |
| 57 | dh_installdocs -s |
| 58 | dh_installman -s |
| 59 | dh_installexamples -s |
Frederik Schüler | f786da5 | 2009-10-05 20:50:07 +0000 | [diff] [blame^] | 60 | dh_installchangelogs -s |
Roland McGrath | a04e213 | 2008-07-22 00:27:31 +0000 | [diff] [blame] | 61 | dh_install -s |
| 62 | dh_link -s |
| 63 | dh_strip -s |
| 64 | dh_compress -s |
| 65 | dh_fixperms -s |
| 66 | dh_installdeb -s |
| 67 | dh_shlibdeps -s |
| 68 | dh_gencontrol -s |
| 69 | dh_md5sums -s |
| 70 | dh_builddeb -s |
Wichert Akkerman | d321ff9 | 2002-03-31 18:45:45 +0000 | [diff] [blame] | 71 | |
| 72 | checkroot: |
| 73 | test root = "`whoami`" |