-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
77 lines (61 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
VERSION:=$(shell git --git-dir=.git describe --always --long)
RELEASE:=1.8.0
ifndef VERSION
VERSION:=$(RELEASE)
endif
.NOTPARALLEL:
.SUFFIXES:
.PHONY: build clean test doc release install
build:
$(MAKE) -C src build
# bytecode-only target:
all:
$(MAKE) -C src all
install:
$(MAKE) -C src VERSION=$(VERSION) install
doc:
$(MAKE) -C src doc
test:
$(MAKE) -C test all run
$(MAKE) -C test opt run
clean:
$(MAKE) -C src clean
$(MAKE) -C test clean
NAME=extlib-$(RELEASE)
release:
git tag -a -m $(RELEASE) $(RELEASE)
git archive --prefix=$(NAME)/ $(RELEASE) | gzip > $(NAME).tar.gz
gpg -a -b $(NAME).tar.gz -o $(NAME).tar.gz.asc
.PHONY: sw_test_all sw_deps_all
define gen_sw =
sw_test_all:: sw_test_$(1)
sw_deps_all:: sw_deps_$(1)
.PHONY: sw_deps_$(1)
sw_deps_$(1):
opam install --switch=$(1) -y --deps-only .
.PHONY: sw_test_$(1)
sw_test_$(1):
-opam exec --switch=$(1) -- make clean build test >/dev/null 2>/dev/null
# expected to fail < 4.03.0
ifneq "$(1)" "4.02.3"
-opam exec --switch=$(1) -- ocaml check_stdlib.ml
endif
endef
$(foreach version,\
4.02.3\
4.03.0\
4.04.2\
4.05.0\
4.06.1\
4.07.1\
4.08.0\
4.09.1\
4.10.2\
4.11.1\
4.12.0\
4.13.1\
4.14.0\
5.0.0\
5.1.1\
5.2.0\
,$(eval $(call gen_sw,$(version))))