-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
42 lines (31 loc) · 822 Bytes
/
makefile
File metadata and controls
42 lines (31 loc) · 822 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
CXX=gcc
CXXFLAGS=-Wall -O0 -g -std=c++14 -MMD -MP
SRCDIR=src
OBJDIR=build/obj
INCL=include/SDL2
LIBDIR=lib
LDFLAGS=-g
LDLIBS=-lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf
RM=rm
RMDIR=rm -r
MKDIR=mkdir
OUT=bin/main.exe
SRCS=Main/main.cpp Main/Game.cpp Main/ScaledDeltaTimer.cpp \
Scene/SceneManager.cpp \
Render/RenderManager.cpp Render/AABB.cpp Render/Camera.cpp \
Ball.cpp
OBJNAMES := $(SRCS:.cpp=.o)
OBJS := $(addprefix $(OBJDIR)/,$(OBJNAMES))
BUILD_DIRS := $(patsubst %/,%,$(sort $(dir $(OBJS))))
all : $(OUT)
.PHONY: clean all
$(OBJS): $(OBJDIR)/%.o : $(SRCDIR)/%.cpp | $(BUILD_DIRS)
$(CXX) $< -c $(CXXFLAGS) -I$(INCL) -o $@
$(OUT) : $(OBJS)
$(CXX) $^ $(LDFLAGS) -L$(LIBDIR) $(LDLIBS) -o $(OUT)
$(BUILD_DIRS):
$(MKDIR) "$@"
clean :
$(RM) "$(OUT)"
$(RMDIR) "$(OBJDIR)"
-include $(OBJS:.o=.d)