diff options
author | iurii plugatarov <[email protected]> | 2024-08-11 00:17:42 +0200 |
---|---|---|
committer | iurii plugatarov <[email protected]> | 2024-08-11 00:17:42 +0200 |
commit | ee735611611bf7b27bccbca808e5d72da45b9937 (patch) | |
tree | cc42e64bb2e0814db9056d9147e388fe2d3bded0 /Makefile | |
parent | 90e85b2fe655a2643535b0f49d99836ac72e724c (diff) | |
download | ogl-ee735611611bf7b27bccbca808e5d72da45b9937.tar.gz |
textures
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Makefile b/Makefile index eb6a8e6..6a009dc 100644 --- a/Makefile +++ b/Makefile @@ -1,51 +1,52 @@ UNAME_S = $(shell uname -s) - CC = clang CFLAGS = -Wall -Wextra -std=c11 CFLAGS_DEBUG = $(CFLAGS) -g -O0 CFLAGS_RELEASE = $(CFLAGS) -O2 TARGET = ogl SRC_DIR = src +VENDOR_DIR = vendor OUT_DIR = out -LIBS = -lglfw -lGLEW +LIBS = -lglfw -lGLEW -lcglm DEBUG_DIR = $(OUT_DIR)/debug RELEASE_DIR = $(OUT_DIR)/release INSTALL_DIR = /usr/local/bin # Find all .c files in the src directory SRCS = $(wildcard $(SRC_DIR)/*.c) + # Generate lists of object files for debug and release builds OBJS_DEBUG = $(patsubst $(SRC_DIR)/%.c,$(DEBUG_DIR)/%.o,$(SRCS)) OBJS_RELEASE = $(patsubst $(SRC_DIR)/%.c,$(RELEASE_DIR)/%.o,$(SRCS)) +# Include paths for vendor libraries +INCLUDES = $(addprefix -I,$(VENDOR_DIR) $(wildcard $(VENDOR_DIR)/*/)) + ifeq ($(UNAME_S), Darwin) - LIBS += -framework OpenGL + LIBS += -framework OpenGL endif - - ifeq ($(UNAME_S), Linux) - LDFLAGS += -lGL + LDFLAGS += -lGL endif all: debug release debug: $(DEBUG_DIR)/$(TARGET) - release: $(RELEASE_DIR)/$(TARGET) # Debug build $(DEBUG_DIR)/$(TARGET): $(OBJS_DEBUG) | $(DEBUG_DIR) - $(CC) $(CFLAGS_DEBUG) $(LIBS) -o $@ $(OBJS_DEBUG) + $(CC) $(CFLAGS_DEBUG) $(INCLUDES) $(LIBS) -o $@ $(OBJS_DEBUG) $(DEBUG_DIR)/%.o: $(SRC_DIR)/%.c | $(DEBUG_DIR) - $(CC) $(CFLAGS_DEBUG) $(LIBS) -c $< -o $@ + $(CC) $(CFLAGS_DEBUG) $(INCLUDES) -c $< -o $@ # Release build $(RELEASE_DIR)/$(TARGET): $(OBJS_RELEASE) | $(RELEASE_DIR) - $(CC) $(CFLAGS_RELEASE) $(LIBS) -o $@ $(OBJS_RELEASE) + $(CC) $(CFLAGS_RELEASE) $(INCLUDES) $(LIBS) -o $@ $(OBJS_RELEASE) $(RELEASE_DIR)/%.o: $(SRC_DIR)/%.c | $(RELEASE_DIR) - $(CC) $(CFLAGS_RELEASE) $(LIBS) -c $< -o $@ + $(CC) $(CFLAGS_RELEASE) $(INCLUDES) -c $< -o $@ $(DEBUG_DIR) $(RELEASE_DIR): mkdir -p $@ |