-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·52 lines (34 loc) · 1.22 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
SOURCE_DIR = src
AGDA = agda
AGDA_FLAGS =
# Especially the Polymonad.Union proof runs out of stack space quickly.
AGDA_TC = $(AGDA) $(AGDA_FLAGS) -i$(SOURCE_DIR) -v 0 +RTS -K40m -RTS
define agda-files-in
$(shell find $(SOURCE_DIR)/$(1) -type f -name "*.agda" | grep -vxF -f "make-ignore")
endef
define agda-files-in-root
$(shell find $(SOURCE_DIR)/*.agda | grep -vxF -f "make-ignore")
endef
define agda-type-check
echo "Checking $(1)" && $(AGDA_TC) $(1)
endef
define agda-check-all-in
$(foreach agda_file,$(1),$(call agda-type-check,$(agda_file)) &&) true
endef
all: type-check
type-check: only-base only-haskell only-hicks only-hicks only-polymonad only-supermonad only-theory
only-base:
@$(call agda-check-all-in,$(call agda-files-in-root))
only-haskell:
@$(call agda-check-all-in,$(call agda-files-in,Haskell))
only-hicks:
@$(call agda-check-all-in,$(call agda-files-in,Hicks))
only-polymonad:
@$(call agda-check-all-in,$(call agda-files-in,Polymonad))
only-supermonad:
@$(call agda-check-all-in,$(call agda-files-in,Supermonad))
only-theory:
@$(call agda-check-all-in,$(call agda-files-in,Theory))
clean:
find $(SOURCE_DIR) -type f -name "*.agdai" -delete
find $(SOURCE_DIR) -type f -name "*.agda~" -delete