cleaned up a bit and got rid of some errors, still seg fualt

This commit is contained in:
MichaelFisher1997
2025-01-11 18:56:38 +00:00
parent ed1cc02d3e
commit 3e799fd434
7 changed files with 60 additions and 34 deletions

View File

@@ -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