Bug fix: didn't use correct database(s) when 'all' checkbox was selected.
[egate.git] / www / Makefile
1 # Makefile for www gateway utility
2 # Europagate, 1995
3 #
4 # $Log: Makefile,v $
5 # Revision 1.16  1995/11/14 16:01:50  adam
6 # Bug fix: didn't use correct database(s) when 'all' checkbox was selected.
7 #
8 # Revision 1.15  1995/11/13  18:17:46  adam
9 # Better error handling.
10 #
11 # Revision 1.14  1995/11/13  15:41:40  adam
12 # Arrow gifs.
13 # Gateway uses record element set names B(rief) and F(ull).
14 # Bug fix. Didn't save idAuthentication correctly.
15 #
16 # Revision 1.13  1995/11/08  18:07:22  adam
17 # Minor changes.
18 #
19 # Revision 1.12  1995/11/08  16:14:32  adam
20 # Many improvements and bug fixes.
21 # First version that ran on dtbsun.
22 #
23 # Revision 1.11  1995/11/07  14:56:58  adam
24 # Work on search in multiple targets.
25 # New wtcl command: wlog.
26 # Optional timeout parameter to zwait.
27 #
28 # Revision 1.10  1995/11/07  10:44:29  adam
29 # Work on search in multiple targets.
30 #
31 # Revision 1.9  1995/11/06  17:44:20  adam
32 # State reestablised when shell restarts. History of previous
33 # result sets.
34 #
35 # Revision 1.8  1995/11/06  10:51:14  adam
36 # End of response marker in response from wsh/wproto to wcgi.
37 # Shells are respawned when necessary.
38 #
39 # Revision 1.7  1995/10/31  16:56:23  adam
40 # Record presentation.
41 #
42 # Revision 1.6  1995/10/27  17:30:15  adam
43 # First search request/response that works.
44 #
45 # Revision 1.5  1995/10/27  15:12:02  adam
46 # IrTcl incorporated in the gateway.
47 # Better separation of script types.
48 # Z39.50 gateway scripts entered.
49 #
50 # Revision 1.4  1995/10/23  17:04:16  adam
51 # Added some initial z39 gateway scripts.
52 #
53 # Revision 1.3  1995/10/23  16:55:33  adam
54 # A lot of changes - really.
55 #
56 # Revision 1.2  1995/10/20  14:02:40  adam
57 # First version of WWW gateway with embedded Tcl.
58 #
59 # Revision 1.1  1995/10/20  11:49:24  adam
60 # First version of www gateway.
61 #
62 SHELL=/bin/sh
63 #
64 ZDEFS=
65 ZINC=-I../../yaz/include
66 ZLIB=../../yaz/lib/libyaz.a
67 #MOSILIB=../../xtimosi/src/libmosi.a ../../yaz/lib/librfc.a
68 LIBIRTCL=/usr/local/lib/libirtcl.a $(ZLIB) $(MOSILIB)
69 #NETLIB=-lnsl -lsocket
70 #
71 OLIB=../lib/util.a ../lib/libres+log.a 
72 TCLLIB=/usr/local/lib/libtcl.a
73 #
74 WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \
75  mtargets.egw mquery.egw msearch.egw
76 HSCRIPTS=egwindex.html
77 CONFFILES=ztargets.conf
78 GIFFILES=webgate.gif darrw.gif uarrw.gif noway.gif
79 TPROG1=egwcgi
80 TPROG2=egwsh
81 TPROG3=wtest
82 P1=wcgi.o
83 P2=wproto.o winterp.o wsh.o wtcl.o whtml.o wirtcl.o
84 P3=wproto.o wtest.o
85 CPP=$(CC) -E
86 #
87 INCLUDE=-I../include $(ZINC)
88 DEFS=$(INCLUDE) $(ZDEFS)
89
90 HTTPDDIR=/usr/local/etc/httpd
91 CGIBIN=$(HTTPDDIR)/cgi-bin
92 HTDOCS=$(HTTPDDIR)/htdocs
93 CONFDIR=$(HTTPDDIR)/conf
94 GIFDIR=$(HTDOCS)/gif
95
96 all: $(TPROG1) $(TPROG2)
97
98 $(TPROG1): $(P1)
99         $(CC) $(CFLAGS) -o $(TPROG1) $(P1) $(OLIB)
100
101 $(TPROG2): $(P2)
102         $(CC) $(CFLAGS) -o $(TPROG2) $(P2) $(OLIB) $(LIBIRTCL) \
103                 $(NETLIB) $(TCLLIB) -lm
104
105 $(TPROG3): $(P3)
106         $(CC) $(CFLAGS) -o $(TPROG3) $(P3) $(OLIB)
107
108 install: install.prog install.script
109
110 install.prog: $(TPROG1) $(TPROG2)
111         @for x in $(TPROG1) $(TPROG2); do \
112                 echo Installing $$x; \
113                 cp $$x $(CGIBIN); \
114                 chmod +x $(CGIBIN)/$$x; \
115         done; \
116         for p in egwtcl egwirtcl egwhtml; do \
117                 rm -f $(CGIBIN)/$$p; \
118                 ln $(CGIBIN)/$(TPROG2) $(CGIBIN)/$$p; \
119         done
120
121 install.script:
122         @for x in $(WSCRIPTS); do \
123                 echo Installing $$x; \
124                 cp $$x $(CGIBIN); \
125         done
126         @for x in $(HSCRIPTS); do \
127                 echo Installing $$x; \
128                 cp $$x $(HTDOCS); \
129         done
130         @for x in $(CONFFILES); do \
131                 echo Installing $$x; \
132                 cp $$x $(CONFDIR); \
133         done
134         @for x in $(GIFFILES); do \
135                 echo Installing $$x; \
136                 cp $$x $(GIFDIR); \
137         done
138
139 .c.o:
140         $(CC) -c $(DEFS) $(CFLAGS) $<
141
142 clean:
143         rm -f *.log *.[oa] $(TPROG1) $(TPROG2) $(TPROG3) 
144         rm -f core mon.out gmon.out errlist *~
145
146 depend: depend2
147
148 depend1:
149         sed '/^#Depend/q' <Makefile >Makefile.tmp
150         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
151         mv -f Makefile.tmp Makefile
152
153 depend2:
154         $(CPP) $(DEFS) -M *.c >.depend  
155
156 #GNU make style depend
157 ifeq (.depend,$(wildcard .depend))
158 include .depend
159 endif
160
161 #Depend --- DOT NOT DELETE THIS LINE