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