Created
February 23, 2012 13:08
-
-
Save youtalk/1892719 to your computer and use it in GitHub Desktop.
Makefiles for compiling c++
This file contains hidden or 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
TARGET = name | |
CXXFLAGS = -O2 -g -Wall | |
LIBS = -lboost_thread -lboost_filesystem ¥ | |
-I/usr/include/octave-`octave-config -v` ¥ | |
-L/usr/lib/octave-`octave-config -v` -loctave -lcruft ¥ | |
-I/usr/local/include -L/usr/local/lib -lode -ldrawstuff -lglut -l3ds | |
SRCS = $(shell ls *.cpp) | |
OBJS = $(SRCS:.cpp=.o) | |
HEADS = $(shell ls *.hpp) | |
$(TARGET): $(OBJS) $(HEADS) | |
$(CXX) -o $(TARGET) $(OBJS) $(LIBS) | |
all: $(TARGET) | |
run: all | |
./$(TARGET) | |
depend: | |
$(CXX) -MM -MG $(SRCS) > Makefile.depend | |
cat Makefile.depend | |
clean: | |
rm -f $(OBJS) $(TARGET) *~ ¥#*¥# | |
-include Makefile.depend |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment