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