Code

patches: Added missing-includes.dpatch to add missing include files.
[pkg-pfstmo.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for pfstmo
3 #
4 # Written by Sebastian Harl <tokkee@debian.org>
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
9 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14 CFLAGS = -Wall -g
15 CXXFLAGS = -Wall -g
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19         CXXFLAGS += -O0
20 else
21         CFLAGS += -O2
22         CXXFLAGS += -O2
23 endif
25 include /usr/share/dpatch/dpatch.make
27 config.status: configure $(DPATCH_STAMPFN)
28         dh_testdir
29         
30         # do not rebuild the build system
31         touch aclocal.m4 acinclude.m4 configure.ac configure config.h.in \
32                 config.status Makefile.am Makefile.in Makefile
33         
34         for file in config.guess config.sub; do \
35                 if [ ! -e $$file.upstream ]; then \
36                         mv $$file $$file.upstream; \
37                         ln -s /usr/share/misc/$$file .; \
38                 fi \
39         done
40         
41         ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
42                 --prefix=/usr --mandir=\$${prefix}/share/man \
43                 --infodir=\$${prefix}/share/info \
44                 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
46 build: build-stamp
48 build-stamp:  config.status
49         dh_testdir
50         
51         $(MAKE)
52         
53         touch build-stamp
55 clean:
56         dh_testdir
57         dh_testroot
58         rm -f build-stamp
59         
60         [ ! -f Makefile ] || $(MAKE) distclean
61         for file in config.guess config.sub; do \
62                 if [ -e $$file.upstream ]; then \
63                         rm -f $$file; \
64                         mv $$file.upstream $$file; \
65                 fi \
66         done
67         
68         $(MAKE) -f debian/rules unpatch
69         
70         dh_clean
72 install: build
73         dh_testdir
74         dh_testroot
75         dh_clean -k
76         dh_installdirs
77         
78         $(MAKE) DESTDIR=$(CURDIR)/debian/pfstmo install
80 binary-indep: build install
81         # nothing to do here
83 binary-arch: build install
84         dh_testdir
85         dh_testroot
86         dh_installchangelogs ChangeLog
87         dh_installdocs AUTHORS README TODO
88         dh_installexamples
89         dh_installman
90         dh_link
91         dh_strip
92         dh_compress
93         dh_fixperms
94         dh_installdeb
95         dh_shlibdeps
96         dh_gencontrol
97         dh_md5sums
98         dh_builddeb
100 binary: binary-indep binary-arch
101 .PHONY: build clean binary-indep binary-arch binary install