-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (26 loc) · 857 Bytes
/
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
SOURCES_MAL = readline.php types.php reader.php printer.php interop.php env.php core.php stepA_mal.php
SOURCES_PHP = $(foreach f,$(SOURCES_MAL),mal/php/$(f))
SOURCES = alias-hacks.mal frock.mal
DELIMITER="FROCKSCRIPTDELIMITER"
frock.php: build/mal.php src/*
echo "#!/usr/bin/env php" > $@
grep -B 10000 "// run mal file" $< | sed '$$d' >> $@
echo "\$$script = <<<$(DELIMITER)" >> $@
cat src/* >> $@
echo "$(DELIMITER);" >> $@
echo 'rep("(do " . $$script . ")");' >> $@
echo "?>" >> $@
chmod +x $@
build/mal.php: $(SOURCES_PHP) build
cat $(SOURCES_PHP) | grep -v "^require_once" > $@
$(SOURCES_PHP):
git clone https://github.com/chr15m/mal.git
build:
mkdir -p build
test:
./mal/runtest.py tests/test-frock.clj ./mal/php/mal
.PHONY: clean watch
watch:
while [ 1 ]; do $(MAKE) -q || $(MAKE); sleep 1; done
clean:
rm -rf build/ frock.php