Added an ARM cross-compile build to Travis.
[platform/upstream/libexif.git] / contrib / c++ / Makefile
1 BOOST_PYTHON_LIB = -L/usr/local/boost_1_29_0/lib -lboost_python
2 BOOST_INCLUDES = -I/usr/local/boost_1_29_0/src
3 dynmoddir = `pwd`/local
4
5 CXX = g++
6 CXXFLAGS := -O2 -Wall
7 CPPFLAGS := -I/usr/include/python2.2
8
9 LIBTOOL = $(SHELL) ./libtool
10 LIBCXX = $(LIBTOOL) --tag=CXX --mode=compile $(CXX)
11 LINKCXX = $(LIBTOOL) --tag=CXX --mode=link $(CXX)
12 LINKCXXLIB = $(LINKCXX) -rpath $(dynmoddir)
13 LINKCXXMODULE = $(LINKCXXLIB) -module -avoid-version
14 LIBINSTALL = $(LIBTOOL) --mode=install /bin/install -c -p
15 INSTALL = /bin/install -c -p
16
17 TARGET = exif.la
18
19 OBJS = \
20     exif_module.lo
21
22 all: $(TARGET)
23
24 install: $(TARGET)
25         $(INSTALL) -d $(dynmoddir)
26         $(LIBINSTALL) $(TARGET) $(dynmoddir)
27
28 $(TARGET): $(OBJS)
29         $(LINKCXXMODULE) -o $(TARGET) $(OBJS) $(BOOST_PYTHON_LIB) -lexif
30
31 clean::
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
52 ifneq "$(MAKECMDGOALS)" "clean"
53 include $(patsubst %.lo, %.ld, $(OBJS))
54 endif