Last active
August 19, 2016 03:03
-
-
Save syncsynchalt/28efd2b00f805dbdd75199ac8ac6e10f to your computer and use it in GitHub Desktop.
Your makefile should be this simple
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
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