-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
109 lines (98 loc) · 2.53 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
ODIR = obj
SDIR = src
IDIR = include
PDIR = depend
BDIR = bin
DDIR = data
_OBJS = main.o \
Application.o \
ApplicationState.o \
ApplicationStateManager.o \
AudioSystem.o \
BackgroundPhysicsComponent.o \
BackgroundRenderComponent.o \
BlackScreen.o \
BossPhysicsComponent.o \
CollisionBodyRectangle.o \
CollisionManager.o \
CreditsState.o \
EnemyCollisionComponent.o \
EnemyRenderComponent.o \
EnemyPhysicsComponent.o \
EnemyProjectileCollisionComponent.o \
EnemyProjectilePhysicsComponent.o \
EnemyProjectileRenderComponent.o \
ExplosionPhysicsComponent.o \
ExplosionRenderComponent.o \
FrameRateManager.o \
GameEntity.o \
GameEntityCollection.o \
GameEntityData.o \
GameEntityFactory.o \
GameEntityManager.o \
GameOverState.o \
GameState.o \
GameMenuState.o \
InstructionsState.o \
IntroState.o \
Level.o \
MenuState.o \
MeteorPhysicsComponent.o \
MeteorRenderComponent.o \
MovementPattern.o \
OptionsState.o \
PauseState.o \
PlayerCollisionComponent.o \
PlayerInputComponent.o \
PlayerInstructionsInputComponent.o \
PlayerInstructionsPhysicsComponent.o \
PlayerInstructionsProjectilePhysicsComponent.o \
PlayerPhysicsComponent.o \
PlayerRenderComponent.o \
PlayerProjectileCollisionComponent.o \
PlayerProjectilePhysicsComponent.o \
PlayerProjectileRenderComponent.o \
SDL_util.o \
SpriteRenderComponent.o \
StateEntityParser.o \
TextRenderComponent.o \
Texture.o \
Timer.o \
tinystr.o \
tinyxml.o \
tinyxmlerror.o \
tinyxmlparser.o \
UFOPhysicsComponent.o \
UIClickFunction.o \
UILivesRenderComponent.o \
UIPanelInputComponent.o \
UIPanelRenderComponent.o \
UIScoreRenderComponent.o \
Util.o \
Vector2D.o \
VictoryState.o
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
CC = g++
CFLAGS = -w -g -std=c++11
LFLAGS = -lSDL2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer
PROG = SpaceShooter
all: $(OBJS)
@mkdir -p $(BDIR)
$(CC) $(CFLAGS) -I$(IDIR) -I$(BDIR) -I$(DDIR) -o $(BDIR)/$(PROG) $^ $(LFLAGS)
$(ODIR)/%.o : $(SDIR)/%.cpp
@mkdir -p $(ODIR)
@mkdir -p $(PDIR)
$(CC) $(CFLAGS) -I$(IDIR) -MD -c -o $@ $<
@cp $(ODIR)/$*.d $(PDIR)/$*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(ODIR)/$*.d >> $(PDIR)/$*.P; \
rm -f $(ODIR)/$*.d
-include $(PDIR)/*.P
clean:
rm -f $(PROG) $(ODIR)/* $(PDIR)/*
#$(OBJSDIR)/Application.o: $(SRCSDIR)/Application.cpp \
# $(INCDIR)/Application.h \
# $(INCDIR)/ApplicationStateManager.h \
# $(INCDIR)/SDL_util.h \
# $(INCDIR)/WindowElements.h
# $(CC) $(CFLAGS) $(LFLAGS) $< -o $@