megactl/debian/rules

72 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2017-04-22 15:01:27 +02:00
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/dpatch/dpatch.make
ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq ($(ARCH),i386)
MY_MAKEOPTS="ARCH=-m32"
2017-04-22 16:58:36 +02:00
MT_MAKEOPTS="ARCH=-m32"
2017-04-22 15:01:27 +02:00
else
MY_MAKEOPTS="ARCH=-m64"
2017-04-22 16:58:36 +02:00
MT_MAKEOPTS="ARCH=-m32"
2017-04-22 15:01:27 +02:00
endif
# $(MAKE) CFLAGS="$(CFLAGS) \$$(INC) \$$(ARCH)" -C src/
build: build-stamp
build-stamp: patch-stamp
dh_testdir
2017-04-22 16:58:36 +02:00
$(MAKE) $(MT_MAKEOPTS) CFLAGS="$(CFLAGS) \$$(INC) \$$(ARCH)" -C src/ megatrace
2017-04-22 16:51:10 +02:00
mv src/megatrace src/megatrace.i386
$(MAKE) clean -C src/
2017-04-22 15:01:27 +02:00
$(MAKE) $(MY_MAKEOPTS) CFLAGS="$(CFLAGS) \$$(INC) \$$(ARCH)" -C src/
2017-04-22 16:51:10 +02:00
mv src/megatrace.i386 src/megatrace
2017-04-22 15:01:27 +02:00
touch $@
clean: unpatch
dh_testdir
dh_testroot
rm -f build-stamp
$(MAKE) clean -C src/
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_install
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
ifeq ($(ARCH),i386)
dh_shlibdeps
endif
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install