update makefile
This commit is contained in:
parent
525a5a90ad
commit
31e9a41970
64
Makefile
64
Makefile
|
@ -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
|
Loading…
Reference in New Issue