opengl-cpp/Makefile

38 lines
697 B
Makefile
Raw Normal View History

CC=clang++
current_directory=$(shell pwd)
2025-01-11 17:48:48 +00:00
FRAMEWORKS=-framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
2025-01-11 17:48:48 +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
$(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
.PHONY: clean
2025-01-11 17:48:48 +00:00
clean:
rm -f *.o app
2025-01-11 17:48:48 +00:00
.PHONY: debugger
debugger: debug
PATH=/usr/bin /usr/bin/lldb ./app