# Copyright (C) 1994, Index Data I/S
# All rights reserved.
# Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile,v 1.3 1994-08-18 08:21:06 quinn Exp $
+# $Id: Makefile,v 1.16 1995-10-06 09:04:03 adam Exp $
SHELL=/bin/sh
-INCLUDE=-I../include
-TPROG=dicttest
-CFLAGS=-g -Wall
+RANLIB=ranlib
+YAZ=../../yaz
+YAZLIB=$(YAZ)/lib/libyaz.a
+INCLUDE=-I../include -I$(YAZ)/include
+TPROG1=dicttest
+TPROG2=dictext
+#CFLAGS=-g -Wall -pedantic -ansi
DEFS=$(INCLUDE)
LIB=../lib/dict.a
-PO = dopen.o dclose.o drdwr.o open.o close.o insert.o lookup.o
+PO = scan.o dopen.o dclose.o drdwr.o open.o close.o insert.o lookup.o \
+ lookupec.o lookgrep.o
CPP=cc -E
all: $(LIB)
-$(TPROG): $(TPROG).o $(LIB)
- $(CC) -o $(TPROG) $(TPROG).o $(LIB) ../lib/bfile.a ../lib/util.a
+alll: $(LIB) $(TPROG1) $(TPROG2)
+
+$(TPROG1): $(TPROG1).o $(LIB) ../lib/bfile.a ../lib/alexutil.a ../lib/dfa.a
+ $(CC) $(CFLAGS) -o $(TPROG1) $(TPROG1).o $(LIB) \
+ ../lib/bfile.a ../lib/dfa.a ../lib/alexutil.a $(YAZLIB)
+
+$(TPROG2): $(TPROG2).o $(LIB) ../lib/alexutil.a $(YAZLIB)
+ $(CC) $(CFLAGS) -o $(TPROG2) $(TPROG2).o ../lib/alexutil.a $(YAZLIB)
$(LIB): $(PO)
rm -f $(LIB)
ar qc $(LIB) $(PO)
- ranlib $(LIB)
+ $(RANLIB) $(LIB)
.c.o:
$(CC) -c $(DEFS) $(CFLAGS) $<
clean:
- rm -f *.[oa] $(TPROG) core mon.out gmon.out errlist
+ rm -f *.[oa] $(TPROG1) $(TPROG2) core mon.out gmon.out errlist
+
+depend: depend2
-dep depend:
- $(CPP) $(INCLUDE) -M *.c >.depend
+depend1:
+ sed '/^#Depend/q' <Makefile >Makefile.tmp
+ $(CPP) $(DEFS) -M *.c >>Makefile.tmp
+ mv -f Makefile.tmp Makefile
-#ifeq (.depend,$(wildcard .depend))
+depend2:
+ $(CPP) $(DEFS) -M *.c >.depend
+
+ifeq (.depend,$(wildcard .depend))
include .depend
-#endif
+endif
+
+#Depend --- DOT NOT DELETE THIS LINE