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.
25 lines
614 B
25 lines
614 B
5 years ago
|
# 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
|
||
|
|
||
|
.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 --header-file=lex.yy.h $<
|
||
|
|
||
|
parser.tab.c parser.tab.h: parser.y expression.h
|
||
|
bison -d $<
|
||
|
|
||
|
%.o: %.c
|
||
|
$(CC) $(CFLAGS) -c $<
|
||
|
|
||
|
.PHONY: clean
|
||
|
clean:
|
||
|
rm -rf *.o {lex.yy,parser.tab}.{c,h} webdice.js
|