2 # $Id: rules,v 1.3 2018/05/25 20:03:37 tom Exp $
4 # Uncomment this to turn on verbose mode.
7 # These are used for cross-compiling and for saving the configure script
8 # from having to guess our platform (since we know it already)
9 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12 PACKAGES.arch = byacc btyacc
14 CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
15 CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
16 LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
18 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
23 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
27 BYACC_DIR = $(CURDIR)/debian/byacc
28 BTYACC_DIR = $(CURDIR)/debian/btyacc
36 CPPFLAGS="$(CPPFLAGS)" \
38 LDFLAGS="$(LDFLAGS)" \
40 --host=$(DEB_HOST_GNU_TYPE) \
41 --build=$(DEB_BUILD_GNU_TYPE) \
43 --mandir=\$${prefix}/share/man \
45 --program-transform-name='s,^,b,'
54 config-arch: $(PACKAGES.arch:%=config-%-stamp)
55 build-arch: $(PACKAGES.arch:%=build-%-stamp)
56 install-arch: $(PACKAGES.arch:%=install-%-stamp)
63 cd $(BYACC_TMP); $(configure)
71 mkdir -p $(BTYACC_TMP)
72 cd $(BTYACC_TMP); $(configure) \
74 --with-max-table-size=18000 \
75 --program-transform-name='s,^,bt,'
79 build-byacc-stamp: config-byacc-stamp
82 cd $(BYACC_TMP); $(MAKE)
86 build-btyacc-stamp: config-btyacc-stamp
89 cd $(BTYACC_TMP); $(MAKE)
93 install-byacc-stamp: build-byacc-stamp
98 cd $(BYACC_TMP); $(MAKE) install DESTDIR=$(BYACC_DIR)
102 install-btyacc-stamp: build-btyacc-stamp
107 cd $(BTYACC_TMP); $(MAKE) install DESTDIR=$(BTYACC_DIR)
119 # Build architecture-dependent files here.
120 binary-arch: build install
121 ifneq ($(PACKAGES.arch),)
122 rm -f $(PACKAGES.arch:%=install-%-stamp)
125 dh_lintian $(verbose) $(PACKAGES.arch:%=-p%)
126 dh_installdocs $(verbose) $(PACKAGES.arch:%=-p%)
127 dh_installexamples $(verbose) $(PACKAGES.arch:%=-p%)
128 dh_installchangelogs $(verbose) $(PACKAGES.arch:%=-p%) CHANGES
129 dh_strip $(verbose) $(PACKAGES.arch:%=-p%)
130 dh_compress $(verbose) $(PACKAGES.arch:%=-p%)
131 dh_fixperms $(verbose) $(PACKAGES.arch:%=-p%)
132 dh_installdeb $(verbose) $(PACKAGES.arch:%=-p%)
133 dh_shlibdeps $(verbose) $(PACKAGES.arch:%=-p%)
134 dh_gencontrol $(verbose) $(PACKAGES.arch:%=-p%)
135 dh_md5sums $(verbose) $(PACKAGES.arch:%=-p%)
136 dh_builddeb $(verbose) $(PACKAGES.arch:%=-p%)
139 .PHONY: build clean config config-arch binary binary-arch install install-arch