Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / debian / rules
bloba1da33ba2c31a008f6a1b0fb30835cd2e31a08cb
1 #!/usr/bin/make -f
3 # debian/rules file for ACE+TAO Debian GNU/Linux packages
4 # written February 2002 by Ossama Othman <ossama@debian.org>
5 # Modified August 2003 by Brian Nelson <pyro@debian.org>
6 # Copyright (C) 2004 Raphael Bossek <bossekr@debian.org>
7 # Copyright © 2005-2012 Thomas Girard <thomas.g.girard@free.fr>
8 # Copyright © 2009-2014 Pau Garcia i Quiles <pgquiles@elpauer.org>
9 # Copyright © 2010-2014 Johnny Willemsen <jwillemsen@remedy.nl>
11 #export DEB_BUILD_MAINT_OPTIONS = hardening=+all
12 export DEB_BUILD_MAINT_OPTIONS = hardening=+format,+fortify,+stackprotector,+relro,+bindnow
13 DPKG_EXPORT_BUILDFLAGS = 1
14 include /usr/share/dpkg/buildflags.mk
15 export DEB_CFLAGS_MAINT_APPEND = $(CPPFLAGS)
16 export DEB_CXXFLAGS_MAINT_APPEND = $(CPPFLAGS)
17 export DEB_CPPFLAGS_MAINT_APPEND = -g
19 MWCFLAGS := -type gnuace -noreldefs
20 DSO_MAKE_FLAG := versioned_so=2
21 INSTALL_FLAGS := DESTDIR=$(CURDIR)/debian/tmp INSTALL_PREFIX=/usr install_rpath=0 $(DSO_MAKE_FLAG)
23 MAN1 := debian/ace_netsvcs.1 \
24 debian/mpc-ace.1
25 # Where we install every file before calling dh_install
26 DT := debian/tmp
28 DOXYGEN_FILES_TO_REMOVE := -name '*.md5' -o \
29 -name '*.map' -o \
30 -name '*.tag'
32 # Package names, used when overriding dh_installchangelogs
33 ALL_PACKAGES := $(shell dh_listpackages)
34 ALL_ACEXML := $(filter libacexml%,$(ALL_PACKAGES))
36 export ACE_ROOT := $(shell pwd)
37 export MPC_ROOT := $(ACE_ROOT)/MPC
39 ACE_MAJOR_VERSION := $(shell awk '/ACE_MAJOR_VERSION/ { print $$3 }' ${ACE_ROOT}/ace/Version.h)
40 ACE_MINOR_VERSION := $(shell awk '/ACE_MINOR_VERSION/ { print $$3 }' ${ACE_ROOT}/ace/Version.h)
41 ACE_MICRO_VERSION := $(shell awk '/ACE_MICRO_VERSION/ { print $$3 }' ${ACE_ROOT}/ace/Version.h)
42 ACE_VERSION = ${ACE_MAJOR_VERSION}.${ACE_MINOR_VERSION}.${ACE_MICRO_VERSION}
45 dh $@
47 # Implement our own configure machinery; it will copy Debian specific
48 # configuration before launching MPC to generate ACE+TAO GNUmakefile
49 .PHONY: configure
50 configure: configure-stamp
51 configure-stamp:
52 for fname in debian/*VERSION*; do \
53 cp $$fname $$(echo $$fname | \
54 sed -e 's/VERSION/${ACE_VERSION}/'); done
55 for flname in debian/*.install.in; do \
56 sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' \
57 $$flname > $${flname%.in}; done
58 for flname in debian/*.lintian-overrides.in; do \
59 sed 's/@ACE_VERSION@/${ACE_VERSION}/g' \
60 $$flname > $${flname%.in}; done
61 cp debian/platform_macros.GNU $(ACE_ROOT)/include/makeinclude
62 cp debian/config.h $(ACE_ROOT)/ace/
63 cp debian/default.features $(ACE_ROOT)/bin/MakeProjectCreator/config
64 cp debian/ACE-DPKG.mwc $(ACE_ROOT)
65 cd $(ACE_ROOT) && $(ACE_ROOT)/bin/mwc.pl $(MWCFLAGS) ACE-DPKG.mwc
66 touch $@
68 override_dh_auto_build-arch: configure-stamp
69 $(MAKE) -C $(ACE_ROOT) $(DSO_MAKE_FLAG)
71 override_dh_auto_build-indep: configure-stamp
72 $(MAKE) -C $(ACE_ROOT) $(DSO_MAKE_FLAG)
73 cd $(ACE_ROOT) && bin/generate_doxygen.pl -is_release -exclude_tao
74 find $(ACE_ROOT)/html $(DOXYGEN_FILES_TO_REMOVE) | xargs -r rm -f
76 override_dh_auto_install: manpages-stamp
77 $(MAKE) -C $(ACE_ROOT) install $(INSTALL_FLAGS)
78 mkdir -p $(DT)/usr/share/man/man1
79 cp $(ACE_ROOT)/apps/gperf/ace_gperf.1 $(DT)/usr/share/man/man1
80 # Relocate .idl and .pidl files
81 cd $(DT) && for f in $$(find usr/include -name '*.idl' -o -name '*.pidl') ; do \
82 g=$$(echo $${f%%include*}share/idl/$${f##*usr/include/}) ; \
83 mkdir -p $$(dirname $$g) ; \
84 mv $$f $$g ; \
85 done
87 override_dh_auto_clean:
88 [ -f $(ACE_ROOT)/GNUmakefile ] && $(MAKE) -C $(ACE_ROOT) realclean $(DSO_MAKE_FLAG) || true
89 find $(ACE_ROOT) -name 'GNUmakefile*' -o -name '.depend.*' | xargs -r rm
90 rm -f $(ACE_ROOT)/include/makeinclude/platform_macros.GNU
91 rm -f $(ACE_ROOT)/bin/MakeProjectCreator/config/default.features
92 rm -f $(ACE_ROOT)/ace/config.h
93 rm -f $(ACE_ROOT)/ACE-DPKG.mwc
94 rm -f debian/*.1 debian/mpc-ace.sgml
95 rm -f *-stamp
96 rm -Rf $(ACE_ROOT)/html/libace-doc \
97 $(ACE_ROOT)/html/libacexml-doc \
98 $(ACE_ROOT)/doxygen_sqlite3.db
100 override_dh_compress:
101 dh_compress -Xexamples
103 override_dh_fixperms:
104 ifneq (,$(filter libace-doc, $(shell dh_listpackages)))
105 find debian -name '*.pl' | xargs -r sed -i -e '1i#!/usr/bin/perl'
106 endif
107 dh_fixperms
109 debian/mpc-ace.sgml: MPC/docs/MPC.sgml
110 sed -e 's/mpc\.pl/mpc-ace/g' -e 's/mwc\.pl/mwc-ace/g' $< > $@
112 debian/%.1: debian/%.sgml
113 docbook-to-man $< > $@
115 .PHONY: manpages
116 manpages: manpages-stamp
117 manpages-stamp: $(MAN1)
118 touch $@