21 lines
765 B
Makefile
21 lines
765 B
Makefile
|
MAIN = wasm.o
|
||
|
MOBJS+=heap.o newdel.o
|
||
|
LD = wasm-ld-10
|
||
|
TARGET = --target=wasm32-unknown-unknown
|
||
|
PR = bin/module.wasm
|
||
|
# Cesta k newlib
|
||
|
LPATH = ${HOME}/local/wasm32-none-eabi
|
||
|
CFLAGS = -Wall -Oz -flto -I. -I$(LPATH)/include $(TARGET)
|
||
|
#CFLAGS+= --sysroot=${HOME}/local/wasm32-none-eabi
|
||
|
CFLAGS+= -ffunction-sections -fdata-sections
|
||
|
#CFLAGS+= -Wno-incompatible-library-redeclaration
|
||
|
# Pro clang by muselo ještě přibýt -nostartfiles $(TARGET) a LFLAGS by bylo -Wl,
|
||
|
LFLAGS = --no-entry --import-memory --lto-O3 --gc-sections
|
||
|
# vetsi stack znamena zvetsit i WebAssembly.Memory({ initial: n 64K block })
|
||
|
#LFLAGS+= -z stack-size=1048576
|
||
|
#LFLAGS+= --print-gc-sections
|
||
|
#LFLAGS+= --allow-undefined
|
||
|
LFLAGS+= --allow-undefined-file=symbols.txt
|
||
|
LDLIBS = -L$(LPATH)/lib -lc -lm
|
||
|
|