Skip to content

Instantly share code, notes, and snippets.

@syncsynchalt
Last active August 19, 2016 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syncsynchalt/28efd2b00f805dbdd75199ac8ac6e10f to your computer and use it in GitHub Desktop.
Save syncsynchalt/28efd2b00f805dbdd75199ac8ac6e10f to your computer and use it in GitHub Desktop.
Your makefile should be this simple
SOURCE=$(wildcard *.cpp)
OBJS=$(patsubst %.cpp,%.o,$(SOURCE))
all: yourbin
.cpp.o:
$(CXX) $(CXXFLAGS) -o $@ $<
yourbin:
$(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS)
clean:
rm -rf *.o
rm -f yourbin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment