diff --git a/src/Makefile b/src/Makefile index 0f09d686..9f4a5d88 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,21 +1,28 @@ +# @(#$Id: Makefile,v 1.11 2005-11-12 11:26:09 dockes Exp $ (C) 2005 J.F.Dockes + +# Default values. These can be overridden on the command line ie: +# make PREFIX=/usr PREFIX=/usr/local INSTALL = install -c all: mk/sysconf cd lib; ${MAKE} cd bincimapmime; ${MAKE} - cd index; ${MAKE} - cd qtgui; qmake recoll.pro; rm -f recoll; ${MAKE} + cd index; rm -f recollindex; ${MAKE} recollindex + cd qtgui; qmake recoll.pro; rm -f recoll; \ + cat ../mk/commondefs ../mk/sysconf Makefile | ${MAKE} -f - mk/sysconf: ./configure static: - rm -f index/recollindex qtgui/recoll cd lib; ${MAKE} cd bincimapmime; ${MAKE} - cd index; ${MAKE} BSTATIC=-Wl,-Bstatic BDYNAMIC=-Wl,-Bdynamic - cd qtgui; qmake recoll.pro; ${MAKE} BSTATIC=-Wl,-Bstatic BDYNAMIC=-Wl,-Bdynamic + cd index; rm -f recollindex; \ + ${MAKE} BSTATIC=-Wl,-Bstatic BDYNAMIC=-Wl,-Bdynamic + cd qtgui; qmake recoll.pro; rm -f recoll \ + cat ../mk/commondefs ../mk/sysconf Makefile | ${MAKE} -f - \ + BSTATIC=-Wl,-Bstatic BDYNAMIC=-Wl,-Bdynamic clean: cd common; ${MAKE} clean @@ -27,6 +34,9 @@ clean: @-cd qtgui; ${MAKE} clean rm -f qtgui/Makefile qtgui/preview/Makefile qtgui/recoll +distclean: clean + rm -f mk/sysconf + install: all ./recollinstall ${PREFIX} diff --git a/src/bincimapmime/Makefile b/src/bincimapmime/Makefile index a5b2e242..d330950d 100644 --- a/src/bincimapmime/Makefile +++ b/src/bincimapmime/Makefile @@ -1,9 +1,8 @@ -include ../mk/sysconf LIBS = libmime.a PROGS = trbinc -all: $(LIBS) +all: depend $(LIBS) SRCS = mime-getpart.cc mime-parsefull.cc mime-parseonlyheader.cc \ mime-printbody.cc mime-printdoc.cc mime-printheader.cc mime.cc \ @@ -14,9 +13,8 @@ OBJS = mime-getpart.o mime-parsefull.o mime-parseonlyheader.o \ convert.o iodevice.o iofactory.o libmime.a : $(OBJS) - ar ru libmime.a $(OBJS) + $(AR) ru libmime.a $(OBJS) -# $(CXX) $(CXXFLAGS) -c $< .cc .o : $(CXX) $(CXXFLAGS) -c $< @@ -24,10 +22,15 @@ TRBINCOBJS = trbinc.o trbinc: trbinc.o $(CXX) -o trbinc trbinc.o libmime.a -clean: - rm -f *.o $(LIBS) +depend: alldeps.stamp +alldeps.stamp : $(SRCS) + $(CXX) -M $(CXXFLAGS) $(SRCS) > alldeps + touch alldeps.stamp -depend: alldeps -alldeps: $(SRCS) - $(CXX) $(CXXFLAGS) -M $(SRCS) > alldeps +clean: + cp /dev/null alldeps + rm -f alldeps.stamp + rm -f ${LIBS} ${PROGS} ${OBJS} + +include ../mk/sysconf include alldeps diff --git a/src/common/Makefile b/src/common/Makefile index f457196c..53e1e6d1 100644 --- a/src/common/Makefile +++ b/src/common/Makefile @@ -1,8 +1,11 @@ -include ../mk/sysconf -BIGLIB = ../lib/librcl.a +# Only test progs in there PROGS = unacpp textsplit -all: $(PROGS) + +all: $(BIGLIB) $(PROGS) + +$(BIGLIB): + cd ../lib;$(MAKE) UNACPP_OBJS= trunacpp.o $(BIGLIB) unacpp : $(UNACPP_OBJS) @@ -17,5 +20,9 @@ textsplit : $(TEXTSPLIT_OBJS) trtextsplit.o : textsplit.cpp $(CXX) $(CXXFLAGS) -DTEST_TEXTSPLIT -c -o trtextsplit.o \ textsplit.cpp -clean: + +clean:: rm -f *.o $(PROGS) + +include ../mk/sysconf + diff --git a/src/index/Makefile b/src/index/Makefile index 45a79ba8..a92197be 100644 --- a/src/index/Makefile +++ b/src/index/Makefile @@ -1,17 +1,14 @@ -include ../mk/sysconf - -BIGLIB = ../lib/librcl.a -MIMELIB = ../bincimapmime/libmime.a - PROGS = recollindex csguess mimetype +SRCS = recollindex.cpp + all: $(PROGS) RECOLLINDEX_OBJS= recollindex.o $(BIGLIB) $(MIMELIB) recollindex : $(RECOLLINDEX_OBJS) $(CXX) $(CXXFLAGS) -o recollindex $(RECOLLINDEX_OBJS) \ $(BSTATIC) $(LIBXAPIAN) $(LIBICONV) $(BDYNAMIC) $(LIBSYS) -recollindex.o : idxdriver.cpp - $(CXX) $(CXXFLAGS) -c -o recollindex.o idxdriver.cpp +recollindex.o : recollindex.cpp + $(CXX) $(CXXFLAGS) -c -o recollindex.o $< CSGUESS_OBJS= trcsguess.o $(BIGLIB) csguess : $(CSGUESS_OBJS) @@ -29,11 +26,20 @@ trmimetype.o : mimetype.cpp $(CXX) $(CXXFLAGS) -DTEST_MIMETYPE -c -o trmimetype.o \ mimetype.cpp -clean: +$(BIGLIB): + cd ../lib;$(MAKE) +$(MIMELIB): + cd ../bincimapmime;$(MAKE) + +depend: alldeps.stamp +alldeps.stamp : $(SRCS) + $(CXX) -M $(CXXFLAGS) $(SRCS) > alldeps + touch alldeps.stamp + +clean: + cp /dev/null alldeps + rm -f alldeps.stamp rm -f *.o $(PROGS) -alldeps:depend -depend: - $(CXX) $(CXXFLAGS) -M *.cpp > alldeps include alldeps - +include ../mk/sysconf diff --git a/src/lib/Makefile b/src/lib/Makefile index f4b9b5a9..85da0170 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -1,10 +1,9 @@ -include ../mk/sysconf - -UNACCFLAGS = -g -I. -I../unac -I/usr/local/include -DUNAC_VERSION=\"1.0.7\" +UNACCFLAGS = -g -I. -I../unac $(INCICONV) -DUNAC_VERSION=\"1.0.7\" LIBS = librcl.a -all: $(LIBS) + +all: depend $(LIBS) OBJS = base64.o conftree.o csguess.o debuglog.o \ execmd.o wipedir.o \ @@ -92,14 +91,15 @@ md5.o : ../utils/md5.cpp unacpp.o : ../common/unacpp.cpp $(CXX) $(CXXFLAGS) -c $< +depend: alldeps.stamp +alldeps.stamp : $(SRCS) + $(CXX) -M $(CXXFLAGS) $(SRCS) > alldeps + touch alldeps.stamp -clean: - rm -f *.o $(LIBS) - -depend: alldeps - -alldeps: $(SRCS) - $(CXX) $(CXXFLAGS) -M $(SRCS) > alldeps +clean: + cp /dev/null alldeps + rm -f alldeps.stamp + rm -f $(OBJS) $(LIBS) include alldeps - +include ../mk/sysconf diff --git a/src/mk/commondefs b/src/mk/commondefs index 89b5c9c8..2d8d645e 100644 --- a/src/mk/commondefs +++ b/src/mk/commondefs @@ -1,13 +1,22 @@ - +# # Definitions mostly common to all systems, can be overridden by # sys-specific include + + COMMONCXXFLAGS = -Wall -Wno-unused -g -I. -I../index -I../utils -I../common \ -I../unac -I../bincimapmime -I/usr/local/include LIBXAPIAN = -L/usr/local/lib -lxapian +LIBICONV = -L/usr/local/lib -liconv +INCICONV = -I/usr/local/include + BIGLIB = ../lib/librcl.a MIMELIB = ../bincimapmime/libmime.a RANLIB = test -f +AR=ar INSTALL = install -c + +#QTDIR = /usr + diff --git a/src/qtgui/recoll.pro b/src/qtgui/recoll.pro index 558d47bd..e11d2c43 100644 --- a/src/qtgui/recoll.pro +++ b/src/qtgui/recoll.pro @@ -1,7 +1,7 @@ TEMPLATE = app LANGUAGE = C++ -CONFIG += qt warn_on thread release +CONFIG += qt warn_on thread release #debug SOURCES += main.cpp \ idxthread.cpp \ @@ -27,7 +27,7 @@ unix { MOC_DIR = .moc OBJECTS_DIR = .obj LIBS += ../lib/librcl.a ../bincimapmime/libmime.a \ - $(BSTATIC) -L/usr/local/lib -lxapian -liconv $(BDYNAMIC) \ + $(BSTATIC) $(LIBXAPIAN) $(LIBICONV) $(BDYNAMIC) \ -lz INCLUDEPATH += ../common ../index ../query ../unac ../utils diff --git a/src/query/Makefile b/src/query/Makefile index bd26a728..25cba72b 100644 --- a/src/query/Makefile +++ b/src/query/Makefile @@ -1,6 +1,3 @@ -include ../mk/sysconf - -BIGLIB=../lib/librcl.a PROGS = qtry qxtry xadump all: $(PROGS) @@ -23,10 +20,15 @@ qtry : $(QTRY_OBJS) $(BIGLIB): cd ../lib;make -clean: - rm -f *.o $(PROGS) -alldeps:depend -depend: - $(CXX) $(CXXFLAGS) -M *.cpp > alldeps -include alldeps +depend: alldeps.stamp +alldeps.stamp : $(SRCS) + $(CXX) -M $(CXXFLAGS) $(SRCS) > alldeps + touch alldeps.stamp +clean: + cp /dev/null alldeps + rm -f alldeps.stamp + rm -f *.o $(PROGS) + +include ../mk/sysconf +include alldeps diff --git a/src/sampleconf/mimemap b/src/sampleconf/mimemap index fad30f4a..29bf0c77 100644 --- a/src/sampleconf/mimemap +++ b/src/sampleconf/mimemap @@ -1,4 +1,4 @@ -# @(#$Id: mimemap,v 1.7 2005-11-10 08:46:14 dockes Exp $ (C) 2004 J.F.Dockes +# @(#$Id: mimemap,v 1.8 2005-11-12 11:26:10 dockes Exp $ (C) 2004 J.F.Dockes # Recoll: associations of file name extensions to mime types .txt = text/plain @@ -23,17 +23,22 @@ .doc = application/msword +# OpenOffice / opendocument. We handle opendocument as old openoffice files +# for now .sxc = application/vnd.sun.xml.calc +.ods = application/vnd.sun.xml.calc .stc = application/vnd.sun.xml.calc.template .sxd = application/vnd.sun.xml.draw .std = application/vnd.sun.xml.draw.template .sxi = application/vnd.sun.xml.impress +.odp = application/vnd.sun.xml.impress .sti = application/vnd.sun.xml.impress.template .sxm = application/vnd.sun.xml.math .sxw = application/vnd.sun.xml.writer +.odt = application/vnd.sun.xml.writer .sxg = application/vnd.sun.xml.writer.global .stw = application/vnd.sun.xml.writer.template -.odt = application/vnd.sun.xml.writer + .wpd = application/vnd.wordperfect .rtf = text/rtf diff --git a/src/utils/Makefile b/src/utils/Makefile index 5fb384fb..2f27b381 100644 --- a/src/utils/Makefile +++ b/src/utils/Makefile @@ -1,11 +1,11 @@ -include ../mk/sysconf - -BIGLIB = ../lib/librcl.a PROGS = trconftree wipedir smallut trfstreewalk trpathut transcode \ trmimeparse trexecmd utf8iter idfile -all: $(PROGS) +all: $(PROGS) $(BIGLIB) + +$(BIGLIB): + cd ../lib;$(MAKE) FSTREEWALK_OBJS= trfstreewalk.o fstreewalk.o pathut.o trfstreewalk : $(FSTREEWALK_OBJS) @@ -69,7 +69,6 @@ trutf8iter.o : ../utils/utf8iter.cpp utf8iter.h utf8iter.cpp - CONFTREE_OBJS= trconftree.o $(BIGLIB) trconftree : $(CONFTREE_OBJS) $(CXX) $(CXXFLAGS) -o trconftree $(CONFTREE_OBJS) @@ -77,7 +76,7 @@ trconftree.o : ../utils/conftree.cpp $(CXX) $(CXXFLAGS) -DTEST_CONFTREE -c -o trconftree.o \ conftree.cpp - - -clean: +clean: rm -f *.o $(PROGS) + +include ../mk/sysconf