Diff of /Makefile [ccf2d5] .. [156261]  Maximize  Restore

Switch to side-by-side view

--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,9 @@
 C2IEC=c2iec
 TESTS=$(patsubst %.c, %.test, $(wildcard test/*.c))
 TEST_LOGS=$(patsubst %.c, %.test.log, $(wildcard test/*.c))
+
+CC?=gcc
+EMCC?=emcc
 
 # if parameter "DEBUG" is set, we set debug flags for lex/yacc
 ifneq (${DEBUG},)
@@ -10,7 +13,13 @@
 all: ${C2IEC}
 
 ${C2IEC}: lex.yy.c y.tab.c
-	gcc -o $@ $^
+	$(CC) -o $@ $^
+
+${C2IEC}.js: lex.yy.c y.tab.c
+	${EMCC} -o $@ $^
+
+${C2IEC}.html: lex.yy.c y.tab.c
+	${EMCC} -s WASM=1 -o $@ $^
 
 lex.yy.c: ${C2IEC}.l
 	flex ${DEBUG_FLAGS} $^