-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
68 lines (58 loc) · 2.13 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
.PHONY: all clean coverage install lint test
SRC := $(shell git ls-files '*.ss')
INSTALLROOT := ~/.emacs.d/swish-lint
ifeq (Windows_NT,${OS})
EXESUFFIX:= .exe
SCHEME_LIBPATH:=$(shell cygpath -w "$$(dirname "$$(type -p scheme)")")
else
EXESUFFIX:=
SCHEME_LIBPATH:=
endif
all: swish-lint${EXESUFFIX}
swish-lint${EXESUFFIX}:: | prepare-source
swish-lint${EXESUFFIX}:: git.revision ${SRC}
@./copy-dlls -s "${SCHEME_LIBPATH}"
swish-build -o $@ main.ss -b petite --rtlib swish --libs-visible
test: all
swish-test --progress test --report mat-report.html .
coverage: all
rm -f profile.data
swish-test --progress test --report mat-report.html --save-profile profile.data --coverage coverage.html --exclude 'testing/**' .
lint: swish-lint${EXESUFFIX} ${SRC}
./swish-lint${EXESUFFIX} ${SRC}
# force evaluation, but use a different target from the output that
# main.ss depends on so we don't rebuild needlessly
.PHONY: prepare-source
prepare-source:
@git describe --always --exclude='*' --abbrev=40 --dirty > git.revision.tmp
@if cmp --quiet git.revision git.revision.tmp; then \
rm git.revision.tmp; \
else \
mv git.revision.tmp git.revision; touch software-info.ss; echo "git.revision changed"; \
fi
@git describe --tags --dirty | sed -E 's/^v//; s/-g[0-9a-f]+//' > git.tag.tmp
@if cmp --quiet git.tag git.tag.tmp; then \
rm git.tag.tmp; \
else \
mv git.tag.tmp git.tag; touch software-info.ss; echo "git.tag changed"; \
fi
@echo '(json:pretty (software-info))' | swish -q > swish.info.tmp
@if cmp --quiet swish.info swish.info.tmp; then \
rm swish.info.tmp; \
else \
mv swish.info.tmp swish.info; touch software-info.ss; echo "swish.info changed"; \
fi
install: all
install -d ${INSTALLROOT}
install swish-lint${EXESUFFIX} ${INSTALLROOT}
install -m 644 swish-lint.boot ${INSTALLROOT}
install -m 644 lsp-swish.el ${INSTALLROOT}
ifeq (Windows_NT,${OS})
install csv*.dll uv.dll osi.dll sqlite3.dll ${INSTALLROOT}
endif
clean:
rm -f git.revision git.tag swish.info
rm -f swish-lint${EXESUFFIX} swish-lint.boot
rm -f *.{so,mo,wpo,sop,ss.html}
rm -f testing/*.{so,mo,wpo,sop,ss.html}
rm -f profile.data coverage.html mat-report.html