# Copyright (C) 1994, Index Data I/S
# All rights reserved.
# Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile,v 1.2 1994-09-26 16:30:55 adam Exp $
+# $Id: Makefile,v 1.9 1995-09-15 09:32:08 adam Exp $
SHELL=/bin/sh
-INCLUDE=-I../include
+RANLIB=ranlib
+YAZ=../../yaz
+YAZLIB=$(YAZ)/lib/libyaz.a
+INCLUDE=-I../include -I$(YAZ)/include
TPROG1=agrep
TPROG2=lexer
-CFLAGS=-g -Wall -pedantic
+TPROG3=grepper
DEFS=$(INCLUDE) -DYACC -DYYDEBUG=1 -DMEMDEBUG=1
LIB=../lib/dfa.a
-PO = regexp.o imalloc.o states.o set.o bset.o
+PO = dfa.o imalloc.o states.o set.o bset.o
CPP=cc -E
-YACC=yacc
all: $(LIB)
-$(TPROG1): $(TPROG1).o $(LIB)
- $(CC) $(CFLAGS) -o $(TPROG1) $(TPROG1).o $(LIB) ../lib/util.a
+alll: $(LIB) $(TPROG1) $(TPROG2) $(TPROG3)
-$(TPROG2): $(TPROG2).o readfile.o $(LIB)
- $(CC) $(CFLAGS) -o $(TPROG2) $(TPROG2).o readfile.o \
- $(LIB) ../lib/util.a
+$(TPROG1): $(TPROG1).o $(LIB) ../lib/alexutil.a $(YAZLIB)
+ $(CC) $(CFLAGS) -o $(TPROG1) $(TPROG1).o $(LIB) \
+ ../lib/alexutil.a $(YAZLIB)
+
+$(TPROG2): $(TPROG2).o readfile.o $(LIB) ../lib/alexutil.a $(YAZLIB)
+ $(CC) $(CFLAGS) -o $(TPROG2) $(TPROG2).o readfile.o $(LIB) \
+ ../lib/alexutil.a $(YAZLIB)
+
+$(TPROG3): $(TPROG3).o $(LIB) ../lib/alexutil.a $(YAZLIB)
+ $(CC) $(CFLAGS) -o $(TPROG3) $(TPROG3).o $(LIB) $(YAZLIB) \
+ ../lib/alexutil.a $(YAZLIB)
$(LIB): $(PO)
rm -f $(LIB)
ar qc $(LIB) $(PO)
- ranlib $(LIB)
+ $(RANLIB) $(LIB)
.c.o:
$(CC) -c $(DEFS) $(CFLAGS) $<
-.y.o:
- $(YACC) $(YFLAGS) $<
- $(CC) -c $(DEFS) $(CFLAGS) y.tab.c
- mv y.tab.o $*.o
-
clean:
- rm -f *.[oa] $(TPROG1) $(TPROG2) core mon.out gmon.out errlist y.tab.c
+ rm -f *.[oa] $(TPROG1) $(TPROG2) $(TPROG3) core mon.out gmon.out errlist
depend: depend2
depend1:
- mv Makefile Makefile.tmp
- $(YACC) $(YFLAGS) regexp.y
- sed '/^#Depend/q' <Makefile.tmp >Makefile
- $(CPP) -M $(DEFS) *.c |sed 's/y\.tab\.o/regexp.o/g'|sed 's/y\.tab\.c/regexp.y/g' >>Makefile
- -rm Makefile.tmp
+ sed '/^#Depend/q' <Makefile >Makefile.tmp
+ $(CPP) -M $(DEFS) *.c >>Makefile.tmp
+ mv -f Makefile.tmp Makefile
depend2:
- $(YACC) $(YFLAGS) regexp.y
- $(CPP) -M $(DEFS) *.c |sed 's/y\.tab\.o/regexp.o/g'|sed 's/y\.tab\.c/regexp.y/g' >.depend
+ $(CPP) -M $(DEFS) *.c >.depend
ifeq (.depend,$(wildcard .depend))
include .depend