Skip to content

Instantly share code, notes, and snippets.

@xiaohan2012
Created September 5, 2017 13:33
Show Gist options
  • Save xiaohan2012/d26dfb7503d2e9425b413667639be45b to your computer and use it in GitHub Desktop.
Save xiaohan2012/d26dfb7503d2e9425b413667639be45b to your computer and use it in GitHub Desktop.
makefile for cpp
CXX=g++
CPPFLAGS=-std=c++11 -O2 -Wall
ODIR=obj
DEPS=-I boost
%: $(ODIR)/%.o
$(CXX) -o $@ $^ $(CPPFLAGS)
$(ODIR)/%.o: %.cpp $(DEPS)
$(CXX) -c -o $@ $< $(CPPFLAGS)
.PHONY: clean
clean:
rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment