-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
67 lines (51 loc) · 1.29 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
CC?=gcc
OFLAGS=-O1
CFLAGS=-O2
PREFIX=/usr
OWLURL=https://haltp.org/files
OWL=ol-0.2.2.c.gz
OL=bin/ol
everything: bin/led .parrot
.parrot: test/* bin/led
test/run bin/led
touch .parrot
# gcc takes a while on a raspberry. this is a lot faster.
fasltest: led.fasl bin/ol
cd test && sh ./run ../bin/ol -l ../led.fasl --
bin/led: c/led.c
mkdir -p bin
$(CC) $(CFLAGS) -o bin/led c/led.c
c/led.c: led/*.scm $(OL)
$(OL) $(OFLAGS) -o c/led.c led/led.scm
led.fasl: bin/ol led/*.scm
make bin/ol
$(OL) -o led.fasl led/led.scm
install: bin/led # .parrot
mkdir -p $(PREFIX)/bin
install -m 755 bin/led $(PREFIX)/bin/led
uninstall:
rm -v $(PREFIX)/bin/led
c/$(OWL):
# this is normally bundled in the repository
mkdir -p c
cd c && wget $(OWLURL)/$(OWL)
c/ol.c: c/$(OWL)
cat c/$(OWL) | gzip -d > c/ol.c
bin/ol: c/ol.c
mkdir -p bin
cc -O2 -o bin/ol c/ol.c
test: .parrot
clean:
-rm c/*.c led.log test/*.out bin/led bin/ol
-rmdir bin
mrproper:
make clean
rm -rf tmp
future:
test -d owl || git clone https://gitlab.com/owl-lisp/owl
cd owl && git pull
-cd owl && make
test -x owl/bin/ol && make OL=owl/bin/ol
.source.map: led/*.scm
grep -n "(define " led/*.scm | sed -re 's/: *\(define \(?/:/' -e 's/ .*//' -e 's/\)//g' > .source.map
.PHONY: mrproper clean test install uninstall fasltest everything