1234949Sbapt#!/usr/bin/make -f
2234949Sbapt# MAde with the aid of dh_make, by Craig Small
3234949Sbapt# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
4234949Sbapt# Some lines taken from debmake, by Cristoph Lameter.
5234949Sbapt
6234949Sbapt# Uncomment this to turn on verbose mode.
7234949Sbapt#export DH_VERBOSE=1
8234949Sbapt
9234949Sbapt# These are used for cross-compiling and for saving the configure script
10234949Sbapt# from having to guess our platform (since we know it already)
11234949SbaptDEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12234949SbaptDEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13234949Sbapt
14234949SbaptCFLAGS =
15234949Sbapt
16234949Sbaptifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17234949Sbapt        CFLAGS += -O0
18234949Sbaptelse
19234949Sbapt        CFLAGS += -O2
20234949Sbaptendif
21234949Sbaptifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
22234949Sbapt        INSTALL_PROGRAM += -s
23234949Sbaptendif
24234949Sbapt
25234949Sbapt
26234949Sbaptconfigure: configure-stamp
27234949Sbaptconfigure-stamp:
28234949Sbapt	dh_testdir
29234949Sbapt
30234949Sbapt	CFLAGS="$(CFLAGS)" ./configure \
31234949Sbapt		--host=$(DEB_HOST_GNU_TYPE) \
32234949Sbapt		--build=$(DEB_BUILD_GNU_TYPE) \
33234949Sbapt		--prefix=/usr \
34234949Sbapt		--mandir=\$${prefix}/share/man \
35234949Sbapt		--sysconfdir=/etc \
36234949Sbapt		--program-transform-name='s,^,b,'
37234949Sbapt
38234949Sbapt	touch configure-stamp
39234949Sbapt
40234949Sbaptbuild: build-stamp
41234949Sbaptbuild-stamp: configure-stamp
42234949Sbapt	dh_testdir
43234949Sbapt
44234949Sbapt	$(MAKE)
45234949Sbapt
46234949Sbapt	touch build-stamp
47234949Sbapt
48234949Sbaptclean:
49234949Sbapt	dh_testdir
50234949Sbapt	dh_testroot
51234949Sbapt
52234949Sbapt	[ ! -f Makefile ] || $(MAKE) clean
53234949Sbapt
54234949Sbapt	rm -f configure-stamp build-stamp install-stamp \
55234949Sbapt		config.cache config.h config.status config.log makefile
56234949Sbapt
57234949Sbapt	rm -f *.o yacc
58234949Sbapt
59234949Sbapt	dh_clean
60234949Sbapt
61234949Sbaptinstall: install-stamp
62234949Sbaptinstall-stamp: build-stamp
63234949Sbapt	dh_testdir
64234949Sbapt	dh_testroot
65234949Sbapt	dh_clean -k
66234949Sbapt	dh_installdirs
67234949Sbapt
68234949Sbapt	$(MAKE) install DESTDIR=$(CURDIR)/debian/byacc
69234949Sbapt
70234949Sbapt	touch install-stamp
71234949Sbapt
72234949Sbapt# Build architecture-independent files here.
73234949Sbaptbinary-indep: build install
74234949Sbapt# No binary-indep target.
75234949Sbapt
76234949Sbapt# Build architecture-dependent files here.
77234949Sbaptbinary-arch: build install
78234949Sbapt	dh_testdir
79234949Sbapt	dh_testroot
80234949Sbapt	dh_installdocs
81234949Sbapt	dh_installexamples
82234949Sbapt	dh_installchangelogs CHANGES
83234949Sbapt	dh_strip
84234949Sbapt	dh_compress
85234949Sbapt	dh_fixperms
86234949Sbapt	dh_installdeb
87234949Sbapt	dh_shlibdeps
88234949Sbapt	dh_gencontrol
89234949Sbapt	dh_md5sums
90234949Sbapt	dh_builddeb
91234949Sbapt
92234949Sbaptbinary: binary-indep binary-arch
93234949Sbapt.PHONY: build clean binary-indep binary-arch binary install install-stamp
94