File: rules

package info (click to toggle)
libxmlada1 1.0-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,704 kB
  • ctags: 94
  • sloc: ada: 22,582; sh: 1,804; makefile: 142; xml: 140; perl: 128
file content (98 lines) | stat: -rwxr-xr-x 3,131 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
#!/usr/bin/make -f

export DH_COMPAT=4
export SHELL=/bin/bash

MAJOR := $(shell dpkg-parsechangelog | grep "^Version: " | sed 's/^Version: \(.*\)\.\(.*\)-\(.*\)/\1/')
MINOR := $(shell dpkg-parsechangelog | grep "^Version: " | sed 's/^Version: \(.*\)\.\(.*\)-\(.*\)/\2/')
REVISION := $(shell dpkg-parsechangelog | grep "^Version: " | sed 's/^Version: \(.*\)\.\(.*\)-\(.*\)/\3/')

MODULES = unicode input_sources sax dom

build: checks build-stamp
build-stamp:
# Build the static library
	for i in $(MODULES) ; do \
		gnatmake -c -j2 -g -gnato -P$$i/$$i.gpr -XMODE=distrib; \
		rm $$i/obj/test*; \
		ar rc libxmlada.a $$i/obj/*.o; \
	done
	ranlib libxmlada.a
# Delete the object files
	for i in $(MODULES); do rm -f $$i/obj/*.{ali,o}; done
# Build the shared library
	for i in $(MODULES) ; do \
		gnatmake -c -j2 -fPIC -gnato -P$$i/$$i.gpr -XMODE=distrib; \
		rm -f $$i/obj/test*; \
	done
	gnatgcc -shared -o libxmlada.so.$(MAJOR).$(MINOR) \
		$(foreach module,$(MODULES),$(module)/obj/*.o) \
		-L/usr/lib/gcc-lib/`gnatgcc -dumpmachine`/`gnatgcc -dumpversion`/adalib \
		-lgnat \
		-Wl,--soname,libxmlada.so.$(MAJOR) \
		-Wl,--export-dynamic
	cd docs && makeinfo --no-split xml.texi -o xmlada.info
	touch build-stamp

checks:
	dh_testdir

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp libxmlada* docs/xmlada.info
	rm -f $(foreach module,$(MODULES),$(module)/obj/*)
	dh_clean -k

# Build architecture-independent files here.
binary-indep: build
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir
	dh_testroot
	dh_installchangelogs -a
	dh_installdocs -a
# The library package
	dh_installdirs -plibxmlada$(MAJOR) usr/lib
	dh_install -plibxmlada$(MAJOR) libxmlada.so.$(MAJOR).$(MINOR) usr/lib
	dh_strip -plibxmlada$(MAJOR)
	dh_link -plibxmlada$(MAJOR) \
		usr/lib/libxmlada.so.$(MAJOR).$(MINOR) \
		usr/lib/libxmlada.so.$(MAJOR)
	dh_makeshlibs -plibxmlada$(MAJOR)
# The -dev package
	dh_installdirs -plibxmlada$(MAJOR)-dev \
		usr/lib \
		usr/share/ada/adainclude/xmlada \
		usr/lib/ada/adalib/xmlada \
		usr/share/doc/libxmlada$(MAJOR)-dev
	dh_install -plibxmlada$(MAJOR)-dev libxmlada.a usr/lib
	dh_link -plibxmlada$(MAJOR)-dev \
		usr/lib/libxmlada.so.$(MAJOR).$(MINOR) usr/lib/libxmlada.so
	dh_install -plibxmlada$(MAJOR)-dev \
		$(foreach module,$(MODULES),$(module)/obj/*.ali) \
		usr/lib/ada/adalib/xmlada
	chmod a=r \
		debian/libxmlada$(MAJOR)-dev/usr/lib/ada/adalib/xmlada/*.ali
	dh_install -plibxmlada$(MAJOR)-dev \
		$(foreach module,$(MODULES),$(module)/*.ad[bs]) \
		usr/share/ada/adainclude/xmlada
	dh_install -plibxmlada$(MAJOR)-dev \
		debian/xmlada.gpr usr/share/ada/adainclude
	dh_installinfo -plibxmlada$(MAJOR)-dev docs/xmlada.info
	dh_installdocs -plibxmlada$(MAJOR)-dev \
		docs/*.{html,ps,txt} known-problems README features
	dh_install -plibxmlada$(MAJOR)-dev xmlada-config /usr/bin
	dh_installman -plibxmlada$(MAJOR)-dev debian/xmlada-config.1
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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