-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
32 lines (22 loc) · 855 Bytes
/
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
# Defines the flags for compiling with C++.
CXXFLAGS = -Wall -std=c++11 -O2
# Rule to compile everything (make all).
# Because it is the first rule, it is also the default rule (make).
all: main.exe
# Rule to clean object and executable files (make clean).
clean:
rm -f main.exe *.o
# Rule to link the executable from then object files.
#
# The following default variables are used:
# $^ is the names of all the prerequisites
# $@ is the name of the target of the rule
# $(CXX) is the name of the C++ compiler
main.exe: main.o Point.o Rectangle.o Circle.o
$(CXX) $^ -o $@
## Dependencies between files
# (we don't need to precise how to produce them, Makefile already knows)
main.o: main.cc Point.hh Rectangle.hh Circle.hh
Point.o: Point.cc Point.hh
Rectangle.o: Rectangle.cc Rectangle.hh Point.hh
Circle.o: Circle.cc Circle.hh Point.hh