-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
133 lines (115 loc) · 3.96 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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
##****************************************************************************
## Program Name: makefile
## Author: Ren Demeis-Ortiz
## Description: Makefile that builds, cleans, debugs, and zips project files.
## Credit: Code used from CS162 Module one makefile lecture unless otherwise
## noted.
## Source: https://oregonstate.instructure.com/courses/1738874/files/76040054
##****************************************************************************
#----------#
# Complier #
#----------#
CXX = g++
#------------------------------------------------#
# CXX Flags #
# Credit: Harlan James #
# Source: https://oregonstate.instructure.com/ #
# courses/1738874/files/76040124/download?wrap=1 #
#------------------------------------------------#
CFLAGS = -std=gnu++11 -pedantic -Wall
#----------------------#
# Executable File Name #
#----------------------#
PROJ = chaos
#-------------#
# Main File #
#-------------#
MAIN = chaosMain.cpp
#---------------#
# Source Files #
#---------------#
SRCS = Menu.cpp
SRCS += Game.cpp
SRCS += Animal.cpp
SRCS += Dog.cpp
SRCS += Cat.cpp
SRCS += Space.cpp
SRCS += UseSpace.cpp
SRCS += OpenSpace.cpp
SRCS += BreakSpace.cpp
#---------------#
# Header Files #
#---------------#
HDRS = Menu.hpp
HDRS += Game.hpp
HDRS += Animal.hpp
HDRS += Dog.hpp
HDRS += Cat.hpp
HDRS += Space.hpp
HDRS += UseSpace.hpp
HDRS += OpenSpace.hpp
HDRS += BreakSpace.hpp
#------------------------------------#
# Additional Files to Include in Zip #
#------------------------------------#
ADD = makefile
ADD += Final_Project_Demeis-Ortiz_Reflection.pdf
ADD += Foyer
ADD += Living_and_Dining_Room
ADD += Kitchen
ADD += Bathroom
ADD += Bedroom
ADD += Garden
ADD += Instructions
#------------------#
# Name of Zip File #
#------------------#
ZNAME = Final_Project_Demeis-Ortiz_Lauren.zip
#------------------------------------------------#
# Valgrind Options #
# Credit: Harlan James #
# Source: https://oregonstate.instructure.com/ #
# courses/1738874/files/76040124/download?wrap=1 #
#------------------------------------------------#
VALOPT = --tool=memcheck --leak-check=full --show-leak-kinds=all --track-origins=yes
#------------------------------------------------#
# Object Files #
# Credit: Harlan James #
# Source: https://oregonstate.instructure.com/ #
# courses/1738874/files/76040124/download?wrap=1 #
#------------------------------------------------#
OBJS = $(SRCS:.cpp=.o)
#------------------------------------------------#
# Compile Object Files #
# Credit: Harlan James #
# Source: https://oregonstate.instructure.com/ #
# courses/1738874/files/76040124/download?wrap=1 #
#------------------------------------------------#
%.o: %.cpp %.hpp
${CXX} ${CFLAGS} -c $(@:.o=.cpp)
#-------------------#
# Link Object Files #
#-------------------#
${PROJ}: ${OBJS} ${HDRS} ${MAIN}
${CXX} ${CFLAGS} ${MAIN} ${OBJS} -lncurses -o ${PROJ}
#------------------------------------------------#
# Debug #
# Credit: Harlan James #
# Source: https://oregonstate.instructure.com/ #
# courses/1738874/files/76040124/download?wrap=1 #
#------------------------------------------------#
.PHONY: clean debug zip
debug:
valgrind ${VALOPT} ./${PROJ}
#------------------------------------------------------#
# Remove Object Files and Executable #
# Credit: Code used from https://ftp.gnu.org/ #
# old-gnu/Manuals/make-3.79.1/html_chapter/make_2.html #
#------------------------------------------------------#
clean:
-rm ${OBJS} ${PROJ}
#------------------------------------------------------#
# Zip Project Files #
#------------------------------------------------------#
zip:
zip -D ${ZNAME} ${SRCS} ${MAIN} ${HDRS} ${ADD}