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