0 | 0 |
#!/usr/bin/make -f
|
1 | 1 |
# -*- makefile -*-
|
2 | |
# Sample debian/rules that uses debhelper.
|
3 | |
# This file was originally written by Joey Hess and Craig Small.
|
4 | |
# As a special exception, when this file is copied by dh-make into a
|
5 | |
# dh-make output file, you may use that output file without restriction.
|
6 | |
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
7 | 2 |
|
8 | 3 |
# Uncomment this to turn on verbose mode.
|
9 | 4 |
#export DH_VERBOSE=1
|
10 | 5 |
|
|
6 |
# Build cache (for accelerating Debian debugging)
|
|
7 |
BUILDCACHE := $(wildcard ../coq-float.cache)
|
|
8 |
|
11 | 9 |
include /usr/share/coq/coqvars.mk
|
12 | 10 |
|
13 | |
DESTDIR := debian/libfloat-coq/$(shell coqc -where)/user-contrib
|
|
11 |
INCDIRS := $(shell find . -name .git -prune -or -type d -print)
|
|
12 |
INCDIRS := $(INCDIRS:%=-I %)
|
14 | 13 |
|
15 | |
INCDIRS := $(shell find . -type d)
|
16 | |
INCDIRS := $(INCDIRS:%=-I %)
|
|
14 |
FILES_TO_BACKUP := Makefile
|
17 | 15 |
|
18 | 16 |
configure: configure-stamp
|
19 | 17 |
configure-stamp:
|
20 | |
dh_testdir
|
21 | |
touch configure-stamp
|
22 | |
|
|
18 |
dh build --before dh_auto_configure
|
|
19 |
for u in $(FILES_TO_BACKUP); do \
|
|
20 |
if [ ! -f "$$u.backup" ]; then cp "$$u" "$$u.backup"; fi \
|
|
21 |
done
|
|
22 |
coq_makefile $(INCDIRS) $(shell find . -name \*.v) > Makefile
|
|
23 |
touch $@
|
23 | 24 |
|
24 | 25 |
build: build-stamp
|
25 | 26 |
build-stamp: configure-stamp
|
26 | |
dh_testdir
|
27 | |
|
28 | |
coq_makefile $(INCDIRS) $(shell find . -name \*.v) > Makefile
|
|
27 |
ifeq ($(BUILDCACHE),)
|
29 | 28 |
$(MAKE) depend
|
30 | 29 |
$(MAKE) all
|
31 | 30 |
$(MAKE) html
|
32 | |
|
|
31 |
else
|
|
32 |
@echo "===> Build cache detected, skipping compilation <==="
|
|
33 |
rsync -a --exclude=debian --exclude=.git $(BUILDCACHE)/ .
|
|
34 |
endif
|
|
35 |
dh build --after dh_auto_test
|
33 | 36 |
touch $@
|
34 | 37 |
|
35 | 38 |
clean:
|
36 | |
dh_testdir
|
37 | |
dh_testroot
|
38 | |
rm -f build-stamp configure-stamp
|
39 | |
|
40 | |
[ ! -f Makefile ] || $(MAKE) clean
|
41 | |
|
42 | |
dh_clean
|
|
39 |
dh $@
|
|
40 |
for u in $(FILES_TO_BACKUP); do \
|
|
41 |
if [ -f "$$u.backup" ]; then mv "$$u.backup" "$$u"; fi \
|
|
42 |
done
|
43 | 43 |
|
44 | 44 |
install: build
|
45 | |
dh_testdir
|
46 | |
dh_testroot
|
47 | |
dh_prep
|
48 | |
dh_installdirs
|
|
45 |
dh $@ --before dh_auto_install
|
|
46 |
dh $@ --after dh_auto_install
|
49 | 47 |
|
50 | |
cp $(shell find . -name \*.vo) $(DESTDIR)
|
51 | |
cp $(wildcard *.html) debian/libfloat-coq/usr/share/doc/libfloat-coq/html
|
|
48 |
binary-indep: install
|
|
49 |
echo 'F:CoqABI=$(COQ_ABI)' >> debian/libfloat-coq.substvars
|
|
50 |
dh $@
|
52 | 51 |
|
53 | |
binary-indep: build install
|
|
52 |
binary-arch:
|
|
53 |
# No binary-arch packages
|
54 | 54 |
|
55 | |
binary-arch: build install
|
56 | |
dh_testdir
|
57 | |
dh_testroot
|
58 | |
dh_installchangelogs
|
59 | |
dh_installdocs
|
60 | |
dh_installexamples
|
61 | |
dh_installman
|
62 | |
dh_link
|
63 | |
dh_strip
|
64 | |
dh_compress
|
65 | |
dh_fixperms
|
66 | |
dh_installdeb
|
67 | |
dh_shlibdeps
|
68 | |
dh_gencontrol -- -VF:CoqABI="$(COQ_ABI)"
|
69 | |
dh_md5sums
|
70 | |
dh_builddeb
|
71 | |
|
72 | |
binary: binary-indep binary-arch
|
|
55 |
binary: binary-indep
|
73 | 56 |
.PHONY: build clean binary-indep binary-arch binary install configure
|