-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
63 lines (42 loc) · 1.73 KB
/
makefile
File metadata and controls
63 lines (42 loc) · 1.73 KB
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
# VARIABLES
CFLAGS = -Wall -W -O -std=c++11
# EVERY PART INSERTED HERE WILL BE EXECUTED IN EXACT THIS ORDER
TARGETS = main visualize testPerformance testAStar clean
all: $(TARGETS)
$(info make: $(TARGETS) )
# EXECUTABLES (GETTING LINKED)
main: main.o
g++ $(CFLAGS) -o pathfinder main.o class_node.o class_map.o class_asNode.o class_AStar.o
testAStar: testAStar.o
g++ $(CFLAGS) -o testAStar testAStar.o class_node.o class_asNode.o class_map.o class_AStar.o
visualize: visualize.o
g++ $(CFLAGS) -o visualize visualize.o class_AStar.o class_node.o class_map.o class_asNode.o
testPerformance: testPerformance.o
g++ $(CFLAGS) -o testPerformance testPerformance.o class_AStar.o class_node.o class_map.o class_asNode.o
###### classes
class_node.o: class_node.cpp class_node.h
g++ $(CFLAGS) -c class_node.cpp
class_map.o: class_node.h class_map.cpp
g++ $(CFLAGS) -c class_map.cpp
class_asNode.o: class_node.h class_asNode.cpp class_asNode.h
g++ $(CFLAGS) -c class_asNode.cpp
class_AStar.o: class_node.h class_map.h class_asNode.h
g++ $(CFLAGS) -c class_AStar.cpp
CLASSES = class_node.o class_map.o class_asNode.o class_AStar.o
ALGORITHMS = uniformCost.cpp breadthfirst.cpp greedyBestFirst.cpp
##### files to link
testAStar.o: testAStar.cpp $(CLASSES)
g++ $(CFLAGS) -c testAStar.cpp
main.o: main.cpp $(CLASSES) $(ALGORITHMS)
g++ $(CFLAGS) -c main.cpp
visualize.o: visualize.cpp $(CLASSES) $(ALGORITHMS)
g++ $(CFLAGS) -c visualize.cpp
testPerformance.o: testPerformance.cpp $(CLASSES) $(ALGORITHMS)
g++ $(CFLAGS) -c testPerformance.cpp
# CLEAR REPOSITORY AFTER MAKE
# 'rm -f' (=force) -> no error if no matching file is found
# '-' -> makefile does not break after error occurs
clean:
-rm -f core *.o
-rm -f *~
-rm -f *.gch