update makefile

This commit is contained in:
Luca Conte 2025-04-23 00:00:23 +02:00
parent 525a5a90ad
commit 31e9a41970
1 changed files with 32 additions and 32 deletions

View File

@ -1,33 +1,33 @@
# Detect OS
OS := $(shell uname)
GLEW_LIBS := $(shell pkgconf --libs glew)
GLFW_LIBS := $(shell pkgconf --libs glfw3)
# Set libraries for Linux
ifeq ($(OS), Linux)
OPENGL_LIB := -lGL
# Set libraries for Windows (MSYS2)
else
OPENGL_LIB := -lopengl32
endif
# Source files
SRC := src/main.c src/log.c src/shader.c
# Output binary
OUT := cg1
# Compiler
CC := gcc
# Build target
$(OUT): $(SRC)
$(CC) -o $(OUT) $(SRC) $(GLEW_LIBS) $(GLFW_LIBS) $(OPENGL_LIB)
# Clean target
clean:
rm -f $(OUT)
# mark phony targets
# Detect OS
OS := $(shell uname)
GLEW_LIBS := $(shell pkgconf --libs glew)
GLFW_LIBS := $(shell pkgconf --libs glfw3)
# Set libraries for Linux
ifeq ($(OS), Linux)
OPENGL_LIB := -lGL
# Set libraries for Windows (MSYS2)
else
OPENGL_LIB := -lopengl32
endif
# Source files
SRC := src/main.c src/log.c src/shader.c src/matrix-math.c
# Output binary
OUT := cg1
# Compiler
CC := gcc
# Build target
$(OUT): $(SRC)
$(CC) -o $(OUT) $(SRC) $(GLEW_LIBS) $(GLFW_LIBS) $(OPENGL_LIB)
# Clean target
clean:
rm -f $(OUT)
# mark phony targets
.PHONY: clean