-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathMakefile
90 lines (62 loc) · 1.99 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
78
79
80
81
82
83
84
85
86
87
88
89
90
## Makefile
all:
include Makefunc.mk
TOP := $(dir $(lastword $(MAKEFILE_LIST)))
UUID := $(shell ((uuidgen > /dev/null 2>&1 && uuidgen) || echo $$) | cut -c -7)
UBUNTU_EMACS := 24.1 24.5 25.1
ALPINE_EMACS := 25.3 26.1 26.2
DOCKER_EMACS := $(UBUNTU_EMACS:%=ubuntu-min-%) $(ALPINE_EMACS:%=alpine-min-%)
DEPENDS :=
EMACS ?= emacs
BATCH := $(EMACS) -Q --batch -L $(TOP) $(DEPENDS:%=-L ./%/)
TESTFILE := leaf-tests.el
ELS := leaf.el
CORTELS := $(TESTFILE) cort-test.el
##################################################
.PHONY: all git-hook build check-22 check allcheck test clean-soft clean
all: git-hook build
##############################
git-hook:
cp -a git-hooks/* .git/hooks/
build: $(ELS:%.el=%.elc)
%.elc: %.el $(DEPENDS)
$(BATCH) $(DEPENDS:%=-L %/) -f batch-byte-compile $<
##############################
#
# docker one-time test (on top level)
#
check: build
$(BATCH) -l $(TESTFILE) -f cort-test-run
##############################
#
# docker multi Emacs version test (on independent environment)
#
allcheck: $(DOCKER_EMACS:%=.make/verbose-${UUID}-emacs-test--%)
@echo ""
@cat $^ | grep =====
@rm -rf $^
.make/verbose-%: .make $(DEPENDS)
docker run -itd --name $* conao3/emacs:$(shell echo $* | sed "s/.*--//") /bin/sh
docker cp . $*:/test
docker exec $* sh -c "cd test && make clean-soft && make check -j" | tee $@
docker rm -f $*
##############################
#
# docker silent `allcheck' job
#
test: $(DOCKER_EMACS:%=.make/silent-${UUID}-emacs-test--%)
@echo ""
@cat $^ | grep =====
@rm -rf $^
.make/silent-%: .make $(DEPENDS)
docker run -itd --name $* conao3/emacs:$(shell echo $* | sed "s/.*--//") /bin/sh > /dev/null
@docker cp . $*:/test
@docker exec $* sh -c "cd test && make clean-soft && make check -j" > $@ || ( docker rm -f $*; cat $@ || false )
@docker rm -f $* > /dev/null
.make:
mkdir $@
##############################
clean-soft:
rm -rf $(ELS:%.el=%.elc) .make
clean:
rm -rf $(ELS:%.el=%.elc) $(DEPENDS) .make