2025-01-11 18:56:38 +00:00
|
|
|
CC=clang++
|
|
|
|
current_directory=$(shell pwd)
|
2025-01-11 17:48:48 +00:00
|
|
|
|
2025-01-11 18:56:38 +00:00
|
|
|
FRAMEWORKS=-framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
|
2025-01-11 17:48:48 +00:00
|
|
|
|
2025-01-11 18:56:38 +00:00
|
|
|
CFLAGS=-std=c++11
|
|
|
|
CFLAGS+=-I$(current_directory)
|
|
|
|
CFLAGS+=-I$(current_directory)/../external
|
|
|
|
|
|
|
|
LDFLAGS=-L$(current_directory)/../lib
|
|
|
|
LDFLAGS+=-lglfw3
|
|
|
|
LDFLAGS+=-lGLEW
|
|
|
|
|
|
|
|
SOURCES=$(wildcard *.cpp)
|
|
|
|
OBJECTS=$(patsubst %.cpp, %.o, $(SOURCES))
|
2025-01-11 17:48:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
%.o: %.cpp
|
2025-01-11 18:56:38 +00:00
|
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
|
|
|
|
default: debug
|
|
|
|
|
|
|
|
app: $(OBJECTS)
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(FRAMEWORKS) -o $@ $(OBJECTS)
|
|
|
|
|
|
|
|
# Define debug and -g enables debug symbols
|
|
|
|
debug: CFLAGS+=-DDEBUG -g
|
|
|
|
debug: app
|
|
|
|
|
|
|
|
release: app
|
2025-01-11 17:48:48 +00:00
|
|
|
|
2025-01-11 18:56:38 +00:00
|
|
|
.PHONY: clean
|
2025-01-11 17:48:48 +00:00
|
|
|
clean:
|
2025-01-11 18:56:38 +00:00
|
|
|
rm -f *.o app
|
2025-01-11 17:48:48 +00:00
|
|
|
|
2025-01-11 18:56:38 +00:00
|
|
|
.PHONY: debugger
|
|
|
|
debugger: debug
|
|
|
|
PATH=/usr/bin /usr/bin/lldb ./app
|