Skip to content

Instantly share code, notes, and snippets.



Last active Feb 16, 2019
What would you like to do?
Naive Makefile for compiling and running single c++ source file
CXX_FLAGS := -std=c++11
$(TARGET): force-clean
g++ $(TARGET).cpp $(CXX_FLAGS) -o $(TARGET) && ./$(TARGET)
\rm -f $(TARGET)
# given source file name: 100.cpp
# just enter `make 100` to build and run it
# if you have a lot of "single c++ file", it's your good friend!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment