A lot of work on scan. Tables used to display scan terms and hits.
[egate.git] / www / Makefile
1 # Makefile for www gateway utility
2 # Europagate, 1995
3 #
4 # $Id: Makefile,v 1.27 1996/01/26 15:50:06 adam Exp $
5 #
6 SHELL=/bin/sh
7 #
8 ZDEFS=
9 ZINC=-I../../yaz/include
10 ZLIB=../../yaz/lib/libyaz.a
11 MOSILIB=../../xtimosi/src/libmosi.a -lrfc
12 LIBIRTCL=../../ir-tcl/libirtcl.a $(ZLIB) $(MOSILIB)
13 #NETLIB=-lnsl -lsocket
14 #
15 OLIB=../lib/util.a ../lib/libres+log.a 
16 TCLLIB=/usr/local/lib/libtcl7.4.a
17 TCLINC=-I/usr/local/include
18 #
19 WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \
20  mtargets.egw mquery.egw msearch.egw history.egw tform.egw tdefine.egw
21 HSCRIPTS=egwindex.html
22 CONFFILES=ztargets.conf
23 TPROG1=egwcgi
24 TPROG2=egwsh
25 TPROG3=wtest
26 P1=wcgi.o
27 P2=wproto.o winterp.o wsh.o wtcl.o whtml.o wirtcl.o
28 P3=wproto.o wtest.o
29 CPP=$(CC) -E
30
31 HTTPDDIR=/usr/local/etc/httpd
32 CGIDIR=$(HTTPDDIR)/cgi-bin
33 HTDOCS=$(HTTPDDIR)/htdocs
34 EGWDIR=$(HTTPDDIR)/egw
35 LOGDIR=$(HTTPDDIR)/logs
36 GIFDIR=$(HTDOCS)/egwgif
37
38 #HTTPDDIR=/usr/local/www
39 #CGIDIR=/usr/local/www/cgi-bin
40 #HTDOCS=/data2/html/egw/html
41 #EGWDIR=/data2/html/egw/scripts
42 #LOGDIR=/data2/html/egw/logs
43 #GIFDIR=/data2/html/egw/gif
44
45 INCLUDE=-I../include $(ZINC) $(TCLINC)
46 DEFS=$(INCLUDE) $(ZDEFS) -DCGIDIR=\"$(CGIDIR)\" -DEGWDIR=\"$(EGWDIR)\" \
47  -DLOGDIR=\"$(LOGDIR)\"
48
49 all: $(TPROG1) $(TPROG2)
50
51 $(TPROG1): $(P1) $(OLIB)
52         $(CC) $(CFLAGS) -o $(TPROG1) $(P1) $(OLIB) $(ZLIB)
53
54 $(TPROG2): $(P2) $(OLIB)
55         $(CC) $(CFLAGS) -o $(TPROG2) $(P2) $(OLIB) $(LIBIRTCL) \
56                 $(NETLIB) $(TCLLIB) -lm
57
58 $(TPROG3): $(P3) $(OLIB)
59         $(CC) $(CFLAGS) -o $(TPROG3) $(P3) $(OLIB) $(ZLIB)
60
61 install: install.prog install.script install.gif
62
63 install.prog: $(TPROG1) $(TPROG2)
64         @for x in $(TPROG1) $(TPROG2); do \
65                 echo Installing $$x; \
66                 cp $$x $(CGIDIR); \
67                 chmod a+x $(CGIDIR)/$$x; \
68         done; \
69         for p in egwtcl egwirtcl egwhtml; do \
70                 rm -f $(CGIDIR)/$$p; \
71                 ln $(CGIDIR)/$(TPROG2) $(CGIDIR)/$$p; \
72         done
73
74 install.script:
75         @if [ ! -d $(EGWDIR) ]; then \
76                 echo "Making directory $(EGWDIR)"; \
77                 mkdir $(EGWDIR); \
78         fi        
79         @for x in $(WSCRIPTS); do \
80                 echo Installing $$x; \
81                 cp $$x $(EGWDIR)/$$x; \
82         done
83         @for x in $(HSCRIPTS); do \
84                 echo Installing $$x; \
85                 cp $$x $(HTDOCS); \
86         done
87         @for x in $(CONFFILES); do \
88                 echo Installing $$x; \
89                 cp $$x $(EGWDIR); \
90         done
91
92 install.gif:
93         @if [ ! -d $(GIFDIR) ]; then \
94                 echo "Making directory $(GIFDIR)"; \
95                 mkdir $(GIFDIR); \
96         fi        
97         @for x in gif/*.gif; do \
98                 echo Installing $$x; \
99                 cp $$x $(GIFDIR); \
100         done
101
102 .c.o:
103         $(CC) -c $(DEFS) $(CFLAGS) $<
104
105 clean:
106         rm -f *.log *.[oa] $(TPROG1) $(TPROG2) $(TPROG3) 
107         rm -f core mon.out gmon.out errlist *~
108
109 depend: depend2
110
111 depend1:
112         sed '/^#Depend/q' <Makefile >Makefile.tmp
113         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
114         mv -f Makefile.tmp Makefile
115
116 depend2:
117         $(CPP) $(DEFS) -M *.c >.depend  
118
119 #GNU make style depend
120 ifeq (.depend,$(wildcard .depend))
121 include .depend
122 endif
123
124 #Depend --- DOT NOT DELETE THIS LINE