diff options
author | Andrew Clayton <a.clayton@nginx.com> | 2023-08-02 17:03:48 +0100 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2023-08-21 23:24:12 +0100 |
commit | d6ed6a219b31a58526721f96195c80061d41ce54 (patch) | |
tree | 17a1fd6ecf72a327916ff0f8bc7aaf85b981ceff /examples/c/Makefile | |
download | unit-wasm-d6ed6a219b31a58526721f96195c80061d41ce54.tar.gz unit-wasm-d6ed6a219b31a58526721f96195c80061d41ce54.tar.bz2 |
Initial commitv0.1.0
libunit-wasm and example C and Rust WebAssembly modules for NGINX Unit.
Co-developed-by: Timo Stark <t.stark@nginx.com>
Co-developed-by: Liam Crilly <liam@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'examples/c/Makefile')
-rw-r--r-- | examples/c/Makefile | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/examples/c/Makefile b/examples/c/Makefile new file mode 100644 index 0000000..1b10269 --- /dev/null +++ b/examples/c/Makefile @@ -0,0 +1,40 @@ +include ../../shared.mk + +CFLAGS += -I../../src/c/include +LIBS = -L../../src/c -lunit-wasm + +SDIR = examples/c + +LUW_SRCDIR = ../../src/c + +luw_deps = $(LUW_SRCDIR)/libunit-wasm.a \ + $(LUW_SRCDIR)/include/unit/unit-wasm.h + +examples: examples-luw + +examples-luw: luw-echo-request.wasm luw-upload-reflector.wasm + +examples-raw: echo-request-raw.wasm upload-reflector-raw.wasm + +luw-echo-request.wasm: luw-echo-request.c $(luw_deps) + $(PP_CCLNK) $(SDIR)/$@ + $(v)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) + +luw-upload-reflector.wasm: luw-upload-reflector.c $(luw_deps) + $(PP_CCLNK) $(SDIR)/$@ + $(v)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) + +unit-wasm-raw.o: unit-wasm-raw.c unit-wasm-raw.h + $(PP_CC) $(SDIR)/$@ + $(v)$(CC) $(CFLAGS) -c $< + +echo-request-raw.wasm: echo-request-raw.c unit-wasm-raw.o + $(PP_CCLNK) $(SDIR)/$@ + $(v)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< unit-wasm-raw.o + +upload-reflector-raw.wasm: upload-reflector-raw.c unit-wasm-raw.o + $(PP_CCLNK) $(SDIR)/$@ + $(v)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< unit-wasm-raw.o + +clean: + rm -f *.wasm *.o *.gch |