File: rules

package info (click to toggle)
cduce 0.6.0-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,216 kB
  • sloc: ml: 21,321; xml: 11,270; sh: 341; makefile: 258; perl: 97
file content (71 lines) | stat: -rwxr-xr-x 1,991 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
#!/usr/bin/make -f
PACKAGE = cduce

include /usr/share/ocaml/ocamlinit.mk
ifeq ($(OCAML_NATDYNLINK),yes)
  MAKE_OPTS := "NATIVE=true"
else
  MAKE_OPTS := "NATIVE=false"
endif

ifeq ($(DEB_BUILD_ARCH), armhf)
  CAMLOPT_P := "ocamlopt -inline 100"
else ifeq ($(DEB_BUILD_ARCH), armel)
  CAMLOPT_P := "ocamlopt -inline 1000"
else ifeq ($(DEB_BUILD_ARCH), powerpc)
  CAMLOPT_P := "ocamlopt -inline 1000"
else
  CAMLOPT_P := "ocamlopt -inline 10000"
endif

LIBDIR=$(CURDIR)/debian/cduce/$(OCAML_STDLIB_DIR)
DOCDIR=$(CURDIR)/debian/cduce/usr/share/doc/cduce/html
BINDIR=$(CURDIR)/debian/cduce/usr/bin
MANDIR=$(CURDIR)/debian/cduce/usr/share/doc/man

CONFIGURE_OPTS := --prefix=/usr \
  --mliface=debian/ocaml-$(OCAML_ABI) \
  --with-curl \
  --without-netclient \
  --with-expat \
  --without-pxp

%:
	dh --with ocaml $@

.PHONY: override_dh_auto_configure
override_dh_auto_configure:
	tar -C debian -xf /usr/src/ocaml-source-$(OCAML_ABI).tar
	tar -C debian -xf debian/ocaml-$(OCAML_ABI)/ocaml_*.orig.tar.*
	./configure  $(CONFIGURE_OPTS)

.PHONY: override_dh_auto_build
override_dh_auto_build:
	$(MAKE) CAMLOPT_P=$(CAMLOPT_P) $(MAKE_OPTS) all doc

.PHONY: override_dh_auto_clean
override_dh_auto_clean:
	touch Makefile.conf
	[ ! -f Makefile ] || $(MAKE) $(MAKE_OPTS) clean
	-$(RM) Makefile.conf
	-$(RM) -rf debian/ocaml-$(OCAML_ABI)/

.PHONY: override_dh_auto_install
override_dh_auto_install:
	$(MAKE) $(MAKE_OPTS) DOCDIR=$(DOCDIR) BINDIR=$(BINDIR) MANDIR=$(MANDIR) OCAMLFIND_DESTDIR=$(LIBDIR) OCAMLFIND_LDCONF=ignore install

	# Remove the wrong RPATH
	chrpath -d $(BINDIR)/cduce

	# CDuce Makefile installs all the documentation in DOCDIR, including
	# README, LICENSE, and so on. We don't want these. Let's hack.
	find $(DOCDIR) -maxdepth 1 -not -name "*.html" -not -name "img" -exec rm {} \;
	-$(RM) -rf $(MANDIR)

.PHONY: override_dh_ocaml
override_dh_ocaml:
	dh_ocaml --runtime-map cduce

# Tests suppose the OCaml library is installed
.PHONY: override_dh_auto_test
override_dh_auto_test: