Merge pull request #178 from dubek/fix-negative
[jackhill/mal.git] / ps / Makefile
CommitLineData
3da90d39
JM
1
2TESTS =
3
712af9ef 4SOURCES_BASE = types.ps reader.ps printer.ps
90f618cb 5SOURCES_LISP = env.ps core.ps stepA_mal.ps
712af9ef 6SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
3da90d39 7
5245b079
JM
8all:
9 true
10
8e2d4a4c 11dist: mal.ps mal
5245b079
JM
12
13mal.ps: $(SOURCES)
8e2d4a4c
JM
14 cat $+ | grep -v "runlibfile$$" > $@
15
16mal: mal.ps
5245b079
JM
17 echo "#!/bin/sh" > $@
18 echo "\":\" pop pop pop pop %#; exec gs -d'#!'=null -d'\":\"'=null -q -dNODISPLAY -- \"\$$0\" \"\$$@\"" >> $@
8e2d4a4c 19 cat $< >> $@
5245b079
JM
20 chmod +x $@
21
22clean:
8e2d4a4c 23 rm -f mal.ps mal
5245b079
JM
24
25
3da90d39
JM
26.PHONY: stats tests $(TESTS)
27
28stats: $(SOURCES)
29 @wc $^
f15b4021 30 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*%|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
712af9ef
JM
31stats-lisp: $(SOURCES_LISP)
32 @wc $^
f15b4021 33 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*%|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
3da90d39
JM
34
35tests: $(TESTS)
36
37$(TESTS):
38 @echo "Running $@"; \
39 gs -q -dNODISPLAY -- $@ || exit 1; \