-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile-aossf
61 lines (47 loc) · 1.78 KB
/
Makefile-aossf
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
# build architecture inspired by this page:
# http://make.mad-scientist.net/papers/multi-architecture-builds/
ifeq ($(notdir $(CURDIR)), cirrusretro-players)
include target-aossf.mk
else
TARGET:=cr-aosdk-ssf.js
CC:=ccache emcc
LD:=emcc
OPT_LEVEL:=-Os
AOSDK_SRCDIR=$(SRCDIR)/aosdk
SSF_SRCDIR=$(SRCDIR)/aosdk/eng_ssf
XZ_EMBEDDED_SRCDIR=$(SRCDIR)/xz-embedded
VPATH=$(SRCDIR):$(AOSDK_SRCDIR):$(SSF_SRCDIR):$(XZ_EMBEDDED_SRCDIR)
FINALDIR=$(SRCDIR)/final
EXPORT_LIST="['_crPlayerContextSize', '_crPlayerInitialize', '_crPlayerLoadFile', '_crPlayerSetTrack', '_crPlayerGenerateStereoFrames', '_crPlayerVoicesCanBeToggled', '_crPlayerGetVoiceCount', '_crPlayerGetVoiceName', '_crPlayerSetVoiceState', '_crPlayerCleanup']"
# AOSSF source files, plus the Cirrus Retro glue file
AOSSF_C_SOURCES:= \
aosdk_interface.c \
corlett.c \
eng_ssf.c \
m68kcpu.c \
m68kmake.c \
m68kopac.c \
m68kopdm.c \
m68kopnz.c \
m68kops.c \
sat_hw.c \
scsp.c \
scspdsp.c
# XZ-embedded sources
XZ_EMBEDDED_C_SOURCES:=xzdec.c \
xz_crc32.c \
xz_dec_lzma2.c \
xz_dec_stream.c
# Emscripten gets nervous when C/C++ compile flags reference absolute paths;
# '-Wno-warn-absolute-paths' tells the compiler not to worry
CFLAGS:= -Wall -Wno-warn-absolute-paths $(OPT_LEVEL) -I$(SRCDIR) -I$(AOSDK_SRCDIR) -I$(SSF_SRCDIR) -I$(XZ_EMBEDDED_SRCDIR) -s ASSERTIONS=2 -DAOSDK_SSF
AOSSF_C_OBJECTS:=$(patsubst %.c,%.o,$(AOSSF_C_SOURCES))
XZ_EMBEDDED_C_OBJECTS:=$(patsubst %.c,%.o,$(XZ_EMBEDDED_C_SOURCES))
# build rule for all C files
%.o : %.c
$(CC) -o $@ -c $< $(CFLAGS)
$(TARGET): $(AOSSF_CXX_OBJECTS) $(AOSSF_C_OBJECTS) $(XZ_EMBEDDED_C_OBJECTS)
$(LD) -o $(TARGET) $^ --memory-init-file 0 -Wall $(OPT_LEVEL) -s EXPORTED_FUNCTIONS=$(EXPORT_LIST) -s TOTAL_MEMORY=134217728 -s ASSERTIONS=2
mkdir -p $(FINALDIR)
cp $(TARGET)* $(FINALDIR)
endif