Minor changes.
[egate.git] / Makefile
1 # Top level Makefile for the Z39.50 gateway (Web and email)
2 # Europagate, 1995-1996.
3 #
4 # $Id: Makefile,v 1.34 1996/06/06 11:10:04 adam Exp $
5 #
6 SHELL=/bin/sh
7 MAKE=make
8 #CC=checkergcc
9 CPP=$(CC) -E
10
11 # Email gateway settings --------------------------------------
12
13 # Directory for the email gateway files
14 EMAILLIBDIR=/usr/local/lib/emailgw
15
16 # GNU regex package location
17 #REGEXOBJ=../../../pd-src/regex-0.12/regex.o
18 #REGEXINC=-I../../../pd-src/regex-0.12
19
20 # WWW gateway settings ----------------------------------------
21
22 # Install directories
23 HTTPDDIR=/usr/local/etc/httpd
24 CGIDIR=$(HTTPDDIR)/cgi-bin
25 HTDOCS=$(HTTPDDIR)/htdocs
26 EGWDIR=$(HTTPDDIR)/egw
27 GIFDIR=$(HTDOCS)/egwgif
28
29 # Location of Tcl
30 TCLLIB=/usr/local/lib/libtcl7.5.a -lm
31 TCLINC=-I/usr/local/include
32
33 # Location of IrTcl
34 IRTCLDIR=../ir-tcl
35 IRTCLLIB=$(IRTCLDIR)/libirtcl.a
36 IRTCLINC=-I$(IRTCLDIR)
37
38 # Common settings ---------------------------------------------
39
40 # Other libraries libraries needed on some systems
41 #ELIB=-lnsl -lsocket
42
43 # If you are using YAZ uncomment these lines
44 ZACC=zlayer-yaz
45 ZINC=-I../yaz/include
46 ZLIB=../yaz/lib/libyaz.a
47 ZDEFS=
48
49 # If you are using Zdist uncomment these lines
50 #ZACC=zlayer-zdist
51 #ZINC=-I/home/proj/zdist/zdist102b1-1/libz3950
52 #ZLIB=/home/proj/zdist/zdist102b1-1/libz3950/libz3950.a
53 #ZDEFS=-DLOW_TO_HIGH -Dfar=
54
55 # End of settings ---------------------------------------------
56 # You probably don't have to edit the things below.
57
58 SUBDIR=res+log util ccl fml $(ZACC) kernel www
59
60 SUBDIREMAIL=res+log util ccl fml $(ZACC) kernel
61 SUBDIRWWW=res+log util www
62
63 all:
64         @echo "Type 'make email' to make email gateway"
65         @echo "Type 'make web' to make web gateway"
66
67 alll:
68         for i in $(SUBDIR); do cd $$i; if $(MAKE) CFLAGS="$(CFLAGS)" CC="$(CC)" ZINC="$(ZINC)" ZLIB="$(ZLIB)" CPP="$(CPP)" ELIB="$(ELIB)" REGEXOBJ="$(REGEXOBJ)" REGEXINC="$(REGEXINC)" ZDEFS="$(ZDEFS)" TCLLIB="$(TCLLIB)" TCLINC="$(TCLINC)" IRTCLLIB="$(IRTCLLIB)" IRTCLINC="$(IRTCLINC)" EGWDIR="$(EGWDIR)"; then cd ..; else exit 1; fi; done
69
70 email:
71         for i in $(SUBDIREMAIL); do cd $$i; if $(MAKE) CFLAGS="$(CFLAGS)" CC="$(CC)" ZINC="$(ZINC)" ZLIB="$(ZLIB)" CPP="$(CPP)" ELIB="$(ELIB)" REGEXOBJ="$(REGEXOBJ)" REGEXINC="$(REGEXINC)" ZDEFS="$(ZDEFS)"; then cd ..; else exit 1; fi; done
72
73 web:
74         for i in $(SUBDIRWWW); do cd $$i; if $(MAKE) CFLAGS="$(CFLAGS)" CC="$(CC)" ZINC="$(ZINC)" ZLIB="$(ZLIB)" CPP="$(CPP)" ELIB="$(ELIB)" ZDEFS="$(ZDEFS)" TCLLIB="$(TCLLIB)" TCLINC="$(TCLINC)" IRTCLLIB="$(IRTCLLIB)" IRTCLINC="$(IRTCLINC)" EGWDIR="$(EGWDIR)"; then cd ..; else exit 1; fi; done
75
76 dep depend:
77         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
78
79 install.email:
80         @if [ ! -d $(EMAILLIBDIR) ]; then \
81                 echo "Making directory $(EMAILLIBDIR)"; \
82                 mkdir $(EMAILLIBDIR); \
83         fi
84         @cd kernel; for i in eti monitor kernel; do \
85                 echo "Installing $$i"; \
86                 cp $$i $(EMAILLIBDIR); chmod +x $(EMAILLIBDIR)/$$i; \
87         done
88         @cd kernel; for i in *.res *.bib *.fml; do \
89                 echo "Installing $$i"; \
90                 cp $$i $(EMAILLIBDIR);\
91         done
92
93 install.web:
94         cd www; $(MAKE) HTTPDDIR="$(HTTPDDIR)" CGIDIR="$(CGIDIR)" HTDOCS="$(HTDOCS)" EGWDIR="$(EGWDIR)" GIFDIR="$(GIFDIR)" install
95
96 clean:
97         -rm -f lib/*.a
98         for i in $(SUBDIR); do (cd $$i; $(MAKE) clean); done
99
100 distclean: clean cleandepend
101
102 cleandepend: 
103         for i in $(SUBDIR); do (cd $$i; \
104                 if sed '/^#Depend/q' <Makefile >Makefile.tmp; then \
105                 mv -f Makefile.tmp Makefile; fi; rm -f .depend); done
106
107 taildepend:
108         for i in $(SUBDIR); do (cd $$i; \
109                 if sed 's/^if/#GNUif/'<Makefile|sed 's/^include/#GNUinclude/'| \
110                 sed 's/^endif/#GNUendif/' | \
111                 sed 's/^depend: depend2/depend: depend1/g' | \
112                 sed '/^#Depend/q' >Makefile.tmp; then \
113                 mv -f Makefile.tmp Makefile; fi); done
114
115 gnudepend:
116         for i in $(SUBDIR); do (cd $$i; \
117                 if sed '/^#Depend/q' <Makefile| \
118                 sed 's/^#GNUif/if/' |sed 's/^#GNUinclude/include/'| \
119                 sed 's/^#GNUendif/endif/' | \
120                 sed 's/^depend: depend1/depend: depend2/g' >Makefile.tmp;then \
121                 mv -f Makefile.tmp Makefile; fi); done
122
123 wc:
124         wc `find . -name '*.[ch]'`