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