1BOOST_PYTHON_LIB = -L/usr/local/boost_1_29_0/lib -lboost_python 2BOOST_INCLUDES = -I/usr/local/boost_1_29_0/src 3dynmoddir = `pwd`/local 4 5CXX = g++ 6CXXFLAGS := -O2 -Wall 7CPPFLAGS := -I/usr/include/python2.2 8 9LIBTOOL = $(SHELL) ./libtool 10LIBCXX = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) 11LINKCXX = $(LIBTOOL) --tag=CXX --mode=link $(CXX) 12LINKCXXLIB = $(LINKCXX) -rpath $(dynmoddir) 13LINKCXXMODULE = $(LINKCXXLIB) -module -avoid-version 14LIBINSTALL = $(LIBTOOL) --mode=install /bin/install -c -p 15INSTALL = /bin/install -c -p 16 17TARGET = exif.la 18 19OBJS = \ 20 exif_module.lo 21 22all: $(TARGET) 23 24install: $(TARGET) 25 $(INSTALL) -d $(dynmoddir) 26 $(LIBINSTALL) $(TARGET) $(dynmoddir) 27 28$(TARGET): $(OBJS) 29 $(LINKCXXMODULE) -o $(TARGET) $(OBJS) $(BOOST_PYTHON_LIB) -lexif 30 31clean:: 32 rm -rf .libs *.o *.so *.lo *.ld $(TARGET) 33 34%.o: %.cxx 35 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $*.cxx 36 37%.lo: %.cxx 38 $(LIBCXX) $(CXXFLAGS) $(CPPFLAGS) -c $*.cxx 39 40%.d: %.cxx 41 @echo updating header dependencies for $*.cxx 42 @rm -f $*.d 43 @$(CXX) -M $(CXXFLAGS) $(CPPFLAGS) -c $*.cxx | sed "s@$*.o@$*.d $*.o@" > $*.d \ 44 || { rm -f $*.d; exit 1; } 45 46%.ld: %.cxx 47 @echo updating header dependencies for $*.cxx 48 @rm -f $*.ld 49 @$(CXX) -M $(CXXFLAGS) $(CPPFLAGS) -c $*.cxx | sed "s@$*.o@$*.ld $*.lo@" > $*.ld \ 50 || { rm -f $*.ld; exit 1; } 51 52ifneq "$(MAKECMDGOALS)" "clean" 53include $(patsubst %.lo, %.ld, $(OBJS)) 54endif 55