# build Javascript version of riscvemu | |
EMCC=emcc | |
EMCFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -MMD -fno-strict-aliasing | |
#EMCFLAGS+=-Werror | |
EMCFLAGS+=-DMAX_XLEN=64 | |
EMLDFLAGS=-g -O3 -s TOTAL_MEMORY=536870912 --memory-init-file 0 --closure 0 -s NO_EXIT_RUNTIME=1 -s "EXPORTED_FUNCTIONS=['_console_queue_char','_main']" | |
all: js/riscvemu.js | |
JS_OBJS=riscvemu.js.o softfp.js.o ide.js.o | |
js/riscvemu.js: $(JS_OBJS) | |
$(EMCC) $(EMLDFLAGS) -o $@ $(JS_OBJS) | |
%.js.o: %.c | |
$(EMCC) $(EMCFLAGS) -c -o $@ $< | |