#!/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-18 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 cp -v AspectC++/config/clang-18.1.3.mk AspectC++/config/clang-$(shell llvm-config-18 --version).mk $(MAKE) -C Puma/ MINI=1 -j$(NUMJOBS) all $(MAKE) -C AspectC++/ SHARED=1 -j$(NUMJOBS) all FRONTEND=Clang LLVMCONF=/usr/bin/llvm-config-18 $(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 # allow weaving Puma to fail, cf. #1070443 -$(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 cp -v AspectC++/config/clang-18.1.3.mk AspectC++/config/clang-$(shell llvm-config-18 --version).mk # 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-18 $(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 rm -fv AspectC++/config/clang-$(shell llvm-config-18 --version).mk # 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