-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (28 loc) · 891 Bytes
/
Makefile
File metadata and controls
36 lines (28 loc) · 891 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
# Compiler and flags
CXX = g++
CXXFLAGS = -std=c++17 -I . -w # Suppress all warnings
# Executable name
TARGET = AlienInvasion
# Source files
SRC = main.cpp \
Game/Game.cpp \
RandomGenerator/randGen.cpp \
Units/Aliens/AlienArmy.cpp Units/Aliens/AlienDrone.cpp Units/Aliens/AlienMonster.cpp Units/Aliens/AlienSoldier.cpp \
Units/Ally/AllyArmy.cpp Units/Ally/SaverUnit.cpp \
Units/Earth/EarthArmy.cpp Units/Earth/EarthGunnery.cpp Units/Earth/EarthHeal.cpp Units/Earth/EarthSoldier.cpp Units/Earth/EarthTank.cpp \
Units/Unit.cpp
# Object files
OBJ = $(SRC:.cpp=.o)
# Default rule
all: $(TARGET)
# Link executable
$(TARGET): $(OBJ)
$(CXX) $(CXXFLAGS) -o $@ $^
# Compile source files to object files
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
# Clean object files and executable
clean:
rm -f $(OBJ) $(TARGET)
# Rebuild the project
rebuild: clean all