-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (43 loc) · 1.14 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
##################################################
# Makefile for Pistonics by Dugi #
# Info: #
# Default start point (main function) is #
# located int src/main.cpp. Rule for it #
# is written dedicated. All other #
# deppendencies (files) your should add #
# in TGDEPS. #
##################################################
CC = g++ -g
CFLAGS = -Werror -Wall -lSDL2 -lSDL2_ttf
SDIR = src
BDIR = build
ODIR = obj
PROG = program # this is program exec name
TGDEPS = Shape.cpp \
Rectangle.cpp \
BoundBox.cpp \
GameObject2D.cpp \
CollisionEngine.cpp \
Display.cpp \
Game.cpp \
Player.cpp \
Wall.cpp \
Enemy.cpp \
GameState.cpp \
Coin.cpp \
AIOutput.cpp \
Test.cpp \
TextRenderEngine.cpp
OBJECTS = $(patsubst %.cpp,$(ODIR)/%.o,$(TGDEPS))
$(BDIR)/$(PROG): $(OBJECTS) $(ODIR)/main.o
$(CC) $(CFLAGS) $(OBJECTS) $(ODIR)/main.o -o $@
$(OBJECTS): | $(ODIR)
$(ODIR):
@mkdir -p $@
$(ODIR)/%.o: $(SDIR)/%.cpp $(SDIR)/%.h
$(CC) -c -o $@ $<
$(ODIR)/main.o: $(SDIR)/main.cpp
$(CC) -c $(SDIR)/main.cpp -o $@
.PHONY: clean
clean:
rm -r $(ODIR)/* $(BDIR)/$(PROG)