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