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