update makefile
This commit is contained in:
parent
525a5a90ad
commit
31e9a41970
64
Makefile
64
Makefile
|
@ -1,33 +1,33 @@
|
||||||
# Detect OS
|
# Detect OS
|
||||||
OS := $(shell uname)
|
OS := $(shell uname)
|
||||||
|
|
||||||
GLEW_LIBS := $(shell pkgconf --libs glew)
|
GLEW_LIBS := $(shell pkgconf --libs glew)
|
||||||
GLFW_LIBS := $(shell pkgconf --libs glfw3)
|
GLFW_LIBS := $(shell pkgconf --libs glfw3)
|
||||||
|
|
||||||
# Set libraries for Linux
|
# Set libraries for Linux
|
||||||
ifeq ($(OS), Linux)
|
ifeq ($(OS), Linux)
|
||||||
OPENGL_LIB := -lGL
|
OPENGL_LIB := -lGL
|
||||||
# Set libraries for Windows (MSYS2)
|
# Set libraries for Windows (MSYS2)
|
||||||
else
|
else
|
||||||
OPENGL_LIB := -lopengl32
|
OPENGL_LIB := -lopengl32
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Source files
|
# Source files
|
||||||
SRC := src/main.c src/log.c src/shader.c
|
SRC := src/main.c src/log.c src/shader.c src/matrix-math.c
|
||||||
|
|
||||||
# Output binary
|
# Output binary
|
||||||
OUT := cg1
|
OUT := cg1
|
||||||
|
|
||||||
# Compiler
|
# Compiler
|
||||||
CC := gcc
|
CC := gcc
|
||||||
|
|
||||||
# Build target
|
# Build target
|
||||||
$(OUT): $(SRC)
|
$(OUT): $(SRC)
|
||||||
$(CC) -o $(OUT) $(SRC) $(GLEW_LIBS) $(GLFW_LIBS) $(OPENGL_LIB)
|
$(CC) -o $(OUT) $(SRC) $(GLEW_LIBS) $(GLFW_LIBS) $(OPENGL_LIB)
|
||||||
|
|
||||||
# Clean target
|
# Clean target
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OUT)
|
rm -f $(OUT)
|
||||||
|
|
||||||
# mark phony targets
|
# mark phony targets
|
||||||
.PHONY: clean
|
.PHONY: clean
|
Loading…
Reference in New Issue