-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (25 loc) · 851 Bytes
/
Makefile
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
# Specify the paths to your include directories
INCLUDE_PATH = -Iinclude/GL -Iinclude/GLFW
# Specify the paths to your library directories
LIBRARY_PATH = -Linclude/lib
# Compiler flags
CFLAGS = $(INCLUDE_PATH) -std=c99
# Linker flags
LDFLAGS = $(LIBRARY_PATH) -lopengl32 -lfreeglut -lglfw3
# Specify the target executable
TARGET = build/main
# Specify the object files
OBJECTS = build/main.o build/unspritable.o
# Default target
all: $(TARGET)
$(TARGET): $(OBJECTS)
gcc $(OBJECTS) $(CFLAGS) $(LDFLAGS) -o $(TARGET)
# Here we define the individual object files and their dependencies
build/main.o: main.c
gcc -c main.c $(CFLAGS) -o build/main.o
build/unspritable.o: unspritable.c unspritable.h
gcc -c unspritable.c $(CFLAGS) -o build/unspritable.o
# Add a clean target for convenience
clean:
rm -f build/*.o $(TARGET)
.PHONY: all clean