forked from exercism/scheme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
112 lines (92 loc) · 2.47 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
chez := scheme
problem-specifications-rev := c6cd8f27b20aa931457bce4377214cb62fbe4187
problem-specifications := [email protected]:exercism/problem-specifications.git
doc-files := \
ABOUT \
INSTALLATION \
RESOURCES \
TESTS
implementations := \
collatz-conjecture \
forth \
affine-cipher \
queen-attack \
matching-brackets \
pangram \
binary-search \
hello-world \
leap \
hamming \
atbash-cipher \
grains \
anagram \
pascals-triangle \
rna-transcription \
difference-of-squares \
nucleotide-count \
scrabble-score \
two-fer \
word-count \
knapsack \
raindrops \
phone-number \
bob \
prime-factors \
transpose \
rotational-cipher \
perfect-numbers \
change \
sieve
track-documentation := $(foreach doc,$(doc-files),docs/$(doc).md)
exercisms := $(foreach exercism,$(implementations),exercises/$(exercism))
readme-splice := config/exercise-readme-insert.md
track-requirements := \
Makefile \
../problem-specifications \
bin/configlet \
input/skeleton-makefile \
input/specifications.ss \
$(readme-splice) \
$(exercisms) \
config.json
# run given expression upon loading the code
exercise = echo $(1) | $(chez) -q load.ss
default : track
# PROBLEM-SPECIFICATIONS
../problem-specifications :
cd .. && git clone $(problem-specifications)
cd $@ && git checkout $(problem-specifications-rev)
input/specifications.ss : ../problem-specifications
$(call exercise, "(persist-specifications)")
# CONFIG
config.json : config/track.ss
$(call exercise, "(make-config)")
# configlet binary
bin/configlet :
./bin/fetch-configlet
# documentation
docs/%.md : code/markdown.sls input/docs/%.ss
$(call exercise, "(put-doc '$(@F:.md=))")
$(readme-splice) : $(track-documentation)
cp docs/TESTS.md $@
# exercises
exercises/% : code/*.sls input/skeleton-* code/track.ss input/exercises/%/*
$(call exercise, "(make-exercism '$(@F))")
# build track
track : $(track-requirements)
./bin/configlet generate .
./bin/configlet fmt .
./bin/configlet lint .
# send a list of implementations to run stub-makefile tests on
ci :
#echo "(run-ci '($(implementations)))" | $(chez) -q "script/ci.ss"
# The acronym example code only works for guile. Currently, examples
# must pass for both chez and guile. list-ops and robot-name are both
# deprecated anyway.
echo "(run-all-tests 'list-ops 'robot-name 'acronym)" | $(chez) -q script/ci.ss
clean :
find . -name "*.so" -exec rm {} \;
find . -name "*~" -exec rm {} \;
find . -name "*.html" -exec rm {} \;
rm -rf _build ci
.PHONY : track clean