annotate Makefile @ 770:c54bc2ffbf92 tip

update tags
author convert-repo
date Fri, 16 Dec 2011 11:34:01 +0000
parents 512797443824
children
rev   line source
mas01cr@137 1 HELP2MAN=help2man
mas01cr@137 2 GENGETOPT=gengetopt
mas01cr@137 3 SOAPCPP2=soapcpp2
mas01mc@769 4 GSOAP_INCLUDE=$(shell pkg-config --cflags gsoap++)
mas01cr@613 5 GSOAP_CPP=$(shell pkg-config --libs gsoap++)
mas01cr@613 6 GSL_INCLUDE=$(shell pkg-config --cflags gsl)
mas01cr@613 7 LIBGSL=$(shell pkg-config --libs gsl)
mas01cr@137 8
mas01cr@661 9 TESTDIRS=tests libtests
mas01cr@666 10 BINDINGDIRS=bindings/sb-alien bindings/pd bindings/python
mas01cr@661 11
mas01cr@611 12 PREFIX=/usr/local
mas01cr@611 13 EXEC_PREFIX=$(PREFIX)
mas01cr@611 14 LIBDIR=$(EXEC_PREFIX)/lib
mas01cr@611 15 BINDIR=$(EXEC_PREFIX)/bin
mas01cr@611 16 INCLUDEDIR=$(PREFIX)/include
mas01cr@611 17 MANDIR=$(PREFIX)/share/man
map01bf@374 18
mas01mc@764 19 LIBOBJS=lock.o pointpair.o create.o open.o power.o l2norm.o insert.o status.o query.o dump.o close.o index-utils.o query-indexed.o liszt.o retrieve.o lshlib.o multiprobe.o sample.o
mas01cr@694 20 OBJS=$(LIBOBJS) index.o soap.o cmdline.o audioDB.o common.o
map01bf@374 21
map01bf@374 22 EXECUTABLE=audioDB
map01bf@374 23
map01bf@374 24 SOVERSION=0
map01bf@374 25 MINORVERSION=0
map01bf@374 26 LIBRARY=lib$(EXECUTABLE).so.$(SOVERSION).$(MINORVERSION)
mas01cr@611 27 SHARED_LIB_FLAGS=-shared -Wl,-soname,lib$(EXECUTABLE).so.$(SOVERSION)
map01bf@374 28
mas01mc@534 29 override CFLAGS+=-g -O3 -fPIC
mas01mc@534 30
mas01mc@534 31 # set to generate profile (gprof) and coverage (gcov) info
mas01mc@534 32 #override CFLAGS+=-fprofile-arcs -ftest-coverage -pg
mas01mc@513 33
mas01mc@513 34 # set to DUMP hashtables on QUERY load
mas01mc@513 35 #override CFLAGS+=-DLSH_DUMP_CORE_TABLES
mas01cr@244 36
mas01cr@239 37 ifeq ($(shell uname),Linux)
mas01cr@239 38 override CFLAGS+=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
mas01cr@239 39 endif
mas01cr@137 40
mas01cr@244 41 ifeq ($(shell uname),Darwin)
mas01cr@244 42 ifeq ($(shell sysctl -n hw.optional.x86_64),1)
mas01mc@315 43 override CFLAGS+=-arch x86_64
mas01cr@244 44 endif
map01bf@374 45 override LIBRARY=lib$(EXECUTABLE).$(SOVERSION).$(MINORVERSION).dylib
mas01cr@611 46 override SHARED_LIB_FLAGS=-dynamiclib -current_version $(SOVERSION) -Wl -install_name $(LIBRARY)
mas01cr@244 47 endif
mas01cr@244 48
mas01cr@611 49 .PHONY: all clean test install $(EXECUTABLE).pc
mas01cr@72 50
mas01cr@611 51 all: $(LIBRARY) $(EXECUTABLE) $(EXECUTABLE).1
mas01cr@2 52
mas01ik@355 53 $(EXECUTABLE).1: $(EXECUTABLE)
mas01ik@355 54 $(HELP2MAN) ./$(EXECUTABLE) > $(EXECUTABLE).1
mas01cr@0 55
mas01ik@355 56 HELP.txt: $(EXECUTABLE)
mas01ik@355 57 ./$(EXECUTABLE) --help > HELP.txt
mas01cr@3 58
mas01cr@1 59 cmdline.c cmdline.h: gengetopt.in
mas01ik@355 60 $(GENGETOPT) -e <gengetopt.in
mas01cr@1 61
mas01cr@506 62 soapServer.cpp soapClient.cpp soapC.cpp soapH.h adb.nsmap: audioDBws.h
mas01ik@355 63 $(SOAPCPP2) audioDBws.h
mas01cr@1 64
mas01cr@509 65 $(LIBOBJS): %.o: %.cpp audioDB_API.h audioDB-internals.h accumulator.h accumulators.h
mas01cr@587 66 $(CXX) -c $(CFLAGS) $(GSL_INCLUDE) -Wall $<
mas01cr@503 67
mas01cr@498 68 %.o: %.cpp audioDB.h audioDB_API.h adb.nsmap cmdline.h reporter.h ReporterBase.h lshlib.h
mas01cr@587 69 $(CXX) -c $(CFLAGS) $(GSOAP_INCLUDE) $(GSL_INCLUDE) -Wall $<
mas01cr@239 70
mas01cr@345 71 cmdline.o: cmdline.c cmdline.h
mas01cr@587 72 $(CC) -c $(CFLAGS) $<
mas01cr@345 73
mas01cr@371 74 $(EXECUTABLE): $(OBJS) soapServer.cpp soapClient.cpp soapC.cpp
mas01cr@587 75 $(CXX) -o $(EXECUTABLE) $(CFLAGS) $^ $(LIBGSL) $(GSOAP_INCLUDE) $(GSOAP_CPP)
mas01ik@355 76
mas01cr@498 77 $(LIBRARY): $(LIBOBJS)
mas01cr@694 78 $(CXX) $(SHARED_LIB_FLAGS) -o $(LIBRARY) $(LIBGSL) $(CFLAGS) $^
mas01ik@355 79
mas01ik@355 80 tags:
mas01ik@355 81 ctags *.cpp *.h
mas01ik@355 82
mas01cr@2 83
mas01cr@2 84 clean:
mas01mc@475 85 -rm cmdline.c cmdline.h cmdline.o
mas01cr@2 86 -rm soapServer.cpp soapClient.cpp soapC.cpp soapObject.h soapStub.h soapProxy.h soapH.h soapServerLib.cpp soapClientLib.cpp
mas01ik@355 87 -rm adb.*
mas01cr@135 88 -rm HELP.txt
mas01ik@355 89 -rm $(EXECUTABLE) $(EXECUTABLE).1 $(OBJS)
mas01cr@281 90 -rm xthresh
mas01cr@661 91 -for d in $(TESTDIRS); do (cd $$d && sh ./clean.sh); done
mas01cr@661 92 -for d in $(BINDINGDIRS); do (cd $$d && $(MAKE) clean); done
mas01cr@498 93 -rm $(LIBRARY)
mas01ik@355 94 -rm tags
mas01cr@72 95
mas01cr@372 96 distclean: clean
mas01ik@355 97 -rm *.o
mas01ik@355 98 -rm -rf audioDB.dump
mas01ik@355 99
mas01cr@549 100 test: $(EXECUTABLE) $(LIBRARY)
mas01cr@661 101 for d in $(TESTDIRS); do (cd $$d && sh ./run-tests.sh); done
mas01cr@661 102 for d in $(BINDINGDIRS); do (cd $$d && $(MAKE) test); done
mas01cr@280 103
mas01cr@280 104 xthresh: xthresh.c
mas01cr@587 105 $(CC) -o $@ $(CFLAGS) $(GSL_INCLUDE) $(LIBGSL) $<
mas01ik@355 106
mas01cr@611 107 $(EXECUTABLE).pc:
mas01cr@611 108 ./make-pc.sh "$(EXECUTABLE)" "$(LIBDIR)" "$(INCLUDEDIR)" $(SOVERSION) $(MINORVERSION) > $(EXECUTABLE).pc
mas01cr@611 109
mas01cr@611 110 install: $(EXECUTABLE).pc
mas01cr@611 111 mkdir -m755 -p $(LIBDIR)/pkgconfig $(BINDIR) $(INCLUDEDIR) $(MANDIR)/man1
mas01cr@611 112 install -m644 $(LIBRARY) $(LIBDIR)
map01bf@617 113 ifneq ($(shell uname),Darwin)
mas01cr@611 114 ldconfig -n $(LIBDIR)
map01bf@617 115 endif
mas01mj@681 116 ln -sf $(LIBRARY) $(LIBDIR)/lib$(EXECUTABLE).so
mas01cr@611 117 install -m755 $(EXECUTABLE) $(BINDIR)
mas01cr@611 118 install -m644 audioDB_API.h $(INCLUDEDIR)
mas01cr@611 119 install -m644 $(EXECUTABLE).1 $(MANDIR)/man1
mas01cr@611 120 install $(EXECUTABLE).pc $(LIBDIR)/pkgconfig