Incorporated WAIS functionality.
[egate.git] / www / Makefile
1 # Makefile for www gateway utility
2 # Europagate, 1995
3 #
4 # $Id: Makefile,v 1.32 1996/02/29 15:41:38 adam Exp $
5 #
6 SHELL=/bin/sh
7
8 ZLIB=../../yaz/lib/libyaz.a
9
10 IRTCLDIR=../../ir-tcl
11 IRTCLLIB=$(IRTCLDIR)/libirtcl.a
12 IRTCLINC=-I$(IRTCLDIR)
13
14 #MOSILIB=../../xtimosi/src/libmosi.a ../../yaz/lib/librfc.a
15 #NETLIB=-lnsl -lsocket
16
17 OLIB=../lib/util.a ../lib/libres+log.a 
18 TCLLIB=/usr/local/lib/libtcl7.5.a
19 TCLINC=
20
21 WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \
22  mtargets.egw mquery.egw msearch.egw history.egw tform.egw tdefine.egw
23 HSCRIPTS=egwindex.html
24 CONFFILES=egw.res ztargets.conf
25 TPROG1=egwcgi
26 TPROG2=egwsh
27 TPROG3=wtest
28 TPROG4=egwwais
29 P1=wcgi.o
30 P2=wproto.o winterp.o wsh.o wtcl.o whtml.o wirtcl.o wshmain.o
31 P3=wproto.o wtest.o
32 P4=wproto.o winterp.o waissh.o wtcl.o wirtcl.o wshmain.o wwaistcl.o
33 CPP=$(CC) -E
34
35 HTTPDDIR=/usr/local/etc/httpd
36 CGIDIR=$(HTTPDDIR)/cgi-bin
37 HTDOCS=$(HTTPDDIR)/htdocs
38 EGWDIR=$(HTTPDDIR)/egw
39 LOGDIR=$(HTTPDDIR)/logs
40 GIFDIR=$(HTDOCS)/egwgif
41
42 #HTTPDDIR=/usr/local/www
43 #CGIDIR=/usr/local/www/cgi-bin
44 #HTDOCS=/data2/html/egw/html
45 #EGWDIR=/data2/html/egw/scripts
46 #LOGDIR=/data2/html/egw/logs
47 #GIFDIR=/data2/html/egw/gif
48
49 INCLUDE=-I../include $(TCLINC) $(IRTCLINC)
50 DEFS=$(INCLUDE) $(ZDEFS) -DEGWDIR=\"$(EGWDIR)\"
51
52 all: $(TPROG1) $(TPROG2)
53
54 $(TPROG1): $(P1) $(OLIB)
55         $(CC) $(CFLAGS) -o $(TPROG1) $(P1) $(OLIB)
56
57 $(TPROG2): $(P2) $(OLIB)
58         $(CC) $(CFLAGS) -o $(TPROG2) $(P2) $(OLIB) $(IRTCLLIB) \
59                 $(ZLIB) $(MOSILIB) $(NETLIB) $(TCLLIB) -lm
60
61 $(TPROG3): $(P3) $(OLIB)
62         $(CC) $(CFLAGS) -o $(TPROG3) $(P3) $(OLIB)
63
64
65 WAISDIR=../../freeWAIS-sf-2.0
66 WAISLIB=$(IRTCLDIR)/wais-tcl.o $(WAISDIR)/ir/libwais.a
67
68 $(TPROG4): $(P4) $(OLIB)
69         $(CC) $(CFLAGS) -o $(TPROG4) $(P4) $(OLIB) $(IRTCLLIB) \
70                 $(WAISLIB) $(ZLIB) $(MOSILIB) $(NETLIB) $(TCLLIB) -lm
71
72 install: install.prog install.script install.gif
73
74 install.prog: $(TPROG1) $(TPROG2)
75         @if [ ! -d $(CGIDIR) ]; then \
76                 echo "Making directory $(CGIDIR)"; \
77                 mkdir $(CGIDIR); \
78         fi        
79         @if [ ! -d $(EGWDIR) ]; then \
80                 echo "Making directory $(EGWDIR)"; \
81                 mkdir $(EGWDIR); \
82         fi        
83         @for x in $(TPROG1); do \
84                 echo Installing $$x; \
85                 cp $$x $(CGIDIR); \
86                 chmod a+x $(CGIDIR)/$$x; \
87         done; \
88         for x in $(TPROG2); do \
89                 echo Installing $$x; \
90                 cp $$x $(EGWDIR); \
91                 chmod a+x $(EGWDIR)/$$x; \
92         done; \
93         for p in egwtcl egwirtcl egwhtml; do \
94                 rm -f $(EGWDIR)/$$p; \
95                 ln $(EGWDIR)/$(TPROG2) $(EGWDIR)/$$p; \
96         done
97
98 install.script:
99         @if [ ! -d $(EGWDIR) ]; then \
100                 echo "Making directory $(EGWDIR)"; \
101                 mkdir $(EGWDIR); \
102         fi        
103         @if [ ! -d $(HTDOCS) ]; then \
104                 echo "Making directory $(HTDOCS)"; \
105                 mkdir $(HTDOCS); \
106         fi        
107         @for x in $(WSCRIPTS); do \
108                 echo Installing $$x; \
109                 cp $$x $(EGWDIR)/$$x; \
110         done
111         @for x in $(HSCRIPTS); do \
112                 echo Installing $$x; \
113                 cp $$x $(HTDOCS); \
114         done
115         @for x in $(CONFFILES); do \
116                 echo Installing $$x; \
117                 cp $$x $(EGWDIR); \
118         done
119
120 install.gif:
121         @if [ ! -d $(GIFDIR) ]; then \
122                 echo "Making directory $(GIFDIR)"; \
123                 mkdir $(GIFDIR); \
124         fi        
125         @for x in gif/*.gif; do \
126                 echo Installing $$x; \
127                 cp $$x $(GIFDIR); \
128         done
129
130 .c.o:
131         $(CC) -c $(DEFS) $(CFLAGS) $<
132
133 clean:
134         rm -f *.log *.[oa] $(TPROG1) $(TPROG2) $(TPROG3) 
135         rm -f core mon.out gmon.out errlist *~
136
137 depend: depend2
138
139 depend1:
140         sed '/^#Depend/q' <Makefile >Makefile.tmp
141         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
142         mv -f Makefile.tmp Makefile
143
144 depend2:
145         $(CPP) $(DEFS) -M *.c >.depend  
146
147 #GNU make style depend
148 ifeq (.depend,$(wildcard .depend))
149 include .depend
150 endif
151
152 #Depend --- DOT NOT DELETE THIS LINE