Port to OSF/1. Gif references moved from /gif/ to /egwgif/.
[egate.git] / www / Makefile
1 # Makefile for www gateway utility
2 # Europagate, 1995
3 #
4 # $Id: Makefile,v 1.22 1996/01/09 16:16:47 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
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=$(HTDICS)/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)
52         $(CC) $(CFLAGS) -o $(TPROG1) $(P1) $(OLIB)
53
54 $(TPROG2): $(P2)
55         $(CC) $(CFLAGS) -o $(TPROG2) $(P2) $(OLIB) $(LIBIRTCL) \
56                 $(NETLIB) $(TCLLIB) -lm
57
58 $(TPROG3): $(P3)
59         $(CC) $(CFLAGS) -o $(TPROG3) $(P3) $(OLIB)
60
61 install: install.prog install.script
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         @for x in gif/*.gif; do \
92                 echo Installing $$x; \
93                 cp $$x $(GIFDIR); \
94         done
95
96 .c.o:
97         $(CC) -c $(DEFS) $(CFLAGS) $<
98
99 clean:
100         rm -f *.log *.[oa] $(TPROG1) $(TPROG2) $(TPROG3) 
101         rm -f core mon.out gmon.out errlist *~
102
103 depend: depend2
104
105 depend1:
106         sed '/^#Depend/q' <Makefile >Makefile.tmp
107         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
108         mv -f Makefile.tmp Makefile
109
110 depend2:
111         $(CPP) $(DEFS) -M *.c >.depend  
112
113 #GNU make style depend
114 ifeq (.depend,$(wildcard .depend))
115 include .depend
116 endif
117
118 #Depend --- DOT NOT DELETE THIS LINE