-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
66 lines (50 loc) · 1.66 KB
/
Makefile
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
FIND_BUG?=
ifneq (,$(strip $(FIND_BUG)))
FULL_FIND_BUG:=$(abspath $(shell which '$(FIND_BUG)'))
else
FULL_FIND_BUG=$(FIND_BUG)
endif
has-all-tests check print-support::
$(MAKE) -C examples $@ FIND_BUG='$(FULL_FIND_BUG)'
.PHONY: has-all-tests check print-support
PYTHON3?=python3
PYTHON?=python
.PHONY: dist
dist:
$(PYTHON) setup.py sdist bdist_wheel
DOCTEST_MODULES := \
import_util \
#
.PHONY: doctests
define add_target
# $(1) main target
# $(2) intermediate target
# $(3) recipe
$(1): $(1)-$(2)
.PHONY: $(1)-$(2)
$(1)-$(2):
$(3)
endef
$(foreach m,$(DOCTEST_MODULES),$(eval $(call add_target,doctests,$(m),$(PYTHON3) -m coq_tools.$(m))))
MAIN_FILES_SH = git grep --name-only 'def main' 'coq_tools/*.py'
MAIN_MODULES = $(sort $(patsubst coq_tools/%.py,%,$(shell $(MAIN_FILES_SH))))
.PHONY: update-__init__
update-__init__:
printf "%s\n" '__all__ = [' > coq_tools/__init__.py
printf " '%s',\n" $(MAIN_MODULES) >> coq_tools/__init__.py
printf "%s\n" " ]" >> coq_tools/__init__.py
PYINSTALLER_ADD_DATA := \
--add-data coq_tools/coqtop-as-coqc.sh:coq_tools/ \
--add-data coq_tools/coqtop.bat:coq_tools/ \
#
.PHONY: standalone-coq-bug-minimizer
standalone-coq-bug-minimizer:
pyinstaller find-bug.py -n coq-bug-minimizer $(PYINSTALLER_ADD_DATA)
.PHONY: standalone-coq-require-minimizer
standalone-coq-require-minimizer:
pyinstaller minimize-requires.py -n coq-require-minimizer $(PYINSTALLER_ADD_DATA)
.PHONY: standalone-coq-import-inliner
standalone-coq-import-inliner:
pyinstaller inline-imports.py -n coq-import-inliner $(PYINSTALLER_ADD_DATA)
.PHONY: standalone
standalone: standalone-coq-bug-minimizer standalone-coq-require-minimizer standalone-coq-import-inliner