d6b50c2f8bf5c9ce5274410a0c8c5bbb0973f4ec
[idzebra-moved-to-github.git] / dfa / Makefile
1 # Copyright (C) 1994, Index Data I/S 
2 # All rights reserved.
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile,v 1.12 1995-11-20 11:57:58 adam Exp $
5
6 SHELL=/bin/sh
7 RANLIB=ranlib
8
9 YAZLIB=-lyaz
10 YAZINC=
11
12 INCLUDE=-I../include $(YAZINC)
13 TPROG1=agrep
14 TPROG2=lexer
15 TPROG3=grepper
16 DEFS=$(INCLUDE) -DMEMDEBUG=1
17 LIB=../lib/dfa.a 
18 PO = dfa.o imalloc.o states.o set.o bset.o
19 CPP=$(CC) -E
20
21 all: $(LIB)
22
23 alll: $(LIB) $(TPROG1) $(TPROG2) $(TPROG3)
24
25 $(TPROG1): $(TPROG1).o $(LIB) ../lib/alexutil.a $(YAZLIB)
26         $(CC) $(CFLAGS) -o $(TPROG1) $(TPROG1).o $(LIB) \
27                 ../lib/alexutil.a $(YAZLIB)
28
29 $(TPROG2): $(TPROG2).o readfile.o $(LIB) ../lib/alexutil.a $(YAZLIB)
30         $(CC) $(CFLAGS) -o $(TPROG2) $(TPROG2).o readfile.o $(LIB) \
31                 ../lib/alexutil.a $(YAZLIB)
32
33 $(TPROG3): $(TPROG3).o $(LIB) ../lib/alexutil.a $(YAZLIB)
34         $(CC) $(CFLAGS) -o $(TPROG3) $(TPROG3).o $(LIB) $(YAZLIB) \
35                 ../lib/alexutil.a $(YAZLIB)
36
37 $(LIB): $(PO)
38         rm -f $(LIB)
39         ar qc $(LIB) $(PO)
40         $(RANLIB) $(LIB)
41
42 .c.o:
43         $(CC) -c $(DEFS) $(CFLAGS) $<
44
45 clean:
46         rm -f *.[oa] $(TPROG1) $(TPROG2) $(TPROG3) core mon.out gmon.out errlist
47
48 depend: depend2
49
50 depend1:
51         sed '/^#Depend/q' <Makefile >Makefile.tmp
52         $(CPP) -M $(DEFS) *.c >>Makefile.tmp
53         mv -f Makefile.tmp Makefile
54
55 depend2:
56         $(CPP) -M $(DEFS) *.c >.depend
57
58 ifeq (.depend,$(wildcard .depend))
59 include .depend
60 endif
61
62 #Depend --- DOT NOT DELETE THIS LINE