-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
49 lines (37 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
42
43
44
45
46
47
48
49
AR=ar
ARFLAGS=rcs
CPP=g++
CPPFLAGS=-O2 -g
LD=g++
LDFLAGS=
RM=rm
OUTFILE0=tbc
OUTFILE1=tbc1
OUTFILE2=tbc2
OUTFILE3=tbc3
OUTFILE4=tbc4
SRC=compiler/src/tinybasic.bas
INC=$(wildcard compiler/src/inc/*.bi)
ALLSRC=$(INC) $(wildcard compiler/src/*.bas)
RTLIBSRC=$(wildcard rtlib/src/*.cpp)
RTLIBINC=$(wildcard rtlib/inc/*.h)
RTLIBOBJ=$(patsubst rtlib/src/%.cpp,o/%.o,$(RTLIBSRC))
all: rtlib $(OUTFILE4)
################################################################################
rtlib: $(RTLIBOBJ)
o/%.o: rtlib/src/%.cpp $(RTLIBINC)
$(CPP) $(CPPFLAGS) -c $< -o $@
################################################################################
$(OUTFILE0): $(ALLSRC) rtlib
fbc -g -x $@ $(SRC)
$(OUTFILE1): $(ALLSRC) $(OUTFILE0) rtlib
./$(OUTFILE0) -O -g -o $@ $(SRC)
$(OUTFILE2): $(ALLSRC) $(OUTFILE1) rtlib
./$(OUTFILE1) -O -g -o $@ $(SRC)
$(OUTFILE3): $(ALLSRC) $(OUTFILE2) rtlib
./$(OUTFILE2) -O -g -o $@ $(SRC)
$(OUTFILE4): $(ALLSRC) $(OUTFILE3) rtlib
./$(OUTFILE3) -O -g -o $@ $(SRC)
clean:
@$(RM) -f $(OUTFILE0) $(OUTFILE1) $(OUTFILE2) $(OUTFILE3) $(OUTFILE4)
@$(RM) -f $(RTLIBOBJ) _____temp.c