| 1 | 
adcroft | 
1.1 | 
#  | 
| 2 | 
  | 
  | 
# Makefile derived from the Makefile coming with swish-e 1.3.2 | 
| 3 | 
  | 
  | 
# (original Makefile for SWISH Kevin Hughes, 3/12/95) | 
| 4 | 
  | 
  | 
# | 
| 5 | 
  | 
  | 
# The code has been tested to compile on Solaris and DEC  | 
| 6 | 
  | 
  | 
# G.Hill ghill@library.berkeley.edu 6/11/97 | 
| 7 | 
  | 
  | 
#  | 
| 8 | 
  | 
  | 
# autoconf configuration by Bas Meijer, 11 Dec 2000 | 
| 9 | 
  | 
  | 
# Cross Platform Compilation on Solaris, HP-UX, IRIX, Mac OS X, BDSi and Linux | 
| 10 | 
  | 
  | 
# Several ideas from a Makefile by Christian Lindig <lindig@ips.cs.tu-bs.de>   | 
| 11 | 
  | 
  | 
# | 
| 12 | 
  | 
  | 
# $Id: Makefile.in,v 1.47 2002/08/23 23:11:06 whmoseley Exp $ | 
| 13 | 
  | 
  | 
 | 
| 14 | 
  | 
  | 
# get name and version from configure.in | 
| 15 | 
  | 
  | 
NAME        = swish-e | 
| 16 | 
  | 
  | 
VERSION     = 2.2rc1 | 
| 17 | 
  | 
  | 
 | 
| 18 | 
  | 
  | 
# C compiler | 
| 19 | 
  | 
  | 
CC          = gcc | 
| 20 | 
  | 
  | 
 | 
| 21 | 
  | 
  | 
SHELL       = /bin/sh | 
| 22 | 
  | 
  | 
prefix      = /u/httpd/html/devel/buildweb | 
| 23 | 
  | 
  | 
bindir      = $(prefix)/bin | 
| 24 | 
  | 
  | 
exec_prefix = ${prefix} | 
| 25 | 
  | 
  | 
libdir      = ${exec_prefix}/lib | 
| 26 | 
  | 
  | 
cflags      = -g -O2 | 
| 27 | 
  | 
  | 
ldflags     =  | 
| 28 | 
  | 
  | 
 | 
| 29 | 
  | 
  | 
 | 
| 30 | 
  | 
  | 
 | 
| 31 | 
  | 
  | 
 | 
| 32 | 
  | 
  | 
LIBS        = -lm -lm  -L/usr/lib -lxml2 -lz -lm -lz | 
| 33 | 
  | 
  | 
 | 
| 34 | 
  | 
  | 
# Library related  | 
| 35 | 
  | 
  | 
AR          = ar | 
| 36 | 
  | 
  | 
ARFLAGS     = cr | 
| 37 | 
  | 
  | 
RANLIB      = ranlib | 
| 38 | 
  | 
  | 
 | 
| 39 | 
  | 
  | 
# | 
| 40 | 
  | 
  | 
# The objects for the different methods and | 
| 41 | 
  | 
  | 
# some common aliases | 
| 42 | 
  | 
  | 
# | 
| 43 | 
  | 
  | 
 | 
| 44 | 
  | 
  | 
 | 
| 45 | 
  | 
  | 
 | 
| 46 | 
  | 
  | 
#--- James Clark's Expat ---- | 
| 47 | 
  | 
  | 
 | 
| 48 | 
  | 
  | 
XPDIR       = expat | 
| 49 | 
  | 
  | 
 | 
| 50 | 
  | 
  | 
XP_OBJ = $(XPDIR)/xmltok/xmltok.o \ | 
| 51 | 
  | 
  | 
         $(XPDIR)/xmltok/xmlrole.o \ | 
| 52 | 
  | 
  | 
         $(XPDIR)/xmlparse/xmlparse.o | 
| 53 | 
  | 
  | 
 | 
| 54 | 
  | 
  | 
XP_INC = -I$(XPDIR)/xmltok -I$(XPDIR)/xmlparse | 
| 55 | 
  | 
  | 
 | 
| 56 | 
  | 
  | 
XP_H   = $(XPDIR)/xmltok/*.h $(XPDIR)/xmlparse/*.h | 
| 57 | 
  | 
  | 
 | 
| 58 | 
  | 
  | 
 | 
| 59 | 
  | 
  | 
#== Define groups of object files == | 
| 60 | 
  | 
  | 
 | 
| 61 | 
  | 
  | 
#--- Input methods --- | 
| 62 | 
  | 
  | 
FILESYSTEM_OBJS     = fs.o | 
| 63 | 
  | 
  | 
HTTP_OBJS           = http.o httpserver.o | 
| 64 | 
  | 
  | 
EXTPROG_OBJS        = extprog.o | 
| 65 | 
  | 
  | 
INPUT_METHODS_OBJS  = $(FILESYSTEM_OBJS) $(HTTP_OBJS) $(EXTPROG_OBJS) methods.o | 
| 66 | 
  | 
  | 
 | 
| 67 | 
  | 
  | 
#--- Parsers --- | 
| 68 | 
  | 
  | 
PARSER_OBJS         = html.o txt.o xml.o $(XP_OBJ) entities.o parser.o | 
| 69 | 
  | 
  | 
                       | 
| 70 | 
  | 
  | 
 | 
| 71 | 
  | 
  | 
#--- Indexing modules --- | 
| 72 | 
  | 
  | 
INDEXING_OBJS       = $(INPUT_METHODS_OBJS) $(PARSER_OBJS) \ | 
| 73 | 
  | 
  | 
                      index.o merge.o stemmer.o soundex.o \ | 
| 74 | 
  | 
  | 
                      filter.o parse_conffile.o swregex.o double_metaphone.o | 
| 75 | 
  | 
  | 
 | 
| 76 | 
  | 
  | 
#--- Logical Groups --- | 
| 77 | 
  | 
  | 
 | 
| 78 | 
  | 
  | 
SEARCHING_OBJS      = swish2.o search.o swish_words.o proplimit.o \ | 
| 79 | 
  | 
  | 
                      search_alt.o result_output.o rank.o | 
| 80 | 
  | 
  | 
 | 
| 81 | 
  | 
  | 
DB_OBJS             = hash.o compress.o db.o db_native.o ramdisk.o btree.o array.o | 
| 82 | 
  | 
  | 
 | 
| 83 | 
  | 
  | 
UTIL_OBJS           = check.o file.o error.o list.o mem.o string.o \ | 
| 84 | 
  | 
  | 
                      docprop.o metanames.o result_sort.o \ | 
| 85 | 
  | 
  | 
                      dump.o swish_qsort.o  date_time.o \ | 
| 86 | 
  | 
  | 
                      no_better_place_module.o  | 
| 87 | 
  | 
  | 
 | 
| 88 | 
  | 
  | 
# Only for building the binary | 
| 89 | 
  | 
  | 
SWISH_BINARY_OBJS   = swish.o keychar_out.o                      | 
| 90 | 
  | 
  | 
 | 
| 91 | 
  | 
  | 
 | 
| 92 | 
  | 
  | 
# Collection of files for building swish library | 
| 93 | 
  | 
  | 
# later, separate out indexing from searching | 
| 94 | 
  | 
  | 
LIB_OBJS            =   $(INDEXING_OBJS) $(SEARCHING_OBJS) $(DB_OBJS) $(UTIL_OBJS) | 
| 95 | 
  | 
  | 
SEARCH_LIB_OBJS     =   $(SEARCHING_OBJS) $(DB_OBJS) $(UTIL_OBJS) | 
| 96 | 
  | 
  | 
 | 
| 97 | 
  | 
  | 
# All objects for make clean target | 
| 98 | 
  | 
  | 
OBJS                = $(SWISH_BINARY_OBJS) $(SEARCHING_OBJS) $(INDEXING_OBJS) $(SEARCHING_OBJS) $(DB_OBJS) $(UTIL_OBJS) | 
| 99 | 
  | 
  | 
  | 
| 100 | 
  | 
  | 
# Flags for C compiler | 
| 101 | 
  | 
  | 
CFLAGS      = -Wall -pedantic -DHAVE_CONFIG_H -DSWISH_VERSION=\"$(VERSION)\" $(XP_INC) -I/usr/include/libxml2  $(cflags) | 
| 102 | 
  | 
  | 
LDFLAGS     = $(ldflags) | 
| 103 | 
  | 
  | 
 | 
| 104 | 
  | 
  | 
 | 
| 105 | 
  | 
  | 
 | 
| 106 | 
  | 
  | 
 | 
| 107 | 
  | 
  | 
#.SUFFIXES:  | 
| 108 | 
  | 
  | 
#.SUFFIXES : .o .c | 
| 109 | 
  | 
  | 
 | 
| 110 | 
  | 
  | 
.c.o: | 
| 111 | 
  | 
  | 
        $(CC) $(CFLAGS) -c -o $@ $< | 
| 112 | 
  | 
  | 
         | 
| 113 | 
  | 
  | 
all:    $(NAME) | 
| 114 | 
  | 
  | 
 | 
| 115 | 
  | 
  | 
$(NAME): libswish-e.a $(SWISH_BINARY_OBJS) | 
| 116 | 
  | 
  | 
        $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(SWISH_BINARY_OBJS) libswish-e.a $(LIBS) | 
| 117 | 
  | 
  | 
        chmod 755 $@ | 
| 118 | 
  | 
  | 
 | 
| 119 | 
  | 
  | 
libswish-e.a: $(LIB_OBJS) | 
| 120 | 
  | 
  | 
        $(AR) $(ARFLAGS) $@ $(LIB_OBJS) | 
| 121 | 
  | 
  | 
        $(RANLIB) libswish-e.a | 
| 122 | 
  | 
  | 
 | 
| 123 | 
  | 
  | 
swish-search: $(NAME) | 
| 124 | 
  | 
  | 
        cp -f $(NAME) swish-search | 
| 125 | 
  | 
  | 
 | 
| 126 | 
  | 
  | 
clean: | 
| 127 | 
  | 
  | 
        rm -f ../tests/*.index ../tests/core core  swish-e swish-search swish.o $(OBJS) libswish-e.a libtest.o | 
| 128 | 
  | 
  | 
 | 
| 129 | 
  | 
  | 
realclean: clean | 
| 130 | 
  | 
  | 
        rm Makefile | 
| 131 | 
  | 
  | 
        rm -f config.cache config.log config.status | 
| 132 | 
  | 
  | 
 | 
| 133 | 
  | 
  | 
test:   $(NAME) | 
| 134 | 
  | 
  | 
        @echo -e "\nCreating index..." | 
| 135 | 
  | 
  | 
        @(cd ../tests; ../src/swish-e -c test.config) | 
| 136 | 
  | 
  | 
 | 
| 137 | 
  | 
  | 
        @echo -e "\n** Five (5) tests follow..." | 
| 138 | 
  | 
  | 
 | 
| 139 | 
  | 
  | 
        @echo -e "\ntest 1 (Normal search) ..." | 
| 140 | 
  | 
  | 
        @(cd ../tests; ../src/swish-e -f ./test.index -w test | egrep  '^[0-9]') | 
| 141 | 
  | 
  | 
         | 
| 142 | 
  | 
  | 
        @echo -e "\ntest 2 (MetaTag search 1) ..." | 
| 143 | 
  | 
  | 
        @(cd ../tests; ../src/swish-e -f ./test.index -w meta1=metatest1 | egrep  '^[0-9]') | 
| 144 | 
  | 
  | 
         | 
| 145 | 
  | 
  | 
        @echo -e "\ntest 3 (MetaTag search 2) ..." | 
| 146 | 
  | 
  | 
        @(cd ../tests; ../src/swish-e -f ./test.index -w meta2=metatest2 | egrep  '^[0-9]') | 
| 147 | 
  | 
  | 
         | 
| 148 | 
  | 
  | 
        @echo -e "\ntest 4 (XML search) ..." | 
| 149 | 
  | 
  | 
        @(cd ../tests; ../src/swish-e -f ./test.index -w meta3=metatest3 | egrep  '^[0-9]') | 
| 150 | 
  | 
  | 
         | 
| 151 | 
  | 
  | 
        @echo -e "\ntest 5 (Phrase search) ..." | 
| 152 | 
  | 
  | 
        @(cd ../tests; ../src/swish-e -f ./test.index -w '"three little pigs"' | egrep  '^[0-9]') | 
| 153 | 
  | 
  | 
 | 
| 154 | 
  | 
  | 
        @echo -e "\n ** All tests completed! **\n" | 
| 155 | 
  | 
  | 
 | 
| 156 | 
  | 
  | 
 | 
| 157 | 
  | 
  | 
$(LIB_OBJS):    Makefile config.h swish.h | 
| 158 | 
  | 
  | 
 | 
| 159 | 
  | 
  | 
install: | 
| 160 | 
  | 
  | 
        cp swish-e $(bindir)/swish-e | 
| 161 | 
  | 
  | 
 | 
| 162 | 
  | 
  | 
install-lib:     | 
| 163 | 
  | 
  | 
        cp libswish-e.a $(libdir)/libswish-e.a | 
| 164 | 
  | 
  | 
 | 
| 165 | 
  | 
  | 
 | 
| 166 | 
  | 
  | 
libtest: all libsearchswish-e.a libtest.o | 
| 167 | 
  | 
  | 
        $(CC) -o $@ $(CFLAGS) $(LDFLAGS) libtest.o libswish-e.a $(LIBS) | 
| 168 | 
  | 
  | 
        chmod 755 $@ | 
| 169 | 
  | 
  | 
 | 
| 170 | 
  | 
  | 
 | 
| 171 | 
  | 
  | 
# Just for searching - some day. | 
| 172 | 
  | 
  | 
 | 
| 173 | 
  | 
  | 
libsearchswish-e.a: $(SEARCH_LIB_OBJS) | 
| 174 | 
  | 
  | 
        $(AR) $(ARFLAGS) $@ $(SEARCH_LIB_OBJS) | 
| 175 | 
  | 
  | 
        $(RANLIB) libsearchswish-e.a | 
| 176 | 
  | 
  | 
 | 
| 177 | 
  | 
  | 
 | 
| 178 | 
  | 
  | 
libsearchtest: libsearchswish-e.a libtest.o | 
| 179 | 
  | 
  | 
        $(CC) -o $@ $(CFLAGS) $(LDFLAGS) libtest.o libsearchswish-e.a $(LIBS) | 
| 180 | 
  | 
  | 
        chmod 755 $@ | 
| 181 | 
  | 
  | 
         | 
| 182 | 
  | 
  | 
 | 
| 183 | 
  | 
  | 
 | 
| 184 | 
  | 
  | 
# | 
| 185 | 
  | 
  | 
# dependencies | 
| 186 | 
  | 
  | 
#  | 
| 187 | 
  | 
  | 
*.o: *.h | 
| 188 | 
  | 
  | 
 | 
| 189 | 
  | 
  | 
*.c: *.h | 
| 190 | 
  | 
  | 
 | 
| 191 | 
  | 
  | 
$(XPDIR)/xmltok/*.o: $(XPDIR)/xmltok/*.h | 
| 192 | 
  | 
  | 
$(XPDIR)/xmlparse/*.o: $(XPDIR)/xmlparse/*.h | 
| 193 | 
  | 
  | 
 | 
| 194 | 
  | 
  | 
 |