-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
23 lines (19 loc) · 783 Bytes
/
Makefile
File metadata and controls
23 lines (19 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
BUILD_DIR := build/
SRC_DIR := src/
CPP_FLAGS := -g -Wall
object_files := ${BUILD_DIR}load_levels.o ${BUILD_DIR}main.o ${BUILD_DIR}utils.o ${BUILD_DIR}assert_setup.o
# targets := load_levels.o main.o testing.o utils.o assert_setup.o
all: ${object_files}
@echo "Link all object files"
g++ ${CPP_FLAGS} ${object_files} -o ${BUILD_DIR}main.exe
.PHONY: all
# Compile all *.cpp files in SRC_DIR and move result to BUILD_DIR
${BUILD_DIR}%.o: ${SRC_DIR}%.cpp
g++ ${CPP_FLAGS} -c $< -o $@
test: ${BUILD_DIR}testing.o
g++ ${CPP_FLAGS} ${BUILD_DIR}testing.o ${BUILD_DIR}load_levels.o -o ${BUILD_DIR}testing.exe
clean:
@echo "cleaning project..."
cmake -E rm -f ${object_files} ${BUILD_DIR}main.exe ${BUILD_DIR}testing.o ${BUILD_DIR}testing.exe
@echo "project cleaned"
.PHONY: clean