Last active
January 1, 2016 22:49
-
-
Save samstewart/8212348 to your computer and use it in GitHub Desktop.
Template for CPP makefiles (correction to http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/)
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
| # g++ -mmacosx-version-min=10.8 -o bin/kepler kepler.cpp image_compare.cpp s3_conn.cpp report_parser.cpp `GraphicsMagick++-config --cppflags --cxxflags --ldflags --libs` -L 'reference source/jsoncpp-src-0.5.0/libs/linux-gcc-4.2.1' -ljson -I 'reference source/jsoncpp-src-0.5.0/include/json' -L 'reference source/libs3-2.0/build/lib' -I 'reference source/libs3-2.0/inc' -I include -lcurl -lxml2 -lz -ls3 | |
| GMLINKER=`GraphicsMagick++-config --cppflags --cxxflags --ldflags --libs` | |
| IDIR = include | |
| CC = g++ | |
| CFLAGS =-I$(IDIR) -mmacosx-version-min=10.8 -Wall -I/usr/local/include/GraphicsMagick -g | |
| ODIR = bin | |
| LDIR =../lib | |
| # a number of these libraries are required by GraphicsMagick | |
| LIBS = -lm -lcurl -lxml2 -lz -ls3 -lGraphicsMagick++ -lGraphicsMagick -lbz2 -lz -lltdl -ljson_linux-gcc-4.2.1_libmt | |
| _DEPS = kepler.h image_compare.h s3_conn.h report_parser.h | |
| DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS)) | |
| _OBJ = kepler.o image_compare.o s3_conn.o report_parser.o | |
| OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ)) | |
| $(ODIR)/%.o: %.cpp $(DEPS) | |
| $(CC) -c -o $@ $< $(CFLAGS) | |
| kepler: $(OBJ) | |
| $(CC) -o $@ $^ $(CFLAGS) $(LIBS) | |
| install: kepler | |
| echo "Built kepler" | |
| .PHONY: clean | |
| clean: | |
| rm -f $(ODIR)/*.o kepler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment