-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
71 lines (51 loc) · 1.65 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
#PREFIX is environment variable, but if it is not set, then set default value
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
INSTALL_DIR=$(PREFIX)/bin
OC=obnc-compile
LINK=obnc
OBNC_CONFIG_C_REAL_TYPE=OBNC_CONFIG_FLOAT
OBNC_CONFIG_C_INT_TYPE=OBNC_CONFIG_INT
ODIR=.obnc
SRC=src
OUT=$(SRC)/$(ODIR)
SIMS = \
$(OUT)/Config.sym \
$(OUT)/Texts.sym \
$(OUT)/ORS.sym \
$(OUT)/ORB.sym \
$(OUT)/ORG.sym \
$(OUT)/ORP.sym \
$(OUT)/SYS.sym
$(OUT)/%.sym: $(SRC)/%.Mod
cd $(SRC); $(OC) $(<F)
.PHONY: all
all: OberonESP32 ORToolESP32 OIOrderESP32
OberonESP32: $(SIMS) $(SRC)/Oberon.Mod
cd $(SRC); $(LINK) Oberon.Mod
mv $(SRC)/Oberon ./OberonESP32
ORToolESP32: $(SRC)/ORTool.Mod $(OUT)/ORB.sym $(OUT)/Texts.sym $(OUT)/Config.sym
cd $(SRC); $(LINK) ORTool.Mod
mv $(SRC)/ORTool ./ORToolESP32
OIOrderESP32: $(SRC)/ORTool.Mod $(OUT)/Texts.sym $(OUT)/Config.sym
cd $(SRC); $(LINK) OIOrder.Mod
mv $(SRC)/OIOrder ./OIOrderESP32
$(OUT)/Texts.sym: $(SRC)/Texts.Mod
$(OUT)/ORS.sym: $(SRC)/ORS.Mod $(OUT)/Texts.sym $(OUT)/SYS.sym
$(OUT)/ORB.sym: $(SRC)/ORB.Mod $(OUT)/ORS.sym
$(OUT)/ORG.sym: $(SRC)/ORG.Mod $(OUT)/ORS.sym $(OUT)/ORB.sym $(OUT)/SYS.sym
$(OUT)/ORP.sym: $(SRC)/ORP.Mod $(OUT)/ORS.sym $(OUT)/ORB.sym $(OUT)/ORG.sym $(OUT)/Texts.sym
$(OUT)/Config.sym: $(SRC)/Config.Mod
$(OUT)/SYS.sym: $(SRC)/SYS.c
cd $(SRC); cp SYS.sym SYS.h $(ODIR)
cd $(SRC); gcc -c SYS.c -o $(ODIR)/SYS.o
cd $(SRC); touch $(ODIR)/SYS.sym
.PHONY: clean
clean:
rm -rf $(OUT)/*
.PHONY: install
install: OberonESP32 OIOrderESP32 ORToolESP32
sudo install -m 755 ./OberonESP32 $(INSTALL_DIR)
sudo install -m 755 ./OIOrderESP32 $(INSTALL_DIR)
sudo install -m 755 ./ORToolESP32 $(INSTALL_DIR)