File: rules

package info (click to toggle)
massxpert 3.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 24,376 kB
  • ctags: 3,634
  • sloc: cpp: 46,733; xml: 7,368; sh: 658; makefile: 122; ansic: 7
file content (192 lines) | stat: -rwxr-xr-x 4,316 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
185
186
187
188
189
190
191
192
#!/usr/bin/make -f
# Based on the initial work of Joey Hess and Craig Small.

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

CMAKE=/usr/bin/cmake

DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

BUILD_INDEP_DIR = $(CURDIR)/debian/build-indep
BUILD_ARCH_DIR = $(CURDIR)/debian/build-arch

INSTALL_INDEP_DIR = $(CURDIR)/debian/tmp-indep
INSTALL_ARCH_DIR = $(CURDIR)/debian/tmp-arch

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

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
         MAKEFLAGS += -j$(NUMJOBS)
endif

$(info "---------------------------------------")
$(info NUMJOBS: $(NUMJOBS))
$(info MAKEFLAGS: $(MAKEFLAGS))
$(info DEB_BUILD_OPTIONS: $(DEB_BUILD_OPTIONS))
$(info "---------------------------------------")

# Hardening stuff for debhelper compat level 9, see
# http://wiki.debian.org/Hardening

# To enable all, uncomment following line
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)

.NOTPARALLEL: 


.PHONY: clean
clean:
	dh_testdir
	dh_testroot

	dh_clean

# The following is for the binary software
	rm -rf $(BUILD_INDEP_DIR)
	rm -rf $(BUILD_ARCH_DIR)
	rm -rf $(INSTALL_INDEP_DIR) $(INSTALL_ARCH_DIR)

# No more used because we now use CMake with UseLATEX.cmake
# The following is for the user manual
#	cd $(CURDIR)/usermanual && $(MAKE) distclean


build-indep-stamp: 
	dh_testdir
	dh_prep -i

	rm -rf $(INSTALL_INDEP_DIR)
	mkdir -p $(BUILD_INDEP_DIR)

# The following is for building of the user manual
	cd $(BUILD_INDEP_DIR) && \
	$(CMAKE) \
	-D BUILD_PROGRAM=0 \
	-D BUILD_DATA=1 \
	-D BUILD_USERMANUAL=1 \
	-D CMAKE_INSTALL_PREFIX=/usr ../.. 

	# No more this way, as we now use CMake with UseLATEX.cmake
	# cd $(CURDIR)/usermanual && $(MAKE) -f Makefile all_no_reload
	$(MAKE) -C $(BUILD_INDEP_DIR)

	touch build-indep-stamp


build-arch-stamp: 
	dh_testdir
	dh_prep -a

	rm -rf $(INSTALL_ARCH_DIR)
	mkdir -p $(BUILD_ARCH_DIR)

# The following is for building of the binary massxpert software
	cd $(BUILD_ARCH_DIR) && \
	$(CMAKE) -D CMAKE_BUILD_TYPE=debug \
	-D BUILD_PROGRAM=1 \
	-D BUILD_DATA=0 \
	-D BUILD_USERMANUAL=0 \
	-D CMAKE_INSTALL_PREFIX=/usr ../.. 

	$(MAKE) -C $(BUILD_ARCH_DIR)

	touch build-arch-stamp


.PHONY: build
build: build-indep-stamp build-arch-stamp

.PHONY: build-indep
build-indep: build-indep-stamp

.PHONY: build-arch
build-arch: build-arch-stamp


install-indep-stamp: build-indep-stamp
	dh_testdir
	dh_testroot
	dh_installdirs -i

	mkdir -p $(INSTALL_INDEP_DIR)
	$(MAKE) -C $(BUILD_INDEP_DIR) install DESTDIR=$(INSTALL_INDEP_DIR)

# Remove the license file
	rm $(INSTALL_INDEP_DIR)/usr/share/doc/massxpert/COPYING

	touch install-indep-stamp


install-arch-stamp: build-arch-stamp
	dh_testdir
	dh_testroot
	dh_installdirs -a

	mkdir -p $(INSTALL_ARCH_DIR)
	$(MAKE) -C $(BUILD_ARCH_DIR) install DESTDIR=$(INSTALL_ARCH_DIR)

# Install menu pixmap
	install -o root -g root -d $(INSTALL_ARCH_DIR)/usr/share/pixmaps
	install -o root -g root -m 644 \
	$(CURDIR)/gui/images/massxpert-icon-32.xpm \
	$(INSTALL_ARCH_DIR)/usr/share/pixmaps/massxpert-icon-32.xpm

# Remove the license file
	rm $(INSTALL_ARCH_DIR)/usr/share/doc/massxpert/COPYING

	touch install-arch-stamp


# Build architecture-independent files here.
.PHONY: binary-indep
binary-indep: install-indep-stamp
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i
	dh_installdocs -i
	dh_install -i
	dh_installman -i
	dh_compress -Xmassxpert.pdf -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i


# Build architecture-dependent files here.
.PHONY: binary-arch
binary-arch: install-arch-stamp
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs  -a
	dh_installdocs -a
	dh_install -a
	dh_installman -a
	dh_strip --dbg-package=massxpert-dbg -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a


.PHONY: binary
binary: binary-indep binary-arch