-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct wasm2c example Makefiles (#2426)
- Passing "-lm" into the prereq isn't the correct way add the flag. This correctly adds it to the command. - The "rot13" example incorrectly assumed that the "rot13.h" file would be generated by the time that "main.c" was being compiled, however there is no rule supporting this and it would fail. I've also added "rot13.h" to the clean rule.
- Loading branch information
1 parent
2c50f59
commit 4beb525
Showing
5 changed files
with
14 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
# Use implicit rules for compiling C files. | ||
CFLAGS=-I../.. | ||
LDLIBS=-lm | ||
|
||
all: rot13 | ||
|
||
clean: | ||
rm -rf rot13 rot13.wasm rot13.c *.o | ||
rm -rf rot13 rot13.wasm rot13.c rot13.h *.o | ||
|
||
rot13: main.o rot13.o ../../wasm-rt-impl.o ../../wasm-rt-mem-impl.o -lm | ||
rot13: main.o rot13.o ../../wasm-rt-impl.o ../../wasm-rt-mem-impl.o | ||
|
||
main.o: rot13.h | ||
|
||
rot13.wasm: rot13.wat ../../../bin/wat2wasm | ||
../../../bin/wat2wasm $< -o $@ | ||
|
||
rot13.c: rot13.wasm ../../../bin/wasm2c | ||
../../../bin/wasm2c $< -o $@ --disable-simd | ||
rot13.c rot13.h: rot13.wasm ../../../bin/wasm2c | ||
../../../bin/wasm2c $< -o rot13.c --disable-simd | ||
|
||
.PHONY: all clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters