-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
52 lines (38 loc) · 1.34 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
SRC = Musashi/m68kcpu.c Musashi/softfloat/softfloat.c Musashi/m68kops.c Musashi/m68kdasm.c
SRC += main.c uart.c csr.c ramrom.c mapper.c scsi.c mbus.c rtc.c log.c
SRC += emu.c scsi_dev_hd.c rtcram.c
SRC += sysvr2-strace.c
DEPFLAGS = -MT $@ -MMD -MP
CFLAGS=-ggdb -Og -Wall $(DEPFLAGS)
default: emu
Musashi/m68kcpu.o: Musashi/m68kops.h
Musashi/m68kops.h:
make -C Musashi
emu: $(SRC:.c=.o)
$(CC) $(CFLAGS) -o $@ $^ -lm
# Note that PROXY_TO_PTHREAD doesn't generally work as the needed
# SharedArrayBuffer needs some pretty specific server settings.
EMCC_ARGS = -s ASYNCIFY
#EMCC_ARGS = -s PROXY_TO_PTHREAD -pthread
EMCC_ARGS += --js-library node_modules/xterm-pty/emscripten-pty.js
EMCC_ARGS += --preload-file plexus-sanitized.img
EMCC_ARGS += --preload-file U15-MERGED.BIN
EMCC_ARGS += --preload-file U17-MERGED.BIN
EMCC_ARGS += -lidbfs.js
EMCC_ARGS += -O2 -gsource-map --source-map-base=./
plexem.mjs: $(SRC) node_modules/xterm-pty
emcc -o $@ $(EMCC_ARGS) $(SRC) emscripten_env.c -lm
# ToDo: could do a shallow clone of the tag we want... as soon as 0.10.2 is tagged
node_modules/xterm-pty:
npm install
webdeploy: node_modules/xterm-pty plexem.mjs
mkdir -p web
cp plexem.* web
mv web/plexem.html web/index.html
cp -r node_modules/* web
clean:
rm -f $(SRC:.c=.o)
rm -f emu
rm -f Musashi/m68kops.h
-include $(SRC:.c=.d)
.PHONY: clean webdeploy