commit 934a7f4ce8a98cdfe3e988ba1ff77e3d969f500d parent 5aaec6dc22b175a81b37507158676f22ba1062d5 Author: William Casarin <jb55@jb55.com> Date: Sat, 24 Jul 2021 11:25:10 -0700 cleanup cflags a bit Diffstat:
M | Makefile | | | 8 | +++++--- |
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile @@ -7,7 +7,7 @@ DEFS= -DGLFW_INCLUDE_NONE -DDEBUG # CFLAGS = $(DEFS) -ggdb -O0 -I src -Wall -Wextra -std=c99 \ -CFLAGS = $(DEFS) -O1 -g -I src -Wall -Werror -Wextra -std=c99 \ +BASE_CFLAGS = $(DEFS) -O1 -g -I src -Wall -Werror -Wextra -std=c99 \ -Wno-unused-function \ -Wno-unused-parameter \ -Wno-unused-variable \ @@ -15,7 +15,9 @@ CFLAGS = $(DEFS) -O1 -g -I src -Wall -Werror -Wextra -std=c99 \ -Wno-cast-align \ -Wno-padded -EMSCRIPTEN=-I$(shell nix-instantiate --eval --expr 'with import <nixpkgs> {}; "${'"$1"'}"' | sed 's/"//g') +CFLAGS = $(pkg-config --cflags sdl2 gl) $(BASE_CFLAGS) +EM_CFLAGS = -I$(shell nix-instantiate --eval --expr 'with import <nixpkgs> {}; "${'"$1"'}"' | sed 's/"//g')/share/emscripten/system/include $(BASE_CFLAGS) + LDFLAGS = -lSDL2 -lGL -lm SRC=src @@ -71,7 +73,7 @@ $(BIN): main.o $(OBJS) @$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ $(BIN).wasm: main.c $(SRCS) - emcc -I$(EMSCRIPTEN)/share/emscripten/system/include $(CFLAGS) $^ -s WASM=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -o $@ + emcc $(EM_CFLAGS) $^ -s WASM=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -o $@ install: $(BIN) install -d $(PREFIX)/bin