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
|
#!/usr/bin/make -f
include /usr/share/coq/coqvars.mk
include /usr/share/ocaml/ocamlvars.mk
export COQTOP := $(COQ_STDLIB_DIR)
export COQLIB := $(COQ_STDLIB_DIR)
export COQBIN := /usr/bin/
PACKAGES := $(shell dh_listpackages)
INSTALL_DIR := $(CURDIR)/debian/tmp/usr/lib/coq/user-contrib/Ssreflect
# The following must be kept in sync with d/libssreflect-ocaml*.install.in
PLUGIN_TARGETS := theories/ssreflect.cma
ifeq ($(OCAML_NATDYNLINK),yes)
PLUGIN_TARGETS += theories/ssreflect.cmxs
endif
EXTRA_FILES := src/ssrmatching.cmi src/ssreflect.cmi
%:
+dh $@ --with ocaml
.PHONY: override_dh_auto_build
override_dh_auto_build:
# Building is done here because dh_listpackages is useless in the
# build target. Should be reconsidered when dpkg-buildpackage starts
# calling build-{arch,indep} targets (see #604397)
.PHONY: override_dh_auto_install
override_dh_auto_install:
ifeq ($(findstring libssreflect-coq,$(PACKAGES)),)
# Express build: only plugins
$(MAKE) Makefile.coq
$(MAKE) -f Makefile.coq $(PLUGIN_TARGETS)
install -d $(INSTALL_DIR)
install -m 644 $(PLUGIN_TARGETS) $(EXTRA_FILES) $(INSTALL_DIR)
else
# Full build
$(MAKE)
$(MAKE) install DSTROOT=$(CURDIR)/debian/tmp
$(MAKE) -f Makefile.coq html
endif
.PHONY: override_dh_install
override_dh_install:
dh_install --fail-missing
.PHONY: override_dh_auto_clean
override_dh_auto_clean:
dh_auto_clean
rm -Rf bin
.PHONY: override_dh_clean
override_dh_clean:
dh_clean
rm -Rf html
.PHONY: override_dh_gencontrol
override_dh_gencontrol:
dh_gencontrol -- -VF:CoqABI="$(COQ_ABI)"
|