Lots of changes. They aren't visible though.
[egate.git] / Makefile
1 # Top level Makefile for Email gateway.
2 # Europagate, 1994-1995.
3 #
4 # $Id: Makefile,v 1.29 1996/02/29 15:33:18 adam Exp $
5 #
6 SHELL=/bin/sh
7 MAKE=make
8 #CC=checkergcc
9 CPP=$(CC) -E
10 LIBDIR=/usr/local/lib/emailgw
11
12 # GNU regex package location
13 #REGEXOBJ=../../../pd-src/regex-0.12/regex.o
14 #REGEXINC=-I../../../pd-src/regex-0.12
15
16 # Other libraries libraries needed on some systems
17 #NETLIB=-lnsl -lsocket
18
19 # Location of Tcl
20 TCLLIB=/usr/local/lib/libtcl7.5.a
21 TCLINC=
22
23 # Location of IrTcl
24 IRTCLDIR=../../ir-tcl
25 IRTCLLIB=$(IRTCLDIR)/libirtcl.a
26 IRTCLINC=-I$(IRTCLDIR)
27
28 # If you are using YAZ uncomment these lines
29 ZACC=zlayer-yaz
30 ZINC=-I../../yaz/include
31 ZLIB=../../yaz/lib/libyaz.a
32 ZDEFS=
33
34 # If you are using Zdist uncomment these lines
35 #ZACC=zlayer-zdist
36 #ZINC=-I/home/proj/zdist/zdist102b1-1/libz3950
37 #ZLIB=/home/proj/zdist/zdist102b1-1/libz3950/libz3950.a
38 #ZDEFS=-DLOW_TO_HIGH -Dfar=
39
40 SUBDIR=res+log util ccl fml $(ZACC) kernel www
41
42 all:
43         for i in $(SUBDIR); do cd $$i; if $(MAKE) CFLAGS="$(CFLAGS)" CC="$(CC)" ZINC="$(ZINC)" ZLIB="$(ZLIB)" CPP="$(CPP)" NETLIB="$(NETLIB)" REGEXOBJ="$(REGEXOBJ)" REGEXINC="$(REGEXINC)" ZDEFS="$(ZDEFS)" TCLLIB="$(TCLLIB)" TCLINC="$(TCLINC)" IRTCLLIB="$(IRTCLLIB)" IRTCLINC="$(IRTCLINC)"; then cd ..; else exit 1; fi; done
44
45 dep depend:
46         for i in $(SUBDIR); do cd $$i; if $(MAKE) CFLAGS="$(CFLAGS)" CC="$(CC)" ZINC="$(ZINC)" CPP="$(CPP)" REGEXINC="$(REGEXINC)" ZDEFS="$(ZDEFS)" TCLINC="$(TCLINC)" IRTCLINC="$(IRTCLINC)" depend; then cd ..; else exit 1; fi; done
47
48 install:
49         @if [ ! -d $(LIBDIR) ]; then \
50                 echo "Making directory $(LIBDIR)"; \
51                 mkdir $(LIBDIR); \
52         fi
53         @cd kernel; for i in eti monitor kernel; do \
54                 echo "Installing $$i"; \
55                 cp $$i $(LIBDIR); chmod +x $(LIBDIR)/$$i; \
56         done
57         @cd kernel; for i in *.res *.bib *.fml; do \
58                 echo "Installing $$i"; \
59                 cp $$i $(LIBDIR);\
60         done
61                 
62 clean:
63         -rm -f lib/*.a
64         for i in $(SUBDIR); do (cd $$i; $(MAKE) clean); done
65
66 distclean: clean cleandepend
67
68 cleandepend: 
69         for i in $(SUBDIR); do (cd $$i; \
70                 if sed '/^#Depend/q' <Makefile >Makefile.tmp; then \
71                 mv -f Makefile.tmp Makefile; fi; rm -f .depend); done
72
73 taildepend:
74         for i in $(SUBDIR); do (cd $$i; \
75                 if sed 's/^if/#GNUif/'<Makefile|sed 's/^include/#GNUinclude/'| \
76                 sed 's/^endif/#GNUendif/' | \
77                 sed 's/^depend: depend2/depend: depend1/g' | \
78                 sed '/^#Depend/q' >Makefile.tmp; then \
79                 mv -f Makefile.tmp Makefile; fi); done
80
81 gnudepend:
82         for i in $(SUBDIR); do (cd $$i; \
83                 if sed '/^#Depend/q' <Makefile| \
84                 sed 's/^#GNUif/if/' |sed 's/^#GNUinclude/include/'| \
85                 sed 's/^#GNUendif/endif/' | \
86                 sed 's/^depend: depend1/depend: depend2/g' >Makefile.tmp;then \
87                 mv -f Makefile.tmp Makefile; fi); done
88
89 wc:
90         wc `find . -name '*.[ch]'`
91