File: rules

package info (click to toggle)
mtasc 1.14-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 984 kB
  • ctags: 1,927
  • sloc: ml: 10,492; ansic: 129; makefile: 106; sh: 23
file content (83 lines) | stat: -rwxr-xr-x 2,211 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/make -f

#export DH_VERBOSE=1

include /usr/share/quilt/quilt.make

ifeq ($(shell test -x /usr/bin/ocamlopt -o -x /usr/bin/ocamlopt.opt && echo true),true)
  OCAMLC = ocamlopt
  OCAMLOBJECT = cmx
  OCAMLARCHIVE = cmxa
  OCAMLCUSTOM = 
  OCAMLSTRIP =
  OCAMLDEPS = ocaml:Depends=
else
  OCAMLC = ocamlc
  OCAMLOBJECT = cmo
  OCAMLARCHIVE = cma
  OCAMLCUSTOM = -custom
  OCAMLSTRIP = -Xmtasc
  OCAMLDEPS = ocaml:Depends=ocaml-base-nox-$(shell ocamlfind ocamlc -version)
endif

ifeq ($(shell test -x /usr/bin/camlp4o.opt && echo true),true)
  CAMLP4 = camlp4o.opt
else ifeq ($(shell test -x /usr/bin/camlp4o && echo true),true)
  CAMLP4 = camlp4o
endif

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	MAKEFLAGS += -j$(NUMJOBS)
endif

build: build-stamp
build-stamp: $(QUILT_STAMPFN)
	dh_testdir
	$(MAKE) -f ocaml/mtasc/doc/Makefile C=$(OCAMLC) O=$(OCAMLOBJECT) A=$(OCAMLARCHIVE) CU=$(OCAMLCUSTOM) CP=$(CAMLP4)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	./ocaml/mtasc/mtasc -v -swf helloworld.swf -main -header 640:480:20 ocaml/mtasc/doc/HelloWorld.as
	./ocaml/mtasc/mtasc -version 8 -v -swf helloworld.swf -main -header 640:480:20 ocaml/mtasc/doc/HelloWorld.as
endif
	cp ocaml/mtasc/doc/CHANGES.txt NEWS
	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	[ ! -f ocaml/mtasc/doc/Makefile ] || $(MAKE) -f ocaml/mtasc/doc/Makefile clean
	rm -f build-stamp NEWS helloworld.swf
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_prep
	$(MAKE) -f ocaml/mtasc/doc/Makefile install PREFIX=/usr DESTDIR=debian/mtasc

binary-indep: build install
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installexamples
	dh_installman
	dh_installdirs
	dh_usrlocal
	dh_strip $(OCAMLSTRIP)
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol -- -V$(OCAMLDEPS)
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

UPSTREAM_VERSION = $(shell dpkg-parsechangelog | sed -n 's/Version: \(.*\)-[^-]*/\1/p')

get-orig-source:
	sh debian/maketarball --upstream-version $(UPSTREAM_VERSION)