-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (48 loc) · 2.13 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
#########################################################
# PROJECT 1: MetroSim Makefile #
#########################################################
CXX = clang++
CXXFLAGS = -g3 -Wall -Wextra -Wpedantic -Wshadow
LDFLAGS = -g3
# ***TODO***
# Metrosim rule - you need to fill in the linking command,
# add any new dependencies, and add target rules for
# Passenger.o, MetroSim.o, main.o, and any new dependencies.
# Please use the rules provided below for PassengerQueue.o as an example for
# what to do.
# If you add other classes, you'll have to add their .o files as dependencies here.
# Don't forget: the clang++ command must be indented with a TAB character
# and be all on one line.
MetroSim: main.o MetroSim.o PassengerQueue.o Passenger.o
$(CXX) $(CXXFLAGS) -o MetroSim main.o MetroSim.o PassengerQueue.o Passenger.o
# ***TODO***
# Write rules for any other .o files.
# You can base them on the PassengerQueue.o rule.
# Every .cpp file that is part of your program should have a .o rule.
main.o: main.cpp MetroSim.h
$(CXX) $(CXXFLAGS) -c main.cpp
MetroSim.o: MetroSim.cpp MetroSim.h PassengerQueue.h Passenger.h
$(CXX) $(CXXFLAGS) -c MetroSim.cpp
# This rule builds PassengerQueue.o
PassengerQueue.o: PassengerQueue.cpp PassengerQueue.h Passenger.h
$(CXX) $(CXXFLAGS) -c PassengerQueue.cpp
Passenger.o: Passenger.cpp Passenger.h
$(CXX) $(CXXFLAGS) -c Passenger.cpp
# ***TODO***
# The below rule will be used by unit_test.
# Please add any other .o files that are needed by PassengerQueue,
# and any other .o files you wish to test.
unit_test: unit_test_driver.o PassengerQueue.o Passenger.o
$(CXX) $(CXXFLAGS) $^
# This rule provides your final submission
# NOTE: Don't forget to add any additional files you want to submit to this
# rule! If you do not add them, they will not be submitted.
provide:
provide comp15 proj1_MetroSim PassengerQueue.h \
PassengerQueue.cpp \
Passenger.h Passenger.cpp \
unit_tests.h Makefile README
# remove executables, object code, and temporary files from the current folder
# -- the executable created by unit_test is called a.out
clean:
rm *.o *~ a.out