-
Notifications
You must be signed in to change notification settings - Fork 18
/
makefile
63 lines (51 loc) · 1.28 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
#
# @file makefile
# @author Ferenc Nemeth
# @date 18 Nov 2018
# @brief Makefile for Maze generation algorithms.
#
# Copyright (c) 2018 Ferenc Nemeth - https://github.com/ferenc-nemeth/
#
CXX = g++
# Every maze generation algorithm
MODULES += mazes/aldous_broder
MODULES += mazes/binary_tree
MODULES += mazes/kruskal
MODULES += mazes/prim
MODULES += mazes/recursive_backtracking
MODULES += mazes/recursive_division
# Common
MODULES += common/file_system
MODULES += common/main
MODULES += common/maze_generator
# Solver
MODULES += solver
WILDSRC = $(addsuffix /*.cpp,$(MODULES))
SOURCES = $(wildcard $(WILDSRC))
OBJECTS = $(SOURCES:.cpp=.o)
DEPENDS = $(OBJECTS:.o=.d)
INCLUDES = $(addprefix -I,$(MODULES))
CXXFLAGS = -std=c++14 -Wall -Wextra $(INCLUDES) `pkg-config --cflags opencv`
LDFLAGS = `pkg-config --libs opencv`
all: $(OBJECTS)
$(CXX) $(CXXFLAGS) -o maze_generator $^ $(LDFLAGS)
@echo "-----------"
@echo "Build done!"
@echo "-----------"
-include $(DEPENDS)
%.d: %.cpp
@$(CXX) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
.PHONY: clean
clean:
rm -f $(OBJECTS)
rm -f $(DEPENDS)
rm -f maze_generator
@echo "--------"
@echo "Cleaned!"
@echo "--------"
.PHONY: clean_output
clean_output:
rm -f output/*
@echo "--------"
@echo "Cleaned!"
@echo "--------"