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