File: rules

package info (click to toggle)
xmlm 1.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 240 kB
  • sloc: ml: 1,843; makefile: 36
file content (46 lines) | stat: -rwxr-xr-x 1,222 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- makefile -*-

DESTDIR=$(CURDIR)/debian/tmp
include /usr/share/ocaml/ocamlvars.mk
OCAMLFIND_DESTDIR=$(DESTDIR)/$(OCAML_STDLIB_DIR)

libtarget = xmlm.cma xmlm.cmi
ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
	xmltrip = ./xmltrip.native
	libtarget += xmlm.a xmlm.cmxa xmlm.cmx xmlm.cmxs
else
	xmltrip = ./xmltrip.byte
endif
libloc = $(addprefix ./_build/src/,$(libtarget))

%:
	dh $@ --with ocaml

.PHONY: override_dh_auto_build
override_dh_auto_build:
	ocamlbuild -classic-display $(libtarget) $(xmltrip)
	help2man --no-info --version-string=1.2.0 \
		--name "XML round trip: parses XML files and prints them" \
		$(xmltrip) > xmltrip.1

.PHONY: override_dh_auto_clean
override_dh_auto_clean:
	ocamlbuild -classic-display -clean

.PHONY: override_dh_auto_install
override_dh_auto_install:
	mkdir -p '$(OCAMLFIND_DESTDIR)/xmlm'
	cp $(libloc) '$(OCAMLFIND_DESTDIR)/xmlm'
	cp src/xmlm.mli '$(OCAMLFIND_DESTDIR)/xmlm'
	cp pkg/META '$(OCAMLFIND_DESTDIR)/xmlm'
	mkdir -p '$(DESTDIR)/usr/bin'
	cp $(xmltrip) '$(DESTDIR)/usr/bin/xmltrip'

.PHONY: override_dh_installchangelogs
override_dh_installchangelogs:
	dh_installchangelogs CHANGES.md

.PHONY: override_dh_install
override_dh_install:
	dh_install --fail-missing