-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (29 loc) · 1.22 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
# A simple Makefile for SDL projects
# set the compiler
CC = g++
# set the compiler flags
CFLAGS = `sdl2-config --libs --cflags` -ggdb3 -O0 -Wall -lSDL2_image -lSDL2_ttf -lm -v -std=c++14
# add header files here
HDRS = Includes/GameEngine.h Includes/CONSTANTS.h Includes/SDL2_Files.h Includes/Astronaut.h Includes/Asteroid.h Includes/Background.h Includes/Particle.h Includes/TextManager.h Includes/Rocket.h Includes/StartScreen.h Includes/EndScreen.h
# add source files here
SRCS = src/main.cpp src/GameEngine.cpp src/Astronaut.cpp src/Asteroid.cpp src/Background.cpp src/Particle.cpp src/TextManager.cpp src/Rocket.cpp src/StartScreen.cpp src/EndScreen.cpp
# generate names of object files
OBJS = $(SRCS:.cpp=.o)
# name of executable
EXEC = Moontian_Escape_from_the_Planet
# default recipe
all: $(EXEC)
#showfont: showfont.c Makefile
# $(CC) -o $@ [email protected] $(CFLAGS) $(LIBS)
#glfont: glfont.c Makefile
# $(CC) -o $@ [email protected] $(CFLAGS) $(LIBS)
# recipe for building the final executable
$(EXEC): $(OBJS) $(HDRS) Makefile
$(CC) -o $@ $(OBJS) $(CFLAGS)
# recipe for building object files
$(OBJS): $(@:.o=.cpp) $(HDRS) Makefile
$(CC) -o $@ $(@:.o=.cpp) -c $(CFLAGS)
# recipe to clean the workspace
clean:
rm -f $(EXEC)
rm -f $(OBJS)