forked from DIVGAMES/DIV-Games-Studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.html2
128 lines (97 loc) · 3.97 KB
/
Makefile.html2
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#
# DIV RUNTIME BUILD SCRIPT
#
# EMSCRIPTEN TARGET
#
##############################
BUILDLVL= -O3
#BUILDLVL= -g4
SDL_CFLAGS = -DZLIB -DMIXER -DSDL2 -DDIVDLL -DMODE8 -DNETPLAY
#SDL_LIBS = -lSDL
CXX=emcc
CC=emcc
#EMC_OPTS= -w -s USE_ZLIB=1 -s USE_SDL=1 -s TOTAL_MEMORY=268435456 -s MAIN_MODULE=1
#EMC_OPTS= -w -s USE_ZLIB=1 -s USE_SDL=1 -s TOTAL_MEMORY=268435456
#EMC_OPTS= -w -s USE_ZLIB=1 -s USE_SDL=1 -s TOTAL_MEMORY=268435456 -s MAIN_MODULE=1 -s ASM_JS=1
#EMC_OPTS= -w -s USE_ZLIB=1 -s USE_SDL=1 -s TOTAL_MEMORY=268435456 -s ASM_JS=1 -s STB_IMAGE=1
EMC_OPTS= -w -s USE_ZLIB=1 -s USE_SDL=2 -s USE_SDL_NET=2 -s USE_OGG=1 -s USE_VORBIS=1 -s TOTAL_MEMORY=268435456 -s ASM_JS=1 -s STB_IMAGE=1
LINKFLAGS= --use-preload-plugins
# -s ASYNCIFY=1 -s TOTAL_MEMORY=268435456
#-s ASSERTIONS=2
# -s TOTAL_MEMORY=67108864
# -s TOTAL_MEMORY=268435456
# -s TOTAL_MEMORY=134217728
# -s TOTAL_MEMORY=67108864
# -s TOTAL_MEMORY=134217728
#-s TOTAL_MEMORY=67108864
# -s TOTAL_MEMORY=268435456
#-s TOTAL_MEMORY=134217728
# -s TOTAL_MEMORY=67108864
# -s TOTAL_MEMORY=33554432
# -s TOTAL_MEMORY=67108864
# -s TOTAL_MEMORY=268435456
#=134217728
#=67108864
#=67108864
#-s TOTAL_MEMORY=536870912
#-s ASYNCIFY=1 -s USE_ZLIB=1 -s ASM_JS=1
# -s ASSERTIONS=2 -m32 -D__WORSIZE=32 -s TOTAL_MEMORY=268435456
# -s SAFE_HEAP=1
# -s ASSERTIONS=2
# -s ASM_JS=1
#-s EXPORTED_FUNCTIONS="['_getscore','_main']"
EXTRA_FLAGS= -Wno-deprecated -Qunused-arguments -Wno-logical-op-parentheses
SCFLAGS = ${BUILDLVL} ${EMC_OPTS} -Isrc/shared -Isrc -Wall $(SDL_CFLAGS) -funsigned-char -fpermissive -ferror-limit=2
LIBS = $(SDL_LIBS) -lm libSDL2_mixer.a
OSDEP = src/shared/osdep.c src/shared/unzip.c src/shared/mikedll.c
CSRC = $(wildcard src/*.c) ${OSDEP}
SHAREDSRC = $(wildcard src/shared/run/*.c) src/shared/osdep/osd_sdl2.c
MODE8SRC = $(wildcard src/runtime/vpe/*.c)
RSRC = $(wildcard src/runtime/*.c) ${OSDEP} ${SHAREDSRC} ${MODE8SRC}
D1SRC = $(wildcard src/div1run/*.c) ${OSDEP} ${SHAREDSRC}
DSRC = $(wildcard src/runtime/*.c) ${OSDEP} src/runtime/debug/d.c ${SHAREDSRC}
#src/SDL_gfxPrimitives.c src/SDL_gfxBlitFunc.c src/SDL_rotozoom.c
.PHONY : dirs
all: dirs ${RUNNER} ${DIV1RUN} ${DRUNNER} ${DIVIDE}
dirs: obj/src/runtime/vpe obj/src/runtime/debug obj_d/src/runtime/debug obj/src/div1run obj/src/shared/run obj/src/shared/osdep
obj/src/runtime/vpe:
mkdir -p obj/src/runtime/vpe
obj/src/shared/run:
mkdir -p obj/src/shared/run
mkdir -p objd1/src/shared/run
obj/src/shared/osdep:
mkdir -p obj/src/shared/osdep
mkdir -p objd1/src/shared/osdep
obj/src/runtime/debug:
mkdir -p obj/src/runtime/debug
mkdir -p obj/src/osdep
obj_d/src/runtime/debug:
mkdir -p obj_d/src/runtime/debug
mkdir -p obj_d/src/osdep
mkdir -p obj_d/src/shared/run
obj/src/div1run:
mkdir -p objd1/src/div1run
obj/%.c.o : %.c
$(CXX) $(CFLAGS) -DHTML_EXE=\"$(HTML_EXE)\" -c $< -o obj/$<.o
obj_d/%.c.o : %.c
$(CXX) $(CFLAGS) -DDEBUG -DHTML_EXE=\"${DHTML_EXE}\" -c $< -o obj_d/$<.o
objd1/%.c.o : %.c
$(CXX) $(CFLAGS) -DHTML_EXE=\"${D1HTML_EXE}\" -c $< -o objd1/$<.o
${DIVIDE} : CFLAGS = -DDIV2 ${SCFLAGS}
${DIVIDE} : $(CSRC:%.c=obj/%.c.o) obj/src
$(CXX) ${CFLAGS} -o html/div.html $(CSRC:%.c=obj/%.c.o) $(LIBS) $(EMBEDFILES)
${RUNNER} : CFLAGS = -DDIV2 -Isrc/runtime ${SCFLAGS}
${RUNNER} : $(RSRC:%.c=obj/%.c.o) obj/src
$(CXX) $(CFLAGS) -Isrc/runtime -o ${RUNNER} $(RSRC:%.c=obj/%.c.o) $(LIBS) $(DEMBEDFILES) $(REMBEDFILES)
${DRUNNER} : CFLAGS = -DDIV2 -Isrc/runtime ${SCFLAGS}
${DRUNNER} : $(DSRC:%.c=obj_d/%.c.o) obj/src
$(CXX) $(CFLAGS) -Isrc/runtime -o ${DRUNNER} $(DSRC:%.c=obj_d/%.c.o) $(LIBS) $(LINKFLAGS) $(DEMBEDFILES) $(REMBEDFILES)
${DIV1RUN} : CFLAGS = -DDIV1 -Isrc/div1run ${SCFLAGS}
${DIV1RUN} : $(D1SRC:%.c=objd1/%.c.o) objd1/src
$(CXX) $(CFLAGS) -Isrc/div1run -o ${DIV1RUN} $(D1SRC:%.c=objd1/%.c.o) $(LIBS) $(LINKFLAGS) $(D1EMBEDFILES) $(R1EMBED)
#src/main.c.o : src/main.c
# $(CC) $(CFLAGS) -c $< -o $<.o
.PHONY : clean
clean :
rm -rf obj/ obj_d ${RUNNER} ${DRUNNER} ${DIV1RUN}
#src/8080emu.c.o src/main.c.o src/ai.c.o : inc/8080emu.h inc/si-ram.h