-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile.droid
executable file
·100 lines (78 loc) · 2.79 KB
/
Makefile.droid
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
#lazy makefile
# for compiling on android for android
# also should work for platforms with no cmake
# which is why this is here in the first place!
CC=gcc
EXECUTABLE=div2-ide
RUNTIME=div2-run
RUNTIME1=div1-run
OSDEP = src/shared/osdep.c src/shared/unzip.c src/shared/osdep/osd_sdl12.c
#src/shared/mikedll.c
FMEMOPEN = src/osx/fmemopen.c
SOURCES=$(wildcard src/*.c) $(wildcard src/shared/lib/sdlgfx/*.c) ${OSDEP} ${FMEMOPEN} src/shared/lib/zip/src/zip.c
#*/
SHAREDSRC=$(wildcard src/shared/run/*.c)
#*/
VPESRC=$(wilcard src/runtime/vpe/*.c)
#*/
RUNSOURCES=$(wildcard src/runtime/*.c) ${SHAREDSRC} ${VPESRC} ${OSDEP} ${FMEMOPEN}
#*/
RUN1SOURCES=$(wildcard src/div1run/*.c) ${SHAREDSRC} ${OSDEP} ${FMEMOPEN}
#src/runtime/debug/d.c
# $(wildcard src/osdep/*.c)
#*/
VISOR_SOURCES=$(wildcard src/visor/*.c)
#*/
VPE_SOURCES=$(wildcard src/runtime/vpe/*.c)
#*/
#$(CSRC:%.c=obj/%.c.o) obj/src
OBJS=$(SOURCES:%.c=divide/%.c.o)
RUNOBJS=$(RUNSOURCES:%.c=div2/%.c.o)
RUN1OBJS=$(RUN1SOURCES:%.c=div1/%.c.o)
VISOROBJS=$(VISOR_SOURCES:.c=.o)
VPEOBJS=$(VPE_SOURCES:.c=.o)
#LIBFLAGS= -lm -ldl -lz -lSDL_image -ltiff -ljpeg -lpng -lz -lSDL_ttf -lfreetype -lSDL_mixer -lvorbisfile -lvorbis -logg -lstdc++ -lSDL
DROIDLIBFLAGS= -lSDL -lSDL_image -lSDL_mixer -lm -lz -ljpeg
# -lSDL_net -ltiff -ljpeg -lpng -lz -lSDL_ttf -lfreetype -lSDL_mixer -lvorbisfile -lvorbis -logg -lstdc++ -Wl,--no-undefined -lm
SCFLAGS= -g -w -fpermissive -Isrc/shared -Isrc -funsigned-char -DMIXER -DZLIB -DDROID -DMODE8 -DSDL -DRUNTIME=\"divrun\"
#-DDIVDLL
#-Isrc/div1run
#-Isrc/runtime
#-DDEBUG
debug : dirs $(EXECUTABLE) $(RUNTIME) $(RUNTIME1)
release : dirs $(EXECUTABLE) $(RUNTIME) $(RUNTIME1)
all: dirs $(EXECUTABLE) $(RUNTIME) $(RUNTIME1)
dirs: divide div1 div2
divide:
mkdir -p divide/src/shared/lib/sdlgfx
mkdir -p divide/src/shared/lib/zip/src
mkdir -p divide/src/shared/osdep
mkdir -p divide/src/osx
div1:
mkdir -p div1/src/shared/run
mkdir -p div1/src/div1run
mkdir -p div1/src/shared/osdep
mkdir -p div1/src/osx
div2:
mkdir -p div2/src/shared/run
mkdir -p div2/src/runtime/vpe
mkdir -p div2/src/shared/osdep
mkdir -p div2/src/osx
${EXECUTABLE}: CFLAGS = ${SCFLAGS} -DDIV2
$(EXECUTABLE): $(OBJS) $(VISOROBJS)
$(CC) $(OBJS) $(VISOROBJS) $(DROIDLIBFLAGS) -o $@
divide/%.c.o: %.c
$(CC) $(CFLAGS) -Isrc -c $< -o divide/$<.o
# $(CC) -c $(CFLAGS) $< -o $@
div1/%.c.o: %.c
$(CC) -c $(CFLAGS) -Isrc $< -o div1/$<.o
div2/%.c.o: %.c
$(CC) -c $(CFLAGS) -Isrc $< -o div2/$<.o
${RUNTIME}: CFLAGS = -DDIV2 -Isrc/runtime ${SCFLAGS}
$(RUNTIME): $(RUNOBJS) $(VPEOBJS)
$(CC) $(RUNOBJS) $(VPEOBJS) $(DROIDLIBFLAGS) -o $@
${RUNTIME1}: CFLAGS = -DDIV1 -Isrc/div1run ${SCFLAGS}
$(RUNTIME1): $(RUN1OBJS)
$(CC) $(RUN1OBJS) $(DROIDLIBFLAGS) -o $@
clean:
rm -f $(EXECUTABLE) $(OBJS) $(RUNOBJS) $(RUN1OBJS) $(VISOROBJS) $(RUNTIME) $(VPEOBJS) $(RUNTIME1)