2002-03-31 22:45:45 +04:00
#! /usr/bin/make -f
2010-04-13 15:04:00 +04:00
#export DH_VERBOSE=1
2010-02-04 23:14:56 +03:00
2014-06-03 16:56:42 +04:00
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
2018-02-25 03:31:14 +03:00
include /usr/share/dpkg/architecture.mk
2014-06-03 16:56:42 +04:00
CFLAGS += -Wall -g
2010-02-04 23:14:56 +03:00
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
2002-03-31 22:45:45 +04:00
2010-04-13 15:04:00 +04:00
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
2018-02-12 21:28:16 +03:00
extra_build_targets += build-udeb-stamp
2007-08-03 13:59:09 +04:00
arch64_map = i386=x86_64 powerpc=powerpc64 sparc=sparc64 s390=s390x
ifneq (,$(filter $(DEB_HOST_ARCH)=%, $(arch64_map)))
HOST64 = $(strip $(patsubst $(DEB_HOST_ARCH)=%, %, \
$(filter $(DEB_HOST_ARCH)=%, $(arch64_map))))-linux-gnu
2004-08-31 12:40:50 +04:00
CC64 = gcc -m64
2010-04-13 15:04:00 +04:00
extra_build_targets += build64-stamp
2004-08-31 12:40:50 +04:00
endif
2004-10-20 03:23:34 +04:00
ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CONFIG_OPTS = --build=$(DEB_BUILD_GNU_TYPE)
else
CONFIG_OPTS = --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif
2014-08-15 17:14:15 +04:00
all: build
build: build-arch build-indep
build-arch: build-stamp $(extra_build_targets)
build-indep: build-stamp $(extra_build_targets)
2004-08-31 12:40:50 +04:00
2018-02-25 03:31:14 +03:00
configure:
./bootstrap
2010-04-13 15:04:00 +04:00
%-stamp: %/Makefile
2004-08-31 12:40:50 +04:00
$(MAKE) -C $*
2011-02-27 13:16:41 +03:00
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
2018-02-12 21:28:16 +03:00
$*/strace -V
2016-06-06 02:08:58 +03:00
$(MAKE) -C $* check VERBOSE=1
2011-02-27 13:16:41 +03:00
endif
2004-08-31 12:40:50 +04:00
touch $@
2018-02-25 03:31:14 +03:00
build/Makefile: configure
2004-08-31 12:40:50 +04:00
mkdir -p $(@D)
2018-01-10 05:43:41 +03:00
cd $(@D); sh ../configure --enable-mpers=check --prefix=/usr $(CONFIG_OPTS)
2004-08-31 12:40:50 +04:00
2018-02-25 03:31:14 +03:00
build-udeb/Makefile: configure
2018-02-12 21:28:16 +03:00
mkdir -p $(@D)
cd $(@D); sh ../configure --enable-mpers=check --prefix=/usr \
--without-libunwind --without-libiberty $(CONFIG_OPTS)
2018-02-25 03:31:14 +03:00
build64/Makefile: configure
2004-08-31 12:40:50 +04:00
mkdir -p $(@D)
2018-01-10 05:43:41 +03:00
cd $(@D); CC="$(CC64)" sh ../configure --enable-mpers=check --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64)
2002-03-31 22:45:45 +04:00
clean:
2010-02-04 23:14:56 +03:00
dh_testdir
dh_testroot
2018-02-12 21:28:16 +03:00
rm -rf build build-udeb build64 strace64.1 debian/strace64.substvars
2008-07-18 04:18:27 +04:00
dh_clean
2002-03-31 22:45:45 +04:00
binary: binary-indep binary-arch
binary-indep:
2010-02-04 23:14:56 +03:00
binary-arch: build
2010-04-13 15:04:00 +04:00
test -f build-stamp || make $(MFLAGS) -f debian/rules build
2009-07-08 15:21:17 +04:00
2008-07-22 04:27:31 +04:00
# prepare 64bit executable and manpage, if it has been built
2010-04-13 15:04:00 +04:00
test -f build64-stamp && ( mv build64/strace build64/strace64 ; \
2018-02-25 03:31:14 +03:00
mv build64/strace.1 build64/strace64.1 ) || true
2009-07-08 15:21:17 +04:00
2016-12-16 13:24:28 +03:00
dh_testdir -a
dh_testroot -a
dh_installdirs -a
dh_installdocs -a
dh_installman -a
dh_installexamples -a
dh_installchangelogs -a
dh_install -a
dh_link -a
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a