2023-11-30 23:36:23 +00:00
|
|
|
CC=g++
|
2023-12-03 10:55:15 +00:00
|
|
|
CFLAGS=-std=c++20 `pkg-config --cflags glfw3 glew glm`
|
|
|
|
LDFLAGS=`pkg-config --libs glfw3 glew glm`
|
2023-11-30 23:36:23 +00:00
|
|
|
INCLUDE=/usr/include/stb/
|
|
|
|
TARGET=opengl
|
|
|
|
SDIR=src
|
|
|
|
ADIR=assets
|
|
|
|
ODIR=build
|
|
|
|
|
|
|
|
SRC=$(shell find $(SDIR) -type f -name *.cpp)
|
|
|
|
OBJ=$(SRC:.cpp=.o)
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
.PHONY: default
|
|
|
|
$(TARGET): $(OBJ)
|
|
|
|
mkdir -p build
|
|
|
|
cp -rf $(ADIR) $(ODIR)/$(ADIR)
|
|
|
|
$(CC) -o $(ODIR)/$@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
run:
|
|
|
|
$(ODIR)/$(TARGET)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f $(ODIR)/$(TARGET) $(OBJ)
|