Last active
August 29, 2015 14:15
-
-
Save cdrini/d1b6bce4a7bef8feafd5 to your computer and use it in GitHub Desktop.
General C++ Makefile (based on CS246 teachings)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CXX = g++ | |
CXXFLAGS = -std=c++11 -Wall -MMD -g | |
#Wall: Shows all warnings | |
#MMD: Creates dependency files | |
#g: Necessary when using gdb for debugging | |
OBJECTS = main.o | |
DEPENDS = ${OBJECTS:.o=.d} | |
EXEC = exec | |
${EXEC}: ${OBJECTS} | |
${CXX} ${CXXFLAGS} ${OBJECTS} -o ${EXEC} | |
-include ${DEPENDS} | |
.PHONY: clean | |
clean: | |
rm ${OBJECTS} ${DEPENDS} ${EXEC} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment