Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct wasm2c example Makefiles #2426

Merged
merged 5 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use "LDLIBS" instead of "LDFLAGS"
  • Loading branch information
Rexicon226 committed Jun 3, 2024
commit 42b1de570f3e40fea218da244d980f24928612f2
3 changes: 1 addition & 2 deletions wasm2c/examples/callback/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Use implicit rules for compiling C files.
CFLAGS=-I../..
LDFLAGS=-lm
LDLIBS=-lm

all: callback

clean:
rm -rf callback callback.wasm callback.c callback.h *.o

callback: main.o callback.o ../../wasm-rt-impl.o ../../wasm-rt-mem-impl.o
$(CC) -o $@ $^ $(LDFLAGS)

callback.wasm: callback.wat ../../../bin/wat2wasm
../../../bin/wat2wasm --debug-names $< -o $@
Expand Down
3 changes: 1 addition & 2 deletions wasm2c/examples/fac/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Use implicit rules for compiling C files.
CFLAGS=-I../..
LDFLAGS=-lm
LDLIBS=-lm

all: fac

clean:
rm -rf fac fac.wasm fac.c *.o

fac: main.o fac.o ../../wasm-rt-impl.o
$(CC) -o $@ $^ $(LDFLAGS)

fac.wasm: fac.wat ../../../bin/wat2wasm
../../../bin/wat2wasm $< -o $@
Expand Down
Binary file removed wasm2c/examples/fac/fac.wasm
Binary file not shown.
3 changes: 1 addition & 2 deletions wasm2c/examples/rot13/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Use implicit rules for compiling C files.
CFLAGS=-I../..
LDFLAGS=-lm
LDLIBS=-lm

all: rot13

clean:
rm -rf rot13 rot13.wasm rot13.c rot13.h *.o

rot13: main.o rot13.o ../../wasm-rt-impl.o ../../wasm-rt-mem-impl.o
$(CC) -o $@ $^ $(LDFLAGS)

main.o: rot13.h

Expand Down
3 changes: 1 addition & 2 deletions wasm2c/examples/threads/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#SANITIZERS=-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all
CFLAGS=-I../.. -g -O2 -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-array-bounds -Wno-ignored-optimization-argument -Wno-tautological-constant-out-of-range-compare -Wno-infinite-recursion -fno-optimize-sibling-calls -frounding-math -fsignaling-nans ${SANITIZERS} -pthread
LDFLAGS=${SANITIZERS} -pthread -lm
LDLIBS=${SANITIZERS} -pthread -lm

all: threads

clean:
rm -rf threads sample.wasm sample.c sample.h *.o ../../*.o

threads: threads.o sample.o ../../wasm-rt-impl.o ../../wasm-rt-exceptions-impl.o
$(CC) -o $@ $^ $(LDFLAGS)

sample.wasm: sample.wat ../../../bin/wat2wasm
../../../bin/wat2wasm --debug-names $< -o $@
Expand Down
Loading