-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (35 loc) · 1.35 KB
/
Makefile
File metadata and controls
52 lines (35 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
UNAME_S = $(shell uname -s)
SHELL = /bin/sh
GCC = gcc
CFLAGS = -std=c11 -g -Wall
CFLAGS += -Ilib/cglm/include -Ilib/glad/include -Ilib/glfw/include -Ilib/stb -Ilib/noise -Ilib/glfw/deps -Isrc -Isrc/utils -Isrc/gfx
#glfw contains glad2 so therefore to use it remove glad.o as that is the glad library, causes linker errors
#LDFLAGS += lib/cglm/build/libcglm.a lib/glfw/build/src/libglfw3.a lib/noise/libnoise.a -lm
LDFLAGS += lib/glad/src/glad.o lib/cglm/build/libcglm.a lib/glfw/build/src/libglfw3.a lib/noise/libnoise.a -lm
LDFLAGS += -lgdi32 -lopengl32
HOME = C:/Users/mater/OneDrive/Documents/3DGameInCUsingOpenGL
#lib/glad/src/glad.o lib/cglm/.libs/libcglm.a lib/glfw/src/libglfw3.a
SRC = $(wildcard src/**/*.c) $(wildcard src/*.c) $(wildcard src/**/**/*.c) $(wildcard src/**/**/**/*.c)
OBJ = $(SRC:.c=.o)
BIN = build/Win_Build
.PHONY: all clean
all: dirs libs game
libs:
echo $(SHELL); echo "YEet"
# echo $(PATH)
echo $(HOME)
cd lib/glad && $(GCC) -o src/glad.o -Iinclude -c src/glad.c
cd lib/glfw && cmake -S . -B build && cd build && mingw32-make
cd lib/noise && mingw32-make
cd lib/cglm && cmake -S . -B build -DCGLM_STATIC=ON && cd build && mingw32-make
dirs:
mkdir -p ./$(BIN)
run: all
$(BIN)/game
game: $(OBJ)
# echo "SECOND YEET"
$(GCC) -o $(BIN)/game $^ $(LDFLAGS)
%.o: %.c
$(GCC) -o $@ -c $< $(CFLAGS)
clean:
rm -rf $(BIN) $(OBJ)