You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
784 B
29 lines
784 B
# Flags |
|
CC = emcc |
|
JSFLAGS += -Oz -s "EXTRA_EXPORTED_RUNTIME_METHODS=['lengthBytesUTF8','stringToUTF8']" -s "EXPORTED_FUNCTIONS=['_malloc','_free']" -s WASM=1 -s EXIT_RUNTIME=1 |
|
CFLAGS += $(JSFLAGS) -std=gnu99 -Wall -pedantic |
|
LFLAGS += -lm |
|
DEBUG = |
|
#DEBUG += --debug |
|
|
|
.PHONY: all |
|
all: webdice.js |
|
|
|
webdice.js: js-api.c expression.o lex.yy.o parser.tab.o |
|
$(CC) $^ $(CFLAGS) -o $@ $(LFLAGS) |
|
|
|
lex.yy.c lex.yy.h: lexer.l parser.tab.h expression.h |
|
flex ${DEBUG} --header-file=lex.yy.h $< |
|
|
|
parser.tab.c parser.tab.h: parser.y expression.h |
|
bison ${DEBUG} -d $< |
|
|
|
%.o: %.c |
|
$(CC) $(CFLAGS) -c $< |
|
|
|
native-test: native-test.c lex.yy.c parser.tab.c expression.c |
|
gcc -m32 -std=gnu99 -Wall -pedantic $^ -o $@ $(LFLAGS) -g -O0 |
|
|
|
.PHONY: clean |
|
clean: |
|
rm -rf *.o {lex.yy,parser.tab}.{c,h} webdice.js
|
|
|