3 warn_flags = -pedantic -Wall
12 ccsrc = $(wildcard $(rootdir)/src/*.cc)
13 obj = $(ccsrc:.cc=.o) $(csrc:.c=.o)
17 CFLAGS = $(warn_flags) $(opt_flags) $(dbg_flags) $(pic) $(def)
18 CXXFLAGS = $(warn_flags) $(opt_flags) $(dbg_flags) $(pic) $(def)
20 sys = $(shell uname -s | sed 's/MINGW.*/MINGW/')
23 solib = lib$(name).dylib
26 else ifeq ($(sys), MINGW)
33 solib = lib$(name).so.$(so_major).$(so_minor)
34 soname = lib$(name).so.$(so_major)
35 ldname = lib$(name).so
36 shared = -shared -Wl,-soname=$(soname)
43 $(alib): $(obj) Makefile
46 $(solib): $(obj) Makefile
47 $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
48 [ -n "$(soname)" ] && \
49 rm -f $(soname) $(ldname) && \
50 ln -s $(solib) $(soname) && \
51 ln -s $(soname) $(ldname) || true
56 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
59 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
63 rm -f $(obj) $(alib) $(solib)
70 install: $(alib) $(solib)
71 mkdir -p $(DESTDIR)$(PREFIX)/include/$(name) $(DESTDIR)$(PREFIX)/lib
72 cp src/*.h src/*.inl $(DESTDIR)$(PREFIX)/include/$(name)/
73 cp $(alib) $(DESTDIR)$(PREFIX)/lib/$(alib)
74 cp $(solib) $(DESTDIR)$(PREFIX)/lib/$(solib)
75 [ -n "$(soname)" ] && \
76 rm -f $(DESTDIR)$(PREFIX)/lib/$(soname) $(DESTDIR)$(PREFIX)/lib/$(ldname) && \
77 cp -a $(soname) $(DESTDIR)$(PREFIX)/lib/$(soname) && \
78 cp -a $(ldname) $(DESTDIR)$(PREFIX)/lib/$(ldname) || true
82 rm -f $(DESTDIR)$(PREFIX)/include/$(name)/*.h $(DESTDIR)$(PREFIX)/include/$(name)/*.inl
83 rm -f $(DESTDIR)$(PREFIX)/lib/$(solib)
84 [ -n "$(soname)" ] && \
85 rm -f $(DESTDIR)$(PREFIX)/lib/$(soname) && \
86 rm -f $(DESTDIR)$(PREFIX)/lib/$(ldname) || true