9d8477bcfd33c4779b1b9874f62612978ae94c8d
[external/ragel.git] / debian / rules
1 #!/usr/bin/make -f
2
3 CFLAGS = -g -Wall
4 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
5         CFLAGS += -O0
6 else
7         CFLAGS += -O2
8 endif
9 export CFLAGS
10
11 # for the m68k hack
12 DEB_BUILD_ARCH?=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
13 export DEB_BUILD_ARCH
14
15 config.status: configure
16         dh_testdir
17         ./configure --prefix=/usr --mandir=\$${prefix}/share/man 
18
19 build: build-stamp
20
21 build-stamp:  config.status
22         dh_testdir
23         $(MAKE) all 
24         $(MAKE) -C doc 
25         touch build-stamp
26
27 clean:
28         dh_testdir
29         dh_testroot
30         rm -f build-stamp 
31         [ ! -f Makefile ] || $(MAKE) distclean
32         [ ! -f test/Makefile ] || $(MAKE) -C test distclean
33         dh_clean
34
35 install: build
36         dh_testdir
37         dh_testroot
38         dh_prep
39         dh_installdirs
40         $(MAKE) install DESTDIR=$(CURDIR)/debian/ragel/ 
41
42 binary-indep: build install
43
44 binary-arch: build install
45         dh_testdir
46         dh_testroot
47         dh_installman 
48         dh_installdocs -n
49         dh_installdocs -n doc/ragel-guide.pdf
50         dh_installexamples
51         dh_installchangelogs ChangeLog
52         dh_compress -Xexamples
53         dh_link
54         dh_strip
55         dh_fixperms
56         dh_installdeb
57         dh_shlibdeps
58         dh_gencontrol
59         dh_md5sums
60         dh_builddeb
61
62 binary: binary-indep binary-arch
63 .PHONY: build clean binary-indep binary-arch binary install