File: rules

package info (click to toggle)
gpsbabel 1.5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 61,096 kB
  • ctags: 12,887
  • sloc: cpp: 103,128; ansic: 20,310; xml: 12,802; sh: 4,098; makefile: 1,082; perl: 746; tcl: 138
file content (184 lines) | stat: -rwxr-xr-x 4,605 bytes parent folder | download
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PKG_GPSBABEL=gpsbabel
PKG_GPSBABEL_GUI=gpsbabel-gui
DOCTEMP = $(CURDIR)/debian/doctmp
VERSION := $(shell dpkg-parsechangelog | awk '/^Version/ {print $$2}')
HOSTARCH := $(strip $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU))

#we use quilt to handle our patches
include /usr/share/quilt/quilt.make


CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

# Extended precision on i386 results in weird bugs, so we build
# with -ffloat-store.
ifeq (i386,$(HOSTARCH))
CFLAGS += -ffloat-store
endif

LDFLAGS +=  -Wl,-z,defs
CONFENV = LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)"


configure: configure-stamp gui/Makefile
configure-stamp: $(QUILT_STAMPFN)
	dh_testdir
	dh_autotools-dev_updateconfig
	mkdir -p xmldoc/autogen
	$(CONFENV) ./configure \
		--with-zlib=system \
		--with-doc=$(DOCTEMP) \
		--prefix=/usr

	touch $@

debian/gpsbabel.1: build-stamp
	export PATH="$(CURDIR)/gpsbabel:$$PATH" ;\
	help2man 	--manual='gpsbabel documentation' \
			--section=1 \
			--name='GPS route and waypoint data converter' \
			--source='http://www.gpsbabel.org' \
			--locale=C \
			-N \
			--version-string=$(VERSION) \
			--opt-include=$(CURDIR)/debian/gpsbabel.help2man \
			-o $@ \
			./gpsbabel

gui/Makefile: $(QUILT_STAMPFN)
	cd gui && qmake-qt4

debian/gpsbabel.xpm: gui/images/appicon.png
	convert -resize 32x32 $< $@

BUILD_TARGETS_ARCH = build-stamp build-gui-stamp debian/gpsbabel.1
BUILD_TARGETS_INDEP = build-doc-stamp
# indep targets are only built by binary-indep.
build: $(BUILD_TARGETS_ARCH)

build-stamp: configure-stamp debian/gpsbabel.xpm
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	chmod u+x testo
	$(MAKE) check || true
endif

	touch $@

# We need a gpsbabel binary to build the documentation.
build-doc-stamp: build-stamp
	mkdir -p debian/doctmp/htmldoc-devel
	perl xmldoc/makedoc && cd ..
	$(MAKE) gpsbabel.html
	cp gpsbabel.html debian/doctmp
	cp $(CURDIR)/debian/gpsbabel-doc.doc-base-common $(CURDIR)/debian/gpsbabel-doc.doc-base
ifneq (mips,$(HOSTARCH))
	$(MAKE) gpsbabel.pdf WEB=$(DOCTEMP) DOCVERSION=devel
	cp gpsbabel.pdf $(DOCTEMP)
	cat $(CURDIR)/debian/gpsbabel-doc.doc-base-pdf >> $(CURDIR)/debian/gpsbabel-doc.doc-base
endif
	rm -rf debian/doctmp/htmldoc-devel
	touch $@

build-gui: build-gui-stamp
build-gui-stamp: gui/Makefile
	$(MAKE) gui
	touch $@

clean: clean-patched unpatch
clean-patched:
	dh_testdir
	dh_testroot 
	rm -f *-stamp dep doc/*.ps
	rm -rf xmldoc/autogen
	rm -f debian/gpsbabel.xpm

	# Add here commands to clean up after the build process.
	[ ! -f Makefile ] || $(MAKE) clean
	[ ! -f gui/Makefile ] || $(MAKE) gui clean
	rm -rf debian/doctmp xmldoc/autogen/*
	rm -rf Makefile config.h config.log config.status \
		gpsbabel.fo tools/mkcapabilities win32/gpsbabel.rc \
		xmldoc/makedoc \
		zlib/empty jeeps/Makefile shapelib/Makefile
	rm -f debian/*.inc
	rm -rf gui/Makefile gui/objects gui/setup.iss
	rm -f debian/gpsbabel.1
	rm -f gpsbabel.pdf
	rm -f gui/makelinuxdist.sh
	rm -f   xmldoc/formats/tomtom_itn_places.xml \
		xmldoc/formats/options/naviguide-reorder.xml \
		xmldoc/formats/options/naviguide-output.xml \
		xmldoc/filters/options/track-trk2seg.xml \
		xmldoc/filters/options/track-seg2trk.xml
	rm -f gbversion.h
	rm -f $(CURDIR)/debian/gpsbabel-doc.doc-base
	dh_autotools-dev_restoreconfig
	dh_clean

install-prep:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

install-arch: $(BUILD_TARGETS_ARCH) install-prep

	# Add here commands to install the package into debian/gpsbabel.
	$(MAKE) install DESTDIR=$(CURDIR)/debian/gpsbabel

	dh_install -a 

install-indep: $(BUILD_TARGETS_INDEP) install-prep
	dh_install -i


install: install-arch install-indep

# Build architecture-independent files here.
binary-indep: build-indep install-indep
	dh_testdir 
	dh_testroot
	dh_installchangelogs -i 
	dh_installdocs -i
	dh_link -i 
	dh_compress -i -X.pdf -X.html
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build-arch install-arch
	dh_testdir
	dh_testroot
	dh_installchangelogs -a
	dh_installdocs -a
	dh_installman -a
	dh_installmenu -a
	dh_strip -a
	dh_compress -a -X.pdf -X.html
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install install-prep install-arch install-indep build-arch build-indep configure