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