File: rules

package info (click to toggle)
gnustep-make 2.0.6-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,272 kB
  • ctags: 159
  • sloc: perl: 15,898; sh: 4,046; makefile: 275; csh: 48; objc: 27
file content (445 lines) | stat: -rwxr-xr-x 13,754 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
#! /usr/bin/make -f
# -*- makefile -*-

# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets  by Bill Allombert 2001

# =============================================================================
# * Configuration variables:

# Should we relocate files to comply with the FHS and Debian policy?
# (use "yes" or "no")
#   *Note:* if you change this setting to "no", it is recommended that you also
#   change root as well to something other than the Debian default.  This will
#   prevent other GNUstep packages from accidentally conflicting with your
#   custom packages.
GS_USE_FHS = yes

# Directories:
# Root of GNUstep tree
# (Default to a different directory if we are not following the FHS.)
ifeq ($(GS_USE_FHS),yes)
GS_ROOT = /usr/lib/GNUstep
else
GS_ROOT = /usr/GNUstep
endif
# Root of System domain
GS_SYSTEM_ROOT = $(GS_ROOT)/System
# Root of Local domain
GS_USRLOCAL	= /usr/local/lib/GNUstep
GS_LOCAL_ROOT	= $(GS_USRLOCAL)/Local
# Root of Network domain
GS_NETWORK_ROOT	= $(GS_USRLOCAL)/Network

# End of configuration variables
# =============================================================================

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

# bashism: we're using brace expansion
export SHELL=/bin/bash

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

# make some files executable
dummy := $(shell chmod +x config.guess clean_cpu.sh clean_os.sh \
			cpu.sh os.sh configure mkinstalldirs)

# package names
p_common	= gnustep-common
p_make		= gnustep-make
p_make_ogo	= $(p_make)-ogo
p_doc		= $(p_make)-doc

# package build dirs
b_make		= $(CURDIR)/build-$(p_make)
b_make_ogo	= $(CURDIR)/build-$(p_make_ogo)

# package temp dirs
d_common	= $(CURDIR)/debian/$(p_common)
d_make		= $(CURDIR)/debian/$(p_make)
d_make_ogo	= $(CURDIR)/debian/$(p_make_ogo)
d_doc		= $(CURDIR)/debian/$(p_doc)

# gcc/gobjc
CC = gcc
CXX = g++
V_OBJC	= 4:4.2

# -----------------------------------------------------------------------------
# GNUstep SETTINGS

GS_SHARE_DIR	= usr/share/GNUstep

# which directory structure are we using? FHS or the default GNUstep?
ifeq ($(GS_USE_FHS),yes)
  dir_struct = fhs
  GS_FS_LAYOUT = fhs-system
  GS_DOC_DIR	= /$(GS_SHARE_DIR)/Documentation
  GS_MAKE_DIR	= /$(GS_SHARE_DIR)/Makefiles
  GS_SCRIPT_DIR	= $(GS_SYSTEM_ROOT)/Tools
  GS_TOOLS_DIR	= /usr/bin
else
  dir_struct = gnustep
  GS_FS_LAYOUT = gnustep
  GS_DOC_DIR	= $(GS_SYSTEM_ROOT)/Library/Documentation
  GS_MAKE_DIR	= $(GS_SYSTEM_ROOT)/Library/Makefiles
  GS_SCRIPT_DIR	= $(GS_MAKE_DIR)
  GS_TOOLS_DIR	= $(GS_SYSTEM_ROOT)/Tools
endif

GS_FS_PACKAGE = gnustep-fslayout-$(dir_struct)

# (Other directories are set above)
GS_LIBS_DIR	= $(GS_SYSTEM_ROOT)/Library/Libraries

# Library combo
GS_LIBRARY_COMBO	= gnu-gnu-gnu

# --------------------
# OpenGroupware.org SETTINGS

GS_OGO_ROOT         = usr/lib/opengroupware.org
GS_OGO_USRLOCAL	    = usr/local/lib/opengroupware.org
GS_OGO_SYSTEM_ROOT  = $(GS_OGO_ROOT)/System
GS_OGO_LOCAL_ROOT   = $(GS_OGO_USRLOCAL)/Local
GS_OGO_NETWORK_ROOT = $(GS_OGO_USRLOCAL)/Network
GS_OGO_DOC_DIR      = $(GS_OGO_SYSTEM_ROOT)/Library/Documentation
GS_OGO_LIBS_DIR	    = $(GS_OGO_SYSTEM_ROOT)/Library/Libraries
GS_OGO_ETC_DIR      = /etc/opengroupware.org/

# Library combo for OpenGroupware.org
GS_OGO_LIBRARY_COMBO	= gnu-fd-nil

# -----------------------------------------------------------------------------

sed_var_subst_gs = sed -e 's:@GS_USE_FHS@:$(GS_USE_FHS):g' \
		       -e 's:@GS_ROOT@:$(GS_ROOT):g' \
		       -e 's:@GS_SYSTEM_ROOT@:$(GS_SYSTEM_ROOT):g' \
		       -e 's:@GS_LOCAL_ROOT@:$(GS_LOCAL_ROOT):g' \
		       -e 's:@GS_NETWORK_ROOT@:$(GS_NETWORK_ROOT):g' \
		       -e 's:@GS_DOC_DIR@:$(GS_DOC_DIR):g' \
		       -e 's:@GS_MAKE_DIR@:$(GS_MAKE_DIR):g' \
		       -e 's:@GS_SCRIPT_DIR@:$(GS_SCRIPT_DIR):g' \
		       -e 's:@GS_FS_PACKAGE@:$(GS_FS_PACKAGE):g' \


# prepare the tree for building
dir_struct_files = dh_gnustep $(p_common).links $(p_common).dirs \
		$(p_common).postinst $(p_common).prerm
in_files = config.mk $(p_make).dirs \
		$(p_common).overrides $(p_make).overrides \
		app-wrapper.sh tool-wrapper.sh gs_make
prep: debian/prep-stamp
clean_files += debian/prep-stamp
debian/prep-stamp:
	dh_testdir

	@ # copy files that control the directory structure with variable subst
	for i in $(dir_struct_files); do \
	  [ -e debian/$(dir_struct)/$$i ] && \
	    cp debian/$(dir_struct)/$$i debian/$$i || true; \
	  [ -e debian/$(dir_struct)/$$i.in ] && \
	    $(sed_var_subst_gs) debian/$(dir_struct)/$$i.in > debian/$$i || true; \
	done

	chmod +x debian/dh_gnustep

	for i in $(in_files); do \
	  $(sed_var_subst_gs) debian/$$i.in > debian/$$i; \
	done

	chmod +x debian/gs_make

	touch $@

clean_files += $(foreach file,$(dir_struct_files),debian/$(file))
clean_files += $(foreach file,$(in_files),debian/$(file))
clean_files += debian/app-wrapper-ogo.sh debian/tool-wrapper-ogo.sh


debian/control debian/control.tmp: debian/control.in debian/rules
	$(sed_var_subst_gs) debian/control.in > $@


clean_files += debian/$(p_make)-configure-stamp
debian/$(p_make)-configure-stamp: configure
	dh_testdir

	-mkdir $(b_make)

	cd $(b_make) && CC=$(CC) CXX=$(CXX) ../configure \
		--with-layout=$(GS_FS_LAYOUT) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--host=$(DEB_HOST_GNU_TYPE) \
		--target=$(DEB_HOST_GNU_TYPE) \
		--enable-native-objc-exceptions \

	touch $@


clean_files += debian/$(p_make_ogo)-configure-stamp
debian/$(p_make_ogo)-configure-stamp: configure
	dh_testdir

	@ # Generate postinst file
#	sed -e 's:@GSROOT@:/$(GS_OGO_ROOT):g' \
		debian/postinst.in > debian/$(p_make_ogo).postinst

	@ # Generate postrm file
#	sed -e 's:@GSROOT@:/$(GS_OGO_ROOT):g' \
		debian/postrm.in > debian/$(p_make_ogo).postrm

	-mkdir $(b_make_ogo)

	cd $(b_make_ogo) && CC=$(CC) CXX=$(CXX) ../configure \
		--with-layout=debian-ogo \
		--with-library-combo=$(GS_OGO_LIBRARY_COMBO) \
		--with-config-file=$(GS_OGO_ETC_DIR)/GNUstep.conf \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--host=$(DEB_HOST_GNU_TYPE) \
		--target=$(DEB_HOST_GNU_TYPE) \
		--enable-native-objc-exceptions \

	touch $@

clean_files += debian/$(p_make_ogo).postinst debian/$(p_make_ogo).postrm


# NOTE: The Build-Indep-Depends are only available, when building the
# build-indep packages.
build: build-arch # build-indep

build-arch: debian/build-arch-stamp
clean_files += debian/build-arch-stamp
debian/build-arch-stamp: debian/$(p_make)-configure-stamp
	$(MAKE) -C $(b_make)
	#$(MAKE) -C $(b_make_ogo)
	touch $@


build-indep: debian/build-indep-stamp
clean_files += debian/build-indep-stamp
debian/build-indep-stamp: binary-arch
	# Workaround for broken Makefiles
	#cp $(b_make)/Documentation/GNUmakefile Documentation

	GNUSTEP_MAKEFILES=$(d_make)/$(GS_MAKE_DIR) \
	  $(MAKE) -C Documentation
	# cd Documentation; htlatex internals.tex
	touch $@


install: install-indep install-arch
install-indep: debian/install-indep-stamp
clean_files += debian/install-indep-stamp
debian/install-indep-stamp: build-indep install-arch prep
	dh_testdir
	dh_testroot
	dh_clean -k -p$(p_doc)
	dh_installdirs -p$(p_doc) \
		usr/share/doc/$(p_make)

	GNUSTEP_MAKEFILES=$(d_make)/$(GS_MAKE_DIR) \
	  $(MAKE) -C Documentation install \
		DESTDIR=$(d_doc)

	@ # Install Internals doc
	dh_install -p$(p_doc) -X .arch-ids debian/Internals $(GS_DOC_DIR)/Developer/Make/Manual

	@ # remove postscript doc
	-find $(d_doc)/$(GS_DOC_DIR) -name '*.ps' | xargs rm -f

	@ # remove info doc
	rm -rf $(d_doc)/usr/share/info

	@ # remove man pages (installed in gnustep-common)
	rm -rf $(d_doc)/usr/share/man
	touch $@


install-arch: debian/install-arch-stamp
clean_files += debian/install-arch-stamp
common_scripts = GNUstep-reset.sh GNUstep.csh GNUstep.sh config.guess \
		config.sub cpu.sh clean_cpu.sh vendor.sh clean_vendor.sh \
		os.sh clean_os.sh fixpath.sh ld_lib_path.csh ld_lib_path.sh \
		filesystem.sh filesystem.csh
cdbs_dir = usr/share/cdbs/1
debian/install-arch-stamp: build-arch prep
	dh_testdir
	dh_testroot
	dh_clean -k -a
	dh_installdirs

	$(MAKE) -C $(b_make) install DESTDIR=$(d_common)
	#$(MAKE) -C $(b_make_ogo) install DESTDIR=$(d_make_ogo)

	install -m 755 debian/dh_gnustep $(d_make)/usr/bin
	install -m 755 debian/gs_make $(d_make)/usr/bin
	install -m 644 debian/config.mk $(d_make)/$(GS_SHARE_DIR)/debian

	install -m 644 debian/cdbs/gnumakefile.mk $(d_make)/$(cdbs_dir)/class
	install -m 644 debian/cdbs/gnustep.mk $(d_make)/$(cdbs_dir)/rules
	install -m 644 debian/cdbs/*.in $(d_make)/$(GS_SHARE_DIR)/debian

	@ # move makefiles from gnustep-common to gnustep-make, then move
	@ # the necessary scripts back to gnustep-common
	mv $(d_common)/$(GS_MAKE_DIR) $(d_make)/$(GS_MAKE_DIR)
	install -d $(d_common)/$(GS_MAKE_DIR)
	for i in $(common_scripts); do \
	  mv $(d_make)/$(GS_MAKE_DIR)/$$i $(d_common)/$(GS_MAKE_DIR); \
	done
	install -d $(d_make)/$(GS_TOOLS_DIR)
	mv $(d_common)/$(GS_TOOLS_DIR)/gnustep-config $(d_make)/$(GS_TOOLS_DIR)

	@ # remove info dir
#	rmdir $(d_common)/$(GS_SYSTEM_ROOT)/Library/Documentation/info
#	rmdir $(d_make_ogo)/$(GS_OGO_DOC_DIR)/info

#	rm -f $(d_common)/$(GS_SYSTEM_ROOT)/share/config.site
#	rm -f $(d_make_ogo)/$(GS_OGO_SYSTEM_ROOT)/share/config.site
#	-rmdir $(d_common)/$(GS_SYSTEM_ROOT)/share
#	-rmdir $(d_make_ogo)/$(GS_OGO_SYSTEM_ROOT)/share

	rm -f $(d_make)/$(GS_MAKE_DIR)/app-wrapper.template

	@ # replace config.sub, config.guess with versions from autotools-dev
	rm $(d_common)/$(GS_MAKE_DIR)/config.sub
	rm $(d_common)/$(GS_MAKE_DIR)/config.guess
	ln -s /usr/share/misc/config.sub $(d_common)/$(GS_MAKE_DIR)
	ln -s /usr/share/misc/config.guess $(d_common)/$(GS_MAKE_DIR)

	@ # override lintian warnings
	dh_installdirs -p$(p_common) usr/share/lintian/overrides
	cp -p debian/$(p_common).overrides \
		$(d_common)/usr/share/lintian/overrides/$(p_common)
	dh_installdirs -p$(p_make) usr/share/lintian/overrides
	cp -p debian/$(p_make).overrides \
		$(d_make)/usr/share/lintian/overrides/$(p_make)
	#dh_installdirs -p$(p_make_ogo) usr/share/lintian/overrides
	#cp -p debian/$(p_make_ogo).overrides \
	#	$(d_make_ogo)/usr/share/lintian/overrides/$(p_make_ogo)

	@ # according to policy manual 10.1.2 --> postinst/prerm
	@ # Now use dh_usrlocal debhelper program.

	touch $@


# Build architecture independant packages
binary-indep: install-indep install-arch
	dh_testdir
	dh_testroot
	dh_installchangelogs -i ChangeLog
	dh_installdocs -i ANNOUNCE NEWS README
	dh_link -p $(p_doc) \
	  $(GS_DOC_DIR)/Developer usr/share/doc/$(p_make)/Developer \
	  $(GS_DOC_DIR)/User usr/share/doc/$(p_make)/User \
	  usr/share/doc/$(p_make)/Developer usr/share/doc/$(p_doc)/Developer \
	  usr/share/doc/$(p_make)/User usr/share/doc/$(p_doc)/User \
	  usr/share/doc/$(p_make)/User/GNUstep/FAQ usr/share/doc/$(p_make)/FAQ \
	  usr/share/doc/$(p_make)/FAQ usr/share/doc/$(p_doc)/FAQ
#	dh_installinfo -i
	debian/dh_gnustep -i

	@ # remove man pages (duplicated)
	rm -rf $(d_doc)/usr/share/man

	dh_usrlocal -i
	dh_compress -i -X make.pdf
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i


# Build architecture dependant packages
binary-arch: install-arch
	dh_testdir
	dh_testroot
	dh_installchangelogs -a ChangeLog
	dh_installdocs -a ANNOUNCE NEWS README

	@ # relocate files
ifeq ($(GS_USE_FHS),yes)
## FIXME: GNUstep.csh and GNUstep.sh shouldn't be in /usr/share, since they
## contain architecture-specific strings
#	for i in GNUstep.csh GNUstep.sh; do \
	  mv $(d_common)/$(GS_SYSTEM_ROOT)/Library/Makefiles/$$i $(d_common)/$(GS_SCRIPT_DIR); \
	  ln -s $(GS_SCRIPT_DIR)/$$i $(d_common)/$(GS_SYSTEM_ROOT)/Library/Makefiles/$$i; \
	done

#	install -d $(d_make)/$(GS_SCRIPT_DIR)
#	mv $(d_make)/$(GS_SYSTEM_ROOT)/Library/Makefiles/which_lib $(d_make)/$(GS_SCRIPT_DIR);
#	ln -s $(GS_SCRIPT_DIR)/which_lib $(d_make)/$(GS_SYSTEM_ROOT)/Library/Makefiles/which_lib;
endif
	debian/dh_gnustep -a

	dh_installman -p$(p_common) \
	    Documentation/GNUstep.7 Documentation/openapp.1

	pod2man debian/dh_gnustep debian/dh_gnustep.1
	dh_installman -p$(p_make) \
	    debian/dh_gnustep.1

	@ # support obsolete gsdh_gnustep (for now)
	dh_link -p$(p_make) usr/bin/dh_gnustep usr/bin/gsdh_gnustep \
	  usr/share/man/man1/dh_gnustep.1.gz usr/share/man/man1/gsdh_gnustep.1.gz

	dh_link -a
	dh_usrlocal -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

clean_files += debian/dh_gnustep.1


# Test that debian/control is up to date
clean_files += debian/control.tmp
test-control: debian/control.tmp
	diff debian/control debian/control.tmp && rm -f debian/control.tmp


clean: test-control
	dh_testdir
	dh_testroot

	@ # Clean Documentation dir
#	if .../GNUstep.sh doesn't exist, then we assume the documentation dir
#	is clean
	if [ -e $(d_common)/$(GS_MAKE_DIR)/GNUstep.sh ]; then \
	  GNUSTEP_MAKEFILES=$(d_make)/$(GS_MAKE_DIR) \
	    $(MAKE) -C Documentation clean; \
	  GNUSTEP_MAKEFILES=$(d_make)/$(GS_MAKE_DIR) \
	    $(MAKE) -C Documentation distclean; \
	fi

	rm -f config-precomp-test/a.out config-precomp-test/gs_precomp_test.h.gch
	rm -f Documentation/*.{aux,dvi,gz,info,html,log,ps,toc,vr,vrs,pdf}
	rm -f Documentation/version.texi
	rm -f Documentation/{ANNOUNCE,FAQ,GNUstep-HOWTO,INSTALL,NEWS,README}

	@ # Clean build dirs
	rm -rf $(b_make) $(b_make_ogo)

	rm -f $(clean_files)

	dh_clean


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