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