| a/Makefile | b/Makefile | ||
|---|---|---|---|
| 1 | C2IEC=c2iec |
1 | C2IEC=c2iec |
| 2 | TESTS=$(patsubst %.c, %.test, $(wildcard test/*.c)) |
2 | TESTS=$(patsubst %.c, %.test, $(wildcard test/*.c)) |
| 3 | TEST_LOGS=$(patsubst %.c, %.test.log, $(wildcard test/*.c)) |
3 | TEST_LOGS=$(patsubst %.c, %.test.log, $(wildcard test/*.c)) |
| 4 | 4 | ||
| 5 | CC?=gcc |
||
| 6 | EMCC?=emcc |
||
| 7 | |||
| 5 | # if parameter "DEBUG" is set, we set debug flags for lex/yacc |
8 | # if parameter "DEBUG" is set, we set debug flags for lex/yacc |
| 6 | ifneq (${DEBUG},) |
9 | ifneq (${DEBUG},) |
| 7 | DEBUG_FLAGS += -d |
10 | DEBUG_FLAGS += -d |
| 8 | endif |
11 | endif |
| 9 | 12 | ||
| 10 | all: ${C2IEC} |
13 | all: ${C2IEC} |
| 11 | 14 | ||
| 12 | ${C2IEC}: lex.yy.c y.tab.c |
15 | ${C2IEC}: lex.yy.c y.tab.c |
| 13 | gcc -o $@ $^ |
16 | $(CC) -o $@ $^ |
| 17 | |||
| 18 | ${C2IEC}.js: lex.yy.c y.tab.c |
||
| 19 | ${EMCC} -o $@ $^ |
||
| 20 | |||
| 21 | ${C2IEC}.html: lex.yy.c y.tab.c |
||
| 22 | ${EMCC} -s WASM=1 -o $@ $^ |
||
| 14 | 23 | ||
| 15 | lex.yy.c: ${C2IEC}.l |
24 | lex.yy.c: ${C2IEC}.l |
| 16 | flex ${DEBUG_FLAGS} $^ |
25 | flex ${DEBUG_FLAGS} $^ |
| 17 | 26 | ||
| 18 | y.tab.c: ${C2IEC}.y |
27 | y.tab.c: ${C2IEC}.y |
... |
... |
||
| 68 | 77 |