File: rules

package info (click to toggle)
polygen 1.0.6.ds2-15
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,884 kB
  • ctags: 352
  • sloc: ml: 1,496; perl: 179; makefile: 79; sh: 22
file content (66 lines) | stat: -rwxr-xr-x 3,010 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/make -f
include /usr/share/cdbs/1/class/makefile.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/rules/ocaml.mk

POLYGEN_BASE=.
DEB_BUILDDIR=$(POLYGEN_BASE)/src
POLYGEN_BIN=$(DEB_BUILDDIR)/polygen
POLYGEN_SEED = $(shell date --date="$(shell dpkg-parsechangelog --show-field Date)" +%s)
POLYGEN=$(POLYGEN_BIN) -seed $(POLYGEN_SEED)
export POLYGEN

# set $(NATIVE) to true if this arch has an optimising compiler
#NATIVE := $(shell test -x /usr/bin/ocamlopt.opt && echo true || echo false)
# Forcing native to false to have a Architecture: all package, since polygen
# doesn't have special optimization requirements
NATIVE := false

# No toplevel makefile: we'll add a -C to the make invocation
#DEB_MAKE_BUILD_TARGET+="-Csrc"

# If we have the optimising compiler, build natively with debugging because
# we can strip it later. if we don't, disable debugging because stripping
# the non-native binaries removes the bytecode and leaves you with the
# interpreter, and a somewhat useless binary... =)

DEB_MAKE_BUILD_TARGET+="NATIVE=$(NATIVE)"
DEB_STRIP_EXCLUDE+=polygen

#ifeq ($(NATIVE), true)
#DEB_MAKE_BUILD_TARGET+="MLC=ocamlopt"
#else
#DEB_MAKE_BUILD_TARGET+="MLC=ocamlc"
#DEB_MAKE_BUILD_TARGET+="MLCOPTS=-unsafe"
#DEB_MAKE_BUILD_TARGET+="MLLDOPTS=unix.cma"
#DEB_STRIP_EXCLUDE+=polygen
#endif

# Hook in the build system the creation of the manpage
# Invoking polygen to extract the metadata from the grammars will also generate
# the .grm.o files, that we can later install.
build/polygen::
	$(POLYGEN) debian/man.grm > polygen.1
	chmod 0755 debian/make_polygen-data_manpage
	find $(POLYGEN_BASE)/grm/ -name \*.grm | debian/make_polygen-data_manpage > polygen-data.6

install/polygen::
	install -o root -g root -m 755 $(POLYGEN_BIN) debian/$(cdbs_curpkg)/usr/games/
	install -o root -g root -m 755 -d debian/$(cdbs_curpkg)/usr/share/doc/polygen
	install -o root -g root -m 644 $(POLYGEN_BASE)/eng/HOWTO-Refman.html debian/$(cdbs_curpkg)/usr/share/doc/polygen/HOWTO-Refman.en.html
	install -o root -g root -m 644 $(POLYGEN_BASE)/ita/HOWTO-Refman.html debian/$(cdbs_curpkg)/usr/share/doc/polygen/HOWTO-Refman.it.html
	install -o root -g root -m 644 $(POLYGEN_BASE)/README debian/$(cdbs_curpkg)/usr/share/doc/polygen/README
	install -o root -g root -m 644 $(POLYGEN_BASE)/Credits debian/$(cdbs_curpkg)/usr/share/doc/polygen/Credits

install/polygen-data::
	# grammar data files
	install -o root -g root -m 755 debian/polyrun debian/$(cdbs_curpkg)/usr/games/
	chmod 0755 debian/install-grammars
	debian/install-grammars $(POLYGEN_BASE)/grm/ita debian/$(cdbs_curpkg)/usr/share/polygen/ita
	debian/install-grammars $(POLYGEN_BASE)/grm/eng debian/$(cdbs_curpkg)/usr/share/polygen/eng
	debian/install-grammars $(POLYGEN_BASE)/grm/fra debian/$(cdbs_curpkg)/usr/share/polygen/fra

clean::
	rm -f debian/man.grm.o polygen.1 polygen-data.6 debian/polyfind.1 src/polygen
	find $(POLYGEN_BASE)/grm/ -name \*.grm.o -exec rm "{}" ";"