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