Skip to content

Instantly share code, notes, and snippets.

@rightson rightson/Makefile

Last active Feb 16, 2019
Embed
What would you like to do?
Naive Makefile for compiling and running single c++ source file
TARGET := $(MAKECMDGOALS)
CXX_FLAGS := -std=c++11
$(TARGET): force-clean
g++ $(TARGET).cpp $(CXX_FLAGS) -o $(TARGET) && ./$(TARGET)
force-clean:
\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
You can’t perform that action at this time.