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