-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
102 lines (94 loc) · 3.3 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# apple commander
AC := ac
# nulib2 for shrinkit
NULIB := nulib2
# disk image to target
XFER := axfer.po
EXE_DISK := luags.po
LIB_DISK := lualib.po
EXE_VOL := LUAGS
LIB_VOL := LUALIB
# lua .h files for lua.lib
LUA_INC := luainc.shk
SHK_FILE := luags.shk
# directory to hold binaries
EXE_DIR := build
SRC_DIR := src
DSK_DIR := images
# compiler flags
CFLAGS := -I -P -D +O
.PHONY: all testdisk luadisk clean cleanluacout cleandisk minitest bridgedisk release cleanrelease disks
bridge: test.a testiface.a testbridge.a
iix link test testiface testbridge $(SRC_DIR)/lvm $(SRC_DIR)/lua.lib KEEP=$@
test.a: test.c
test_iface.a: testiface.c
test_bridge.a: testbridge.c
lua: | $(EXE_DIR)
+$(MAKE) -C src lua
liblua: | $(EXE_DIR)
+$(MAKE) -C src liblua
luac: | $(EXE_DIR)
+$(MAKE) -C src luac
clean:
+$(MAKE) -C src clean
cleanluacout:
@rm -f -- luac.out
luac.out:
iix $(EXE_DIR)/luac test.lua
minitest: cleanluacout luac.out
iix $(EXE_DIR)/lua poker.lua
bridgedisk: cleandisk bridge
<bridge $(AC) -p $(XFER) bridge exe
<bridge.out $(AC) -p $(XFER) bridge.out bin
<bridge.lua $(AC) -p $(XFER) bridge.lua txt
$(AC) -l $(XFER)
bridgesrcdisk: lua cleandisk bridge
<$(EXE_DIR)/lua.lib $(AC) -p $(XFER) lua.lib lib
<$(SRC_DIR)/lvm.a $(AC) -p $(XFER) lvm.a obj
<luainc.shk $(AC) -p $(XFER) luainc.shk shk
<testbridge.c $(AC) -p $(XFER) testbridge.cc src
<test.c $(AC) -p $(XFER) test.cc src
<testiface.c $(AC) -p $(XFER) testiface.cc src
<testiface.h $(AC) -p $(XFER) testiface.h src
<bridge.out $(AC) -p $(XFER) bridge.out bin
<bridge.lua $(AC) -p $(XFER) bridge.lua txt
$(AC) -l $(XFER)
testdisk: cleanluacout luac luadisk luac.out | $(DSK_DIR)
@<luac.out $(AC) -p $(DSK_DIR)/$(XFER) luac.out bin
@<test.lua $(AC) -p $(DSK_DIR)/$(XFER) test.lua txt
luadisk: cleandisk lua | $(DSK_DIR)
@<$(EXE_DIR)/lua $(AC) -p $(DSK_DIR)/$(XFER) lua exe
@<examples/blackjack.lua $(AC) -ptx $(DSK_DIR)/$(XFER) blackjack.lua
@<examples/replcli.lua $(AC) -ptx $(DSK_DIR)/$(XFER) replcli.lua
@<examples/more.lua $(AC) -ptx $(DSK_DIR)/$(XFER) more.lua
@$(AC) -l $(DSK_DIR)/$(XFER)
luacdisk: cleandisk luac | $(DSK_DIR)
@<$(EXE_DIR)/luac $(AC) -p $(DSK_DIR)/$(XFER) luac exe
@$(AC) -l $(DSK_DIR)/$(XFER)
cleanrelease:
@rm -f -- $(EXE_DISK) $(LIB_DISK) $(DSK_DIR)/$(XFER) $(EXE_DIR)/* $(DSK_DIR)/* $(SHK_FILE)
release: cleanrelease clean $(EXE_DISK) $(LIB_DISK) | $(DSK_DIR)
$(NULIB) -a $(DSK_DIR)/$(SHK_FILE) $(EXE_DIR)/lua $(EXE_DIR)/luac test.lua
disks: $(EXE_DISK) $(LIB_DISK)
$(EXE_DISK): luac lua | $(DSK_DIR)
@$(AC) -pro800 $(DSK_DIR)/$(EXE_DISK) LUAGS
@<$(EXE_DIR)/lua $(AC) -p $(DSK_DIR)/$(EXE_DISK) lua exe
@<$(EXE_DIR)/luac $(AC) -p $(DSK_DIR)/$(EXE_DISK) luac exe
@<test.lua $(AC) -ptx $(DSK_DIR)/$(EXE_DISK) test.lua
@<examples/blackjack.lua $(AC) -ptx $(DSK_DIR)/$(EXE_DISK) blackjack.lua
@<examples/replcli.lua $(AC) -ptx $(DSK_DIR)/$(EXE_DISK) replcli.lua
@<examples/more.lua $(AC) -ptx $(DSK_DIR)/$(EXE_DISK) more.lua
@$(AC) -l $(DSK_DIR)/$(EXE_DISK)
$(LIB_DISK): liblua $(EXE_DIR)/lua.lib | $(DSK_DIR)
@$(AC) -pro800 $(DSK_DIR)/$(LIB_DISK) LUALIB
@<$(EXE_DIR)/lua.lib $(AC) -p $(DSK_DIR)/$(LIB_DISK) lua.lib lib
@<luainc.shk $(AC) -p $(DSK_DIR)/$(LIB_DISK) luainc.shk shk
@$(AC) -l $(DSK_DIR)/$(LIB_DISK)
cleandisk:
@$(AC) -pro800 $(DSK_DIR)/$(XFER) XFER
$(EXE_DIR):
@mkdir -p $@
$(DSK_DIR):
@mkdir -p $@
%.a:
iix compile $(CFLAGS) $<