aboutsummaryrefslogtreecommitdiff
path: root/Makefile.in
blob: 3d3ce473b2bb05bd85530000f3fd8e62c5e330c4 (plain)
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
CONTRIB=$(DESTDIR)/@prefix@/lib/coq/user-contrib
COQC=@COQC@
COQBIN=@COQBIN@

srcs=theories \
	ChangeLog \
	Makefile.in \
	configure.ac \
	configure \
	_CoqProject \
	NEWS \
	AUTHORS \
	INSTALL \
	README.md \
	COPYING

# PACKAGE_NAME / PACKAGE_VERSION from AC_INIT
rel=@PACKAGE_NAME@-@PACKAGE_VERSION@

KNOWNFILES := Makefile _CoqProject configure.ac configure check
.DEFAULT_GOAL := invoke-coqmakefile

configure: configure.ac
	autoconf

CoqMakefile: Makefile _CoqProject
	$(COQBIN)/coq_makefile -f _CoqProject -o CoqMakefile

invoke-coqmakefile: CoqMakefile
	make COQBIN=$(COQBIN) COQLIBINSTALL=$(CONTRIB) \
		-f CoqMakefile \
		$(filter-out $(KNOWNTARGETS), $(MAKECMDGOALS))

check:

AUTOCONF_FILES=aclocal.m4 \
		autom4te.cache \
		config.log \
		config.status \
		configure \
		install-sh \
		missing
AUTOMAKE_FILES=Makefile
BUILD_FILES=$$(find . -name "*.tar.gz") $$(find . -name "*~")
distclean:
	rm -rf $(AUTOCONF_FILES) $(AUTOMAKE_FILES)
clean:
	rm -rf $(BUILD_FILES)
	rm -rf theories/*.vo theories/*.vok theories/*.glob theories/*.vos theories/*.aux
	rm -rf CoqMakefile CoqMakefile.conf
	rm -rf $(rel)

dist: configure
	rm -rf $(rel)
	mkdir -p $(rel)
	rm -rf theories/*.vo theories/*.vok theories/*.glob theories/*.vos theories/.*.aux
	cp -r $(srcs) $(rel)
	tar -czf $(rel).tar.gz $(rel)
	rm -rf $(rel)

distcheck: dist
	tar -xzf $(rel).tar.gz
	cd $(rel); ./configure; make; make check
	rm -rf $(rel)

.PHONY: invoke-coqmakefile $(KNOWNFILES)

%: invoke-coqmakefile
	@true