Created
January 4, 2017 14:27
-
-
Save harry830622/56f2e4faab7147703f7c7cecd45d1f78 to your computer and use it in GitHub Desktop.
Makefile template
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
EXE = mp | |
CXX = clang++ | |
CXXFLAGS = -std=c++11 -O2 -Wall | |
CPPS := $(wildcard src/*.cpp) | |
OBJS := $(addprefix obj/,$(notdir $(CPPS:.cpp=.o))) | |
.PHONY: all clean | |
all: obj $(EXE) | |
obj: | |
mkdir $@ | |
$(EXE): $(OBJS) | |
$(CXX) $(CXXFLAGS) -o $@ $^ | |
obj/%.o: src/%.cpp | |
$(CXX) $(CXXFLAGS) -o $@ -c $^ | |
clean: | |
rm $(EXE) $(OBJS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment