-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (29 loc) · 1.09 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
T_API_SRC := $(wildcard apis/turtle/*.lua)
T_API_DST := $(patsubst apis/turtle/%.lua, turtle/apis/%, $(T_API_SRC))
C_API_SRC := $(wildcard apis/computer/*.lua)
C_API_DST := $(patsubst apis/computer/%.lua, computer/apis/%, $(C_API_SRC))
T_PRG_SRC := $(wildcard programs/turtle/*.lua)
T_PRG_DST := $(patsubst programs/turtle/%.lua, turtle/progs/%, $(T_PRG_SRC))
C_PRG_SRC := $(wildcard programs/computer/*.lua)
C_PRG_DST := $(patsubst programs/computer/%.lua, computer/progs/%, $(C_PRG_SRC))
all : turtle_build computer_build
turtle_build : turtle $(T_API_DST) $(T_PRG_DST)
@cp startups/startup-turtle.lua turtle/startup
@echo Compiled turtle bundle
turtle :
@mkdir turtle
@mkdir turtle/apis turtle/progs
turtle/apis/% : apis/turtle/%.lua
@cp $< $@
turtle/progs/% : programs/turtle/%.lua
@cp $< $@
computer_build : computer $(C_API_DST) $(C_PRG_DST)
@cp startups/startup-computer.lua computer/startup
@echo Compiled computer bundle
computer :
@mkdir computer
@mkdir computer/apis computer/progs
computer/apis/% : apis/computer/%.lua
@cp $< $@
computer/progs/% : programs/computer/%.lua
@cp $< $@