File: rules

package info (click to toggle)
libaunit 1.01-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 316 kB
  • ctags: 10
  • sloc: ada: 1,527; makefile: 77; sh: 1
file content (108 lines) | stat: -rwxr-xr-x 3,279 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
#!/usr/bin/make -f

# Debian Makefile for AUnit
# Copyright (c) 2004 Ludovic Brenta <ludovic.brenta@insalien.org>

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

export DH_COMPAT=4

# Parse the version number from the change log:
# major.minor-revision
regexp:=^Version: \([0-9]\+\)\.\([0-9]\+\)-\([0-9]\+\)$$
major:=$(shell dpkg-parsechangelog | grep ^Version: | sed 's/$(regexp)/\1/')
minor:=$(shell dpkg-parsechangelog | grep ^Version: | sed  's/$(regexp)/\2/')
revision:=$(shell dpkg-parsechangelog | grep ^Version: | sed  's/$(regexp)/\3/')

gcc_host:=$(shell gnatgcc -dumpmachine)
gcc_version:=$(shell gnatgcc -dumpversion)

SPECS := $(shell find aunit -name \*.ads)
BODIES := $(shell find aunit -name \*.adb)

build: build-stamp
build-stamp:
	dh_testdir
	$(MAKE) -f debian/rules objects CFLAGS="-g"
	ar rc libaunit.a obj/*.o
	ranlib libaunit.a
	rm -rf obj
	$(MAKE) -f debian/rules objects CFLAGS="-fPIC"
	gnatgcc -shared -o libaunit.so.$(major).$(minor) obj/*.o \
		-L/usr/lib/gcc-lib/$(gcc_host)/$(gcc_version)/adalib \
		-lgnat \
		-Wl,--soname,libaunit.so.$(major)
	-rm build_all.adb
	touch build-stamp

objects: build_all.adb
	-mkdir obj
	gnatmake -c -j2 -Pbuild_all $(CFLAGS)
	-rm obj/build_all.*

build_all.adb: $(SPECS) $(BODIES)
	@for i in $(SPECS); do \
		p=`echo $$i | sed -e "s/\.ads//;s/-/./g;s!.*/!!g"` ; \
		echo "with $$p;" >> $@; \
	done
	@echo "procedure build_all is" >> $@
	@echo "begin" >> $@
	@echo "	 null;" >> $@
	@echo "end build_all;" >> $@

clean:
	dh_testdir
	dh_testroot
	dh_clean -a
	rm -rf build-stamp obj libaunit* build_all.adb

binary-indep:

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -a
	: # The -dev package.
	dh_installdirs usr/share/ada/adainclude/aunit \
		usr/lib/ada/adalib/aunit \
		usr/share/doc/libaunit-dev \
		usr/lib
	dh_install $(SPECS) $(BODIES) usr/share/ada/adainclude/aunit
	dh_install obj/*.ali usr/lib/ada/adalib/aunit
	dh_install debian/aunit.gpr usr/share/ada/adainclude
	dh_install libaunit.a usr/lib
	dh_link usr/lib/libaunit.so.$(major).$(minor) \
		usr/lib/libaunit.so
	dh_installdocs AUnit.html
	dh_installexamples template/*
	dh_installchangelogs -a
	: # The library package.
	dh_install -plibaunit$(major) \
		libaunit.so.$(major).$(minor) usr/lib
	dh_link -plibaunit$(major) \
		usr/lib/libaunit.so.$(major).$(minor) \
		usr/lib/libaunit.so.$(major)
	dh_strip -plibaunit$(major)
	dh_compress -a -X.ads -X.adb
	dh_fixperms -a
	dh_makeshlibs -plibaunit$(major)
	dh_installdeb -a
	dh_shlibdeps -plibaunit$(major)
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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