Fixed Makefile for linux

main
noah metz 2024-10-21 15:52:16 -06:00
parent ec7e5cbfdf
commit b19240899a
1 changed files with 3 additions and 2 deletions

@ -1,5 +1,5 @@
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
CFLAGS = -I $(ROOT_DIR)/include -I/usr/local/include -O0 -g -Wall -Wextra -fsanitize=address CFLAGS = -I $(ROOT_DIR)/include -I/usr/local/include -O0 -g -Wall -Wextra
LDFLAGS = -lfreetype -lz -lglfw -lvulkan -ldl -Xlinker -rpath -Xlinker /opt/homebrew/lib LDFLAGS = -lfreetype -lz -lglfw -lvulkan -ldl -Xlinker -rpath -Xlinker /opt/homebrew/lib
SOURCES = src/main.c src/draw.c src/ui.c src/gpu.c lib/spng.c lib/vma.cpp SOURCES = src/main.c src/draw.c src/ui.c src/gpu.c lib/spng.c lib/vma.cpp
@ -13,6 +13,7 @@ EXTRA_DEBUG_REQUIREMENTS :=
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux) ifeq ($(UNAME_S),Linux)
GDB = gdb GDB = gdb
CFLAGS += -I /usr/include/freetype2
endif endif
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
export MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=1 export MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=1
@ -32,7 +33,7 @@ roleplay: $(OBJECTS)
$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $^
%.o: %.cpp %.o: %.cpp
$(CXX) $(CFLAGS) -std=c++14 -Wno-nullability-completeness -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-private-field -Wno-unused-variable -c -o $@ $< $(CXX) $(CFLAGS) -std=c++17 -Wno-nullability-completeness -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-private-field -Wno-unused-variable -c -o $@ $<
%.o: %.c %.o: %.c
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<