-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (24 loc) · 732 Bytes
/
Makefile
File metadata and controls
32 lines (24 loc) · 732 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
BUILD_MODE ?= RELEASE
TARGET = final
CC = gcc
SRC = $(wildcard src/*.c)
OBJS := $(SRC:%.c=%.o)
INCLUDE_PATHS = -I"C:\mingw64\mingw64\include"
LLIB_PATHS = -L"C:\mingw64\mingw64\lib"
LLIBS = -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lglew32 -lglu32 -lcglm
CFLAGS += -Wall -std=c99 -Wno-missing-braces -Wfatal-errors -MD
ifeq ($(BUILD_MODE),RELEASE)
CFLAGS += -s -O3 -Wl,-subsystem,windows
else
CFLAGS += -g -O0
endif
$(TARGET).exe : $(OBJS)
$(info BUILDING $(BUILD_MODE)...)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(INCLUDE_PATHS) $(LLIB_PATHS) $(LLIBS)
$(OBJS): src/%.o : src/%.c
$(CC) $(CFLAGS) -c $< $(INCLUDE_PATHS) $(LLIB_PATHS) $(LLIBS) -o $@
run:
./$(TARGET)
clean:
del $(TARGET).exe src\*.o src\*.d
-include $(OBJS:.o=.d)