summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoruntir_l <87096069+untir-l@users.noreply.github.com>2022-02-24 14:57:35 +0000
committeruntir-l <87096069+untir-l@users.noreply.github.com>2022-02-25 09:56:49 +0000
commitc23118e8e48d043e4bb9b4d813a498af8d454d73 (patch)
tree265947d2a848e8a3fb27106be38c8ae95b2fffe0 /Makefile
parent8a7dde79de6edee01571d2eb4a333d8256f4c342 (diff)
downloadhitomezashi-c23118e8e48d043e4bb9b4d813a498af8d454d73.tar
hitomezashi-c23118e8e48d043e4bb9b4d813a498af8d454d73.tar.gz
hitomezashi-c23118e8e48d043e4bb9b4d813a498af8d454d73.zip
Add web app frontend, restructure almost everything
- Add web app frontend code - Add .html, .js, .wasm to .gitignore - Restructure Makefile to work with emmake, add build targets for web app, add .html, .js, .wasm to make clean - Explain the pattern in the README - Add explanation of web frontend to README - Restructure README generally for better clarity - Remove "make web app version" from todos in README - Set Doxygen to EXTRACT_ALL so trivial and useless doc comments are not needed when the naming suffices to be explanatory. - Move ascii_binary_str_to_ints to library code in new file hitomezashi_utils.c (and corresponding header) as web app also needs it. - Fix SDL2 include path so it also works with Emscripten - Remove some cluttering and unnecessary doc comments - Improve some doc comments
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 16 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 7b8e235..b200abf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,27 +1,33 @@
.POSIX:
-CC = gcc
-CFLAGS = -std=c11 -Wall -Wno-unused-function --pedantic-errors -O3 `sdl2-config --cflags` -I./lib/
+CFLAGS = -std=c11 -Wall -Wno-unused-function --pedantic-errors -O3 `sdl2-config --cflags`
LDLIBS = `sdl2-config --libs`
-AR = ar
-ARFLAGS = rcs
-all: libhitomezashi.a hitomezashi_cli
+ARFLAGS = rcs
-libhitomezashi.a: hitomezashi.o
- $(AR) $(ARFLAGS) libhitomezashi.a hitomezashi.o
+all:
+libhitomezashi.a: hitomezashi.o hitomezashi_utils.o
+ $(AR) $(ARFLAGS) libhitomezashi.a hitomezashi.o hitomezashi_utils.o
hitomezashi.o: lib/hitomezashi.c lib/hitomezashi.h
$(CC) -c $(CFLAGS) lib/hitomezashi.c
+hitomezashi_utils.o: lib/hitomezashi_utils.c lib/hitomezashi_utils.h
+ $(CC) -c $(CFLAGS) lib/hitomezashi_utils.c
+
hitomezashi_cli: hitomezashi_cli.o libhitomezashi.a
$(CC) $(LDFLAGS) $(LDLIBS) -o hitomezashi_cli hitomezashi_cli.o libhitomezashi.a
-
hitomezashi_cli.o: cli/hitomezashi_cli.c cli/hitomezashi_cli.h
- $(CC) -c $(CFLAGS) -o hitomezashi_cli.o cli/hitomezashi_cli.c
+ $(CC) -c $(CFLAGS) -I./lib/ -I./cli/optparse/ -o hitomezashi_cli.o cli/hitomezashi_cli.c
+
+
+hitomezashi_web.html: web/hitomezashi_web_shell.html hitomezashi_web.o libhitomezashi.a
+ $(CC) $(LDFLAGS) $(LDLIBS) -O3 --shell-file ./web/hitomezashi_web_shell.html -o hitomezashi_web.html hitomezashi_web.o libhitomezashi.a
+hitomezashi_web.o: web/hitomezashi_web.c web/hitomezashi_web.h
+ $(CC) -c $(CFLAGS) -I./lib/ web/hitomezashi_web.c
format-code:
clang-format -i --verbose **/*.c **/*.h
clean:
- rm -f *.a *.o hitomezashi_cli
+ rm -f *.a *.o *.js *.wasm *.html hitomezashi_cli