File: rules

package info (click to toggle)
aspectc%2B%2B 1%3A2.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 18,708 kB
  • sloc: cpp: 108,813; ansic: 7,644; sh: 2,262; makefile: 1,303; pascal: 634; python: 402; xml: 349
file content (151 lines) | stat: -rwxr-xr-x 4,469 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
#!/usr/bin/make -f

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

# disable parallelism inside this makefile (but not submakes)
.NOTPARALLEL:

# Support multiple makes at once
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
else
NUMJOBS := 1
# on i386 and amd64, we query the system unless overriden by DEB_BUILD_OPTIONS
ifeq      ($(DEB_HOST_ARCH),i386)
NUMJOBS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
else ifeq ($(DEB_HOST_ARCH),amd64)
NUMJOBS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
endif
endif

# workaround for bug #701244 - aspectc++ supports __int128 by default
# only when woven on 64bits, which the upstream provided sources don't.
AC_OPTFLAGS = --gnu-int128
export AC_OPTFLAGS

# we seem to have locking issues on kFreeBSD. force single threaded
ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
NUMJOBS := 1
endif

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS := -O0 -g
else
	CFLAGS := -O2 -g
endif

DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
ifneq  (,$(filter $(DEB_BUILD_ARCH),armel armhf))
# fatal: Caught standard exception: deque::_M_new_elements_at_back
	CFLAGS := -O1 -g
endif

ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel))
	CFLAGS += -fPIC
endif

export CFLAGS
PUMA_CONFIG=$(CURDIR)/puma.config

test-builds: build-arch-stamp
	Ag++/bin/linux-release/ag++ --gen_config
	echo '-D "__cplusplus=199711L"' >> $(PUMA_CONFIG)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	-$(MAKE) -C AspectC++ PUMA_CONFIG=$(PUMA_CONFIG) FRONTEND=Clang LLVMCONF=/usr/bin/llvm-config-11 SHARED=1 AC="$(CURDIR)/AspectC++/bin/linux-release/ac++" REGRESSIONTEST=1 examples test
	PATH=$(CURDIR)/AspectC++/bin/linux-release:$(PATH) \
	$(MAKE) -C Ag++/ SHARED=1 PUMA_CONFIG=$(PUMA_CONFIG) test

endif

build: build-arch build-indep

build-arch: build-arch-stamp test-builds
build-arch-stamp:
	dh_testdir
	$(MAKE) -C Puma/ MINI=1        -j$(NUMJOBS) all
	$(MAKE) -C AspectC++/ SHARED=1 -j$(NUMJOBS) all FRONTEND=Clang LLVMCONF=/usr/bin/llvm-config-11
	$(MAKE) -C Ag++/      SHARED=1 -j$(NUMJOBS) all
	# ok, now we have both an ac++ binary and ag++ binary now let's
	# weave Puma again in the copy
	$(MAKE) -C Puma clean
	$(MAKE) -C Puma all AC="$(CURDIR)/AspectC++/bin/linux-release/ac++" -j$(NUMJOBS) EXTENSIONS="acppext gnuext winext"
	# build manpages:
	docbook-to-man debian/ac++.1.sgml > ac++.1
	docbook-to-man debian/ag++.1.sgml > ag++.1
	# mark timestamp
	touch $@

build-indep: build-indep-stamp
build-indep-stamp:
	dh_testdir
	$(MAKE) -C Puma doc
	touch $@

clean:
	dh_testdir
	dh_testroot
	dh_clean build-*stamp binary-*stamp puma.config
	# cleaning up source directories:
	$(MAKE) -s -C Puma cleanall
	# The clang frontend adds additional tests that need cleaning
	# so far, no tests are excluded by using the Clang frontend
	$(MAKE) -s -C AspectC++ cleanall FRONTEND=Clang LLVMCONF=/usr/bin/llvm-config-11
	$(MAKE) -s -C Ag++ clean
	# remove leftovers from Upstream Makefiles
	rm -rf Puma/include
	rm -rf AspectC++/tests/RepoVersion/repo.use
	rm -rf Ag++/DepFiles Ag++/ObjFiles Ag++/bin Ag++/tests/test_11.config
	rm -rf AspectC++/DepFiles AspectC++/ObjFiles AspectC++/bin
	rm -rf AspectC++/tests/*/feature.out
	rm -rf AspectC++/tests/RepoVersion/feature.fil
	# remove generated manpages:
	rm -f ac++.1 ag++.1
	rm -rf AspectC++/bin
	rm -rf Puma.copy/
	# remove autopkgtest cruft
	rm -rf Ag++/tests/src/obj
	rm -rf Ag++/tests/src/test
	# standard cleaning:
	dh_clean

# Build architecture-independent files here.
binary-indep: build-indep
	dh_testdir
	dh_testroot
	dh_prep
	dh_installchangelogs
	dh_installdocs -p libpuma-doc Puma/doc/RefMan/html
	dh_installexamples -p libpuma-doc Puma/examples/*
	dh_compress -X.cc -X.map
	dh_fixperms
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build-arch
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	dh_installchangelogs
	dh_installdocs
	dh_install -Xlicence_1_0.txt
	dh_installexamples -p aspectc++ AspectC++/examples/*
	find debian/aspectc++ -name Makefile -exec rm -v {} +
	find debian/libpuma-doc -name Makefile -exec rm -v {} +
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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