File: rules

package info (click to toggle)
gforth 0.7.0+ds2-0.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,808 kB
  • sloc: ansic: 8,506; sh: 3,660; lisp: 1,783; makefile: 993; yacc: 186; sed: 141; lex: 102; awk: 21
file content (71 lines) | stat: -rwxr-xr-x 2,333 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.

DEB_HOST_MULTIARCH?=	$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

CFLAGS=		$(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS=	$(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS=	$(shell dpkg-buildflags --get LDFLAGS)
export CFLAGS CPPFLAGS LDFLAGS

GFORTH_VER = `sed -e 's/^[^ ]\+ (\([^)+-]\+\).*/\1/; 1q' debian/changelog`
D = $(CURDIR)/debian/gforth
DC = $(CURDIR)/debian/gforth-common
DL = $(CURDIR)/debian/gforth-lib
ULIB = $D/usr/lib/$(DEB_HOST_MULTIARCH)/gforth/$(GFORTH_VER)
USHARE = $D/usr/share/gforth/$(GFORTH_VER)

# arch-specific options
common_opts :=--with-lispdir=/usr/share/emacs/site-lisp/gforth
m68k_opts   :=--enable-force-reg 

configure_options := $(common_opts)

ifeq ($(DEB_BUILD_ARCH),m68k)
configure_options = $(common_opts) $(m68k_opts)
endif

shellout := $(shell ls -d debian/kernl-save 2> /dev/null)
save-dir=frog$(shellout)

override_dh_auto_configure:
	[ -f prim.b.backup ] || cp -p prim.b prim.b.backup
	[ -f engine/prim.i.backup ] || cp -p engine/prim.i engine/prim.i.backup
ifeq ($(save-dir),frog)
	install -d debian/kernl-save
	cp kernl*.fi debian/kernl-save
endif
	no_dynamic_default=1 dh_auto_configure -- $(configure_options)

override_dh_auto_clean:
	dh_auto_clean
ifneq ($(save-dir),frog)
	cp debian/kernl-save/* .
	rm -r debian/kernl-save
endif
	[ ! -f prim.b.backup ] || mv prim.b.backup prim.b
	[ ! -f engine/prim.i.backup ] || mv engine/prim.i.backup engine/prim.i

override_dh_auto_install:
	touch $D/usr/lib/gforth/site-forth/site-init.fs
	dh_auto_install -- DESTDIR=$D
	chmod 755 $(USHARE)/filedump.fs $(USHARE)/httpd.fs $(USHARE)/sieve.fs \
		$(USHARE)/kernl*.fi $(ULIB)/gforth.fi
	mkdir -p $(DC)/usr/share
	mv $D/usr/share/gforth $(DC)/usr/share/gforth
	mkdir -p $(DL)/usr/lib
	mv $D/usr/lib/$(DEB_HOST_MULTIARCH) $(DL)/usr/lib/$(DEB_HOST_MULTIARCH)
	find $D $(DC) $(DL) -type d -empty -print | xargs rmdir
	find $D $(DC) $(DL) -name '*.la' -print | xargs rm

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_makeshlibs:
	# This is somewhat ugly - we only need the misc:Pre-Depends part of
	# dh_makeshlibs, but we have to put up with invoking it anyway :)
	dh_makeshlibs -pgforth-lib -n
	rm -f $(CURDIR)/debian/gforth-lib/DEBIAN/shlibs

%:
	dh $@ --with autotools_dev