File: rules

package info (click to toggle)
polyorb 2.6.0~20090423-10
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 25,004 kB
  • ctags: 240
  • sloc: ada: 236,464; makefile: 2,281; sh: 1,373; cpp: 957; java: 500; ansic: 198; python: 191; perl: 23; exp: 6
file content (168 lines) | stat: -rwxr-xr-x 4,406 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
#!/usr/bin/make -f

#                         2 .   6    .  0    ~20090423-1
regexp := ^Version: ([^.]+)\.([^.]+)\.([^~]+)~([^-]*)-(.*)
major  := $(shell dpkg-parsechangelog | grep "^Version: " | sed -r 's/$(regexp)/\1/')
minor  := $(shell dpkg-parsechangelog | grep "^Version: " | sed -r 's/$(regexp)/\2/')
micro  := $(shell dpkg-parsechangelog | grep "^Version: " | sed -r 's/$(regexp)/\3/')
date   := $(shell dpkg-parsechangelog | grep "^Version: " | sed -r 's/$(regexp)/\4/')
upload := $(shell dpkg-parsechangelog | grep "^Version: " | sed -r 's/$(regexp)/\5/')

debian_libdir = debian/tmp/usr/lib

revision = t:polyorb-$(major).$(minor).$(micro)~$(date)-1
orig_dir = polyorb-$(major).$(minor).$(micro)~$(date).orig
orig_tgz = polyorb_$(major).$(minor).$(micro)~$(date).orig.tar.gz
branch   = com.adacore.polyorb.debian
mtndb    = polyorb.mtn

# number of parallel build processes to use (default: #cpus),
# override by specifying DEB_BUILD_OPTIONS="parallel=n".
cpus := $(shell getconf _NPROCESSORS_ONLN)
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	cpus = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

gen-orig-source:
	if [ ! -e ../$(mtndb) ]; then \
		mtn -d../$(mtndb) db init; \
	fi; \
	mtn -d../$(mtndb) pull www.ada-france.org '$(branch)'; \
	cd .. && \
	mtn -d$(mtndb) co -r$(revision) -b$(branch) $(orig_dir) && \
	rm -r $(orig_dir)/_MTN && \
	tar czf $(orig_tgz) $(orig_dir) && \
	rm -r $(orig_dir)

configure-stamp: configure
	dh_testdir

	ADA=gcc-4.4 ./configure --prefix=`pwd`/debian/tmp \
		--enable-debug \
		--with-appli-perso="corba moma dsa" \
		--with-corba-services="event ir naming notification time"

	touch $@

configure: configure.ac
	support/reconfig

dirs:
	mkdir -p STATIC/src
	mkdir -p DYNAMIC/src
	touch $@

build-arch: build-stamp
build-stamp: configure-stamp dirs
	dh_testdir

	gcc -c -o STATIC/src/csupport.o -Isrc -g -O2 src/csupport.c
	gcc -c -o DYNAMIC/src/csupport.o -Isrc -g -O2 -fPIC src/csupport.c
	$(MAKE) \
		ADAFLAGS="-XLibversion=$(major) -XLibtype=STATIC" \
		PARALLEL_GNATMAKE_FLAGS="-j$(cpus)"
	$(MAKE) \
		ADAFLAGS="-XLibversion=$(major) -XLibtype=DYNAMIC" \
		PARALLEL_GNATMAKE_FLAGS="-j$(cpus)"

	$(MAKE) examples
	$(MAKE) testsuite
	$(MAKE) run_tests
	touch $@

build-doc: build-doc-stamp
build-doc-stamp: configure-stamp dirs
	dh_testdir
	$(MAKE) -C docs
	$(MAKE) -C docs prefix=$(CURDIR)/debian/tmp/usr install-data-local
	touch $@

clean:
	dh_testdir
	dh_testroot
	dh_clean build-stamp
	dh_clean configure-stamp config.log

	[ ! -f docs/Makefile ] || $(MAKE) -C docs clean
	[ ! -f Makefile ] || $(MAKE) distclean

	rm -rf STATIC DYNAMIC dirs
	rm -f `find . -name mkdir.flag`
	rm -f `find . -name "b~*.ad[sb]"`
	rm -f compilers/iac/mknodes
	rm -f compilers/idlac/idl_fe-tree.ad*
	rm -f support/native-linker
	rm -f support/native-adacompiler
	rm -f support/texinfo.tex
	rm -f support/ltmain.sh
	rm -f support/config.guess
	rm -f support/config.sub
	rm -f support/libtool.m4
	rm -f docs/Makefile.in
	rm -f docs/MANIFEST
	rm -f src/config.h*
	rm -f src/stamp-h1
	rm -f aclocal.m4
	rm -f configure
	rm -f libtool
	for i in `cat debian/files_to_clean`; do rm -f $$i; done

	dh_clean

install: build-arch
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) prefix=$(CURDIR)/debian/tmp/usr install

	cp debian/addon/polyorb.gpr debian/tmp/usr/share/ada/adainclude

	for lib in `ls $(debian_libdir)/lib*.so.$(major)`; do \
		ln -sf `basename $$lib` \
			$(debian_libdir)/`basename $$lib | cut -d. -f1`.so; \
	done;

	rm debian/tmp/usr/share/ada/adainclude/polyorb/*soap*.ad[sb]
	rm debian/tmp/usr/share/ada/adainclude/polyorb/*aws*.ad[sb]

binary-indep: build-doc
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i
	dh_installdocs -i
	dh_installexamples -i
	dh_installman -i
	dh_install -i
	dh_lintian -i
	dh_compress -i
	dh_fixperms -i
	dh_makeshlibs -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a
	dh_installdocs -a
	dh_installexamples -a
	dh_installman -a
	dh_install -a
	dh_lintian -a
	dh_strip --dbg-package=libpolyorb-dbg -a
	dh_compress -X.ads -X.adb -XMakefile -a
	dh_fixperms -a
	dh_makeshlibs -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