-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
42 lines (31 loc) · 708 Bytes
/
makefile
File metadata and controls
42 lines (31 loc) · 708 Bytes
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
target := bin/main
SRCS = $(shell find $(SRC)/ -name "*.c")
OBJS = $(patsubst %.c, $(OBJ)/%.o, $(SRCS))
CC := gcc
CFLAGS := -Wall
# CFLAGS := -Wall -O3
LFLAGS := -lglfw -ldl -lm -lcglm -lGL -pthread
ZIPNAME := project.zip
BIN := bin
OBJ := obj
SRC := src
$(shell mkdir -p obj bin)
all: $(target)
debug: CFLAGS = -Wall -g -O0
debug: clean
debug: $(target)
vsync: CFLAGS = -Wall -DVSYNC
vsync: $(target)
$(target): $(OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS)
$(OBJ)/%.o: %.c
@mkdir -p $(dir $@) # Create the necessary directories
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -rf $(BIN)/* $(OBJ)/*
zip:
rm -f $(ZIPNAME)
zip $(ZIPNAME) $(SRC)/*
release: CFLAGS = -Wall -O3
release: $(target)
dev: all