-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
78 lines (64 loc) · 1.81 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
# Makefile for XPL
# ---------------------------------------------------------
# GEN: Where to put generated intermediate files.
# warning: gen directory gets wiped out, so use a temp dir!
GEN = ./.gen
# BIN: where to put the final executables
BIN = ./bin
FPC = fpc -Mdelphiunicode -FE$(BIN) -Fu$(GEN) -Fi$(GEN) -Fu./code -Fi./code -gl
PY = python
TANGLE = ./etc/tangle.el
targets:
@echo
@echo 'available targets:'
@echo
@echo ' test : run test cases'
@echo ' clean : delete compiled binaries and backup files'
@echo
@echo ' repl : simple lisp-like RPL [like a REPL but no "eval" yet :)]'
@echo ' xt256 : 256 color console demo for term'
@echo
@echo 'also:'
@echo ' bin/% : compiles demo/%.pas to bin/%'
@echo
# init contains all the stuff that has to run up front
init:
@mkdir -p $(GEN)
@mkdir -p $(BIN)
# 'always' is just a dummy thing that always runs
always:
bin/%: demo/%.pas tidy
rm -f $@
$(FPC) $<
# tidy just moves all the units and whatnot to the gen directory
tidy:
mv $(BIN)/*.o $(GEN) || true
mv $(BIN)/*.ppu $(GEN) || true
# clean removes all the generated files
clean:
@rm -f *~ *.gpi *.o *.pyc
@delp $(BIN)
@rm -rf $(GEN) ; mkdir -p $(GEN)
# we use always here, else it'll see the test directory and assume we're done.
test: always init clean tangle test-runner
@bin/run-tests $(paramline)
test-runner: test/*.pas code/*.pas
cd test; $(PY) gen-tests.py ../$(GEN)
$(FPC) -B test/run-tests.pas
#-- org-mode stuff ----------------------------
tangle:
$(PY) etc/tangle-all.py
#-- units -------------------------------------
gen/%.ppu: /%.pas
make init
$(FPC) $<
ll: bin/ll.ppu
cw: bin/cw.ppu
fs: bin/fs.ppu ustr
ustr: bin/ustr.ppu
num: bin/num.ppu
#-- demos --------------------------------------
repl: bin/repl
$(BIN)/repl
xt256: bin/xterm256color
$(BIN)/xterm256color