mirror of
https://github.com/MichaelFisher1997/opengl-cpp.git
synced 2025-10-18 12:17:45 +00:00
cleaned up a bit and got rid of some errors, still seg fualt
This commit is contained in:
43
Makefile
43
Makefile
@@ -1,21 +1,38 @@
|
||||
CC = g++
|
||||
CFLAGS = -Iinclude -Wall -g
|
||||
LDFLAGS = -lSDL2 -lGL -lGLEW
|
||||
CC=clang++
|
||||
current_directory=$(shell pwd)
|
||||
|
||||
SRC = src/main.cpp src/sdl.cpp
|
||||
OBJ = $(SRC:.cpp=.o)
|
||||
EXEC = opengl-app
|
||||
FRAMEWORKS=-framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
|
||||
|
||||
all: $(EXEC)
|
||||
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))
|
||||
|
||||
$(EXEC): $(OBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
$(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
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(OBJ) $(EXEC)
|
||||
rm -f *.o app
|
||||
|
||||
run: all
|
||||
./$(EXEC)
|
||||
.PHONY: debugger
|
||||
debugger: debug
|
||||
PATH=/usr/bin /usr/bin/lldb ./app
|
||||
Reference in New Issue
Block a user