forked from CS162-Group35/GroupProject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile_TA
104 lines (90 loc) · 2.04 KB
/
makefile_TA
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
###############################################################################
# Authors: Sean Patrick Akins
# Edmund Dea
# Trevor Rollins
# Nathan Villegas
# Group: 35
# Class: CS162-400
# Date: 10/27/2017
# Description: Makefile for the TIc Tac Toe group project
###############################################################################
#
# Project Name
#
PROJ = tictactoe
#
# Compiler
#
$(CXX) = g++
#
# Source Files
#
SRC = rpsMain.cpp
SRC += inputValidation.cpp
SRC += paper.cpp
SRC += rock.cpp
SRC += RPSGame.cpp
SRC += rpsMain.cpp
SRC += scissors.cpp
SRC += tool.cpp
#
# Create an object for each source file
#
OBJ = $(SRC:.cpp=.o)
#
# Output binary
#
BIN = $(PROJ).bin
#
# Compiler Flags
#
CFLAGS = -Wall -pedantic -std=c++11 -lboost_regex
#
# Valgrind Options
#
VOPT = --tool=memcheck --leak-check=full --show-leak-kinds=all --track-origins=yes
#
# Names of tags that aren't actually files. Without this, if there were ever a
# file in the directory with these names they would never run.
#
# Why? Because Make is checking to see if these files exist. If they already do
# it skips them!
#
.PHONY: default debug clean zip valgrind
#
# Default Behavior:
# 1. Remove everything to start from scratch
# 2. Compile the binary
# 3. Run it through valgrind for quicker debugging
#
default: clean $(BIN) debug
#
# Notice the dependency chain.
#
# Order assuming no files exist:
# 1. Each .o file
# 2. Binary
# 3. Valgrind
#
# Special Symbols:
# @ Suppresses the command from being printed to the terminal)
# $@ Name of tag
# $^ Name of dependency
debug: $(BIN)
@valgrind $(VOPT) ./$(BIN)
$(BIN): $(OBJ)
@echo "CC $@"
@$(CXX) $(CFLAGS) $^ -o $@
#
# % is a wildcard. Anything that ends in ".o" will match this tag, and each
# tag depends on the same matching wildcard, but ending in ".cpp"
#
%.o: %.cpp
@echo "CC $^"
@$(CXX) $(CFLAGS) -c $^
zip:
zip $(PROJ).zip *.cpp *.hpp makefile
clean: $(CLEAN)
@echo "RM *.o"
@echo "RM $(BIN)"
@rm -f *.o $(BIN)