diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile b/Makefile index 5e8d103..eb6a8e6 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +UNAME_S = $(shell uname -s) + CC = clang CFLAGS = -Wall -Wextra -std=c11 CFLAGS_DEBUG = $(CFLAGS) -g -O0 @@ -5,7 +7,7 @@ CFLAGS_RELEASE = $(CFLAGS) -O2 TARGET = ogl SRC_DIR = src OUT_DIR = out -LIBS = -lglfw -lGLEW -lGL +LIBS = -lglfw -lGLEW DEBUG_DIR = $(OUT_DIR)/debug RELEASE_DIR = $(OUT_DIR)/release INSTALL_DIR = /usr/local/bin @@ -16,6 +18,15 @@ SRCS = $(wildcard $(SRC_DIR)/*.c) OBJS_DEBUG = $(patsubst $(SRC_DIR)/%.c,$(DEBUG_DIR)/%.o,$(SRCS)) OBJS_RELEASE = $(patsubst $(SRC_DIR)/%.c,$(RELEASE_DIR)/%.o,$(SRCS)) +ifeq ($(UNAME_S), Darwin) + LIBS += -framework OpenGL +endif + + +ifeq ($(UNAME_S), Linux) + LDFLAGS += -lGL +endif + all: debug release debug: $(DEBUG_DIR)/$(TARGET) |