Ticket #58366: Makefile.patch
File Makefile.patch, 1.9 KB (added by jmroot (Joshua Root), 6 years ago) |
---|
-
Makefile
old new 1 1 # Taken from https://spin.atomicobject.com/2016/08/26/makefile-c-projects/ 2 2 3 CC = clang4 CXX = clang++3 CC ?= clang 4 CXX ?= clang++ 5 5 6 6 BUILD_DIR ?= build 7 7 SRC_DIRS ?= $(shell find src -type d -not -path src) vendor/glad vendor/nanovg vendor/nanogui … … 10 10 SRCS := $(shell find $(SRC_DIRS) -maxdepth 1 -name '*.cpp' -or -name '*.c') 11 11 12 12 INCFLAGS := $(addprefix -I, $(SRC_DIRS)) -Ivendor 13 CPPFLAGS ?= $(INCFLAGS) -MMD -MP -g -Wno-multichar -DNANOGUI_GLAD14 CXXFLAGS ?= -std=c++1y13 CPPFLAGS := $(INCFLAGS) $(CPPFLAGS) -MMD -MP -g -Wno-multichar -DNANOGUI_GLAD 14 CXXFLAGS += -std=c++1y 15 15 16 16 ifeq ($(UNAME), Darwin) 17 SDL_FRAMEWORK_DIR ?= /Library/Frameworks 18 ifneq ($(PKG_CONFIG),) 19 CPPFLAGS += `$(PKG_CONFIG) --cflags SDL2` `$(PKG_CONFIG) --cflags SDL2_net` 20 LDFLAGS += `$(PKG_CONFIG) --libs SDL2` `$(PKG_CONFIG) --libs SDL2_net` 21 else ifneq ($(SDL_FRAMEWORK_DIR),) 22 CPPFLAGS += -DSDL_FRAMEWORK=1 -F$(SDL_FRAMEWORK_DIR) 23 LDFLAGS += -F$(SDL_FRAMEWORK_DIR) -framework SDL2 -framework SDL2_net 24 else 25 # Assume CPPFLAGS and LDFLAGS are set up with the right -I and -L flags 26 LDFLAGS += -lSDL2 -lSDL2_net 27 endif 17 28 SRCS += $(shell find $(SRC_DIRS) -maxdepth 1 -name '*.mm') 18 CPPFLAGS += -F/Library/Frameworks 19 LDFLAGS ?= -F/Library/Frameworks -lstdc++ -lm -framework SDL2 -framework SDL2_net -framework OpenGL -framework AppKit 29 LDFLAGS += -lm -framework OpenGL -framework AppKit 20 30 POST_PROCESS ?= dsymutil 21 31 else ifeq ($(UNAME), MINGW64_NT-10.0) 22 32 # Not a great conditional check for "Windows", but works for now. … … 65 75 66 76 # Avara 67 77 $(BUILD_DIR)/Avara: $(OBJS) $(BUILD_DIR)/src/Avara.cpp.o 68 $(CXX) $( OBJS) $(BUILD_DIR)/src/Avara.cpp.o -o $@ $(LDFLAGS)78 $(CXX) $(CXXFLAGS) $(OBJS) $(BUILD_DIR)/src/Avara.cpp.o -o $@ $(LDFLAGS) 69 79 $(POST_PROCESS) $@ 70 80 71 81 # BSPViewer