source: subversion/applications/editors/merkaartor/debian/rules @ 14369

Last change on this file since 14369 was 14204, checked in by joerg, 11 years ago

Add option parsing to allow DEB_BUILD_OPTIONS='parallel=4' which triggers 'make -j4'; only do clean if debuild clean is called

File size: 1.3 KB
Line 
1#!/usr/bin/make -f
2
3CFLAGS = -Wall -g
4ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
5        CFLAGS += -O0
6else
7        CFLAGS += -O2
8endif
9
10# Get options like
11#       export DEB_BUILD_OPTIONS="parallel=4"
12debian_build_options_list:=$(shell echo "$$DEB_BUILD_OPTIONS"|sed 's/[^-_=[:alnum:]]/ /g'|tr a-z- A-Z_)
13$(foreach o, $(debian_build_options_list), $(if $(findstring =,$o),$(eval DEB_BUILD_OPT_$o),$(eval DEB_BUILD_OPT_$o=1)))
14MAKE_-J += $(addprefix -j, $(DEB_BUILD_OPT_PARALLEL))
15
16configure: configure-stamp
17configure-stamp:
18        dh_testdir
19        /usr/share/qt4/bin/qmake
20        touch configure-stamp
21
22build-indep:
23
24build build-arch: build-stamp
25build-stamp: configure-stamp
26        dh_testdir
27        $(MAKE) $(MAKE_-J)
28        touch $@
29
30clean:
31        dh_testdir
32        dh_testroot
33        [ ! -f Makefile ] || $(MAKE) $(MAKE_-J) distclean
34        dh_clean
35        rm -f build-stamp configure-stamp
36
37install: build
38        dh_testdir
39        dh_testroot
40#       dh_clean -k
41        dh_installdirs
42        install -D binaries/debug/bin/merkaartor $(CURDIR)/debian/merkaartor/usr/bin
43
44binary-indep:
45binary binary-arch: install
46        dh_installchangelogs CHANGELOG
47        dh_installdocs
48        dh_installexamples Data/*
49        dh_installmenu
50        dh_installman debian/merkaartor.1
51        dh_strip
52        dh_compress
53        dh_fixperms
54        dh_installdeb
55        dh_shlibdeps
56        dh_gencontrol
57        dh_md5sums
58        dh_builddeb
59
60.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install configure
Note: See TracBrowser for help on using the repository browser.