forked from kanaka/mal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (25 loc) Β· 771 Bytes
/
Makefile
File metadata and controls
36 lines (25 loc) Β· 771 Bytes
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
TESTS =
SOURCES_BASE = readline.php types.php reader.php printer.php
SOURCES_LISP = env.php core.php stepA_mal.php
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
all:
dist: mal.php mal
mal.php: $(SOURCES)
cat $+ | grep -v "^require_once" > $@
mal: mal.php
echo "#!/usr/bin/env php" > $@
cat $< >> $@
chmod +x $@
clean:
rm -f mal.php mal
.PHONY: stats tests $(TESTS)
stats: $(SOURCES)
@wc $^
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*#|^[[:space:]]*//|^[[:space:]]/\*|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
stats-lisp: $(SOURCES_LISP)
@wc $^
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*#|^[[:space:]]*//|^[[:space:]]/\*|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
tests: $(TESTS)
$(TESTS):
@echo "Running $@"; \
php $@ || exit 1; \