Skip to content
Snippets Groups Projects
Commit 160d9ae4 authored by Marcus M. Darden's avatar Marcus M. Darden
Browse files

Clarify the common targets and their actions.

Slightly edited these targets (release, debug, all) for consistency.
Also picked some nits in comments and 'make help'.
parent 3a868c3c
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,7 @@ PROJECTFILE = $(or $(wildcard project*.cpp), nomain.cpp) ...@@ -48,7 +48,7 @@ PROJECTFILE = $(or $(wildcard project*.cpp), nomain.cpp)
# If main() is in another file delete the line above, edit and uncomment below # If main() is in another file delete the line above, edit and uncomment below
#PROJECTFILE = mymainfile.cpp #PROJECTFILE = mymainfile.cpp
# name of the tar ball created for submission # name of the tarball created for submission
PARTIAL_SUBMITFILE = partialsubmit.tar.gz PARTIAL_SUBMITFILE = partialsubmit.tar.gz
FULL_SUBMITFILE = fullsubmit.tar.gz FULL_SUBMITFILE = fullsubmit.tar.gz
...@@ -61,13 +61,13 @@ CXXFLAGS = -std=c++1z -Wconversion -Wall -Werror -Wextra -pedantic ...@@ -61,13 +61,13 @@ CXXFLAGS = -std=c++1z -Wconversion -Wall -Werror -Wextra -pedantic
# make release - will compile "all" with $(CXXFLAGS) and the -O3 flag # make release - will compile "all" with $(CXXFLAGS) and the -O3 flag
# also defines NDEBUG so that asserts will not check # also defines NDEBUG so that asserts will not check
release: CXXFLAGS += -O3 -DNDEBUG release: CXXFLAGS += -O3 -DNDEBUG
release: all release: $(EXECUTABLE)
# make debug - will compile "all" with $(CXXFLAGS) and the -g flag # make debug - will compile "all" with $(CXXFLAGS) and the -g flag
# also defines DEBUG so that "#ifdef DEBUG /*...*/ #endif" works # also defines DEBUG so that "#ifdef DEBUG /*...*/ #endif" works
debug: EXECUTABLE := $(DEBUG) debug: EXECUTABLE := $(DEBUG)
debug: CXXFLAGS += -g3 -DDEBUG debug: CXXFLAGS += -g3 -DDEBUG
debug: clean all debug: clean $(EXECUTABLE)
# make profile - will compile "all" with $(CXXFLAGS) and the -pg flag # make profile - will compile "all" with $(CXXFLAGS) and the -pg flag
profile: CXXFLAGS += -pg profile: CXXFLAGS += -pg
...@@ -78,8 +78,10 @@ profile: clean all ...@@ -78,8 +78,10 @@ profile: clean all
static: static:
cppcheck --enable=all --suppress=missingIncludeSystem $(SOURCES) *.h *.hpp cppcheck --enable=all --suppress=missingIncludeSystem $(SOURCES) *.h *.hpp
# highest target; sews together all objects into executable # Build both release and debug executables
all: $(EXECUTABLE) all: clean
make -Rr release
make debug
$(EXECUTABLE): $(OBJECTS) $(EXECUTABLE): $(OBJECTS)
ifeq ($(EXECUTABLE), executable) ifeq ($(EXECUTABLE), executable)
...@@ -167,8 +169,8 @@ EECS281 Advanced Makefile Help ...@@ -167,8 +169,8 @@ EECS281 Advanced Makefile Help
$$ make test3 $$ make test3
$$ make alltests (this builds all test drivers) $$ make alltests (this builds all test drivers)
C) If test drivers need special dependencies, they must be added manually. C) If test drivers need special dependencies, they must be added manually.
D) IMPORTANT: NO SOURCE FILES THAT BEGIN WITH test WILL BE ADDED TO ANY D) IMPORTANT: NO SOURCE FILES WITH NAMES THAT BEGIN WITH test WILL BE
SUBMISSION TARBALLS. ADDED TO ANY SUBMISSION TARBALLS.
* Static Analysis support * Static Analysis support
A) Matches current autograder style grading tests A) Matches current autograder style grading tests
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment