First version of WWW gateway with embedded Tcl.
[egate.git] / www / Makefile
1 # Makefile for www gateway utility
2 # Europagate, 1995
3 #
4 # $Log: Makefile,v $
5 # Revision 1.2  1995/10/20 14:02:40  adam
6 # First version of WWW gateway with embedded Tcl.
7 #
8 # Revision 1.1  1995/10/20  11:49:24  adam
9 # First version of www gateway.
10 #
11 SHELL=/bin/sh
12 INCLUDE=-I../include
13 #CFLAGS=-g -Wall -pedantic -ansi
14 OLIB=../lib/libres+log.a
15 TCLLIB=/usr/local/lib/libtcl7.5.a
16 WSCRIPTS=egwscript
17 HSCRIPTS=egwindex.html
18 TPROG1=egwcgi
19 TPROG2=egwsh
20 TPROG3=wtest
21 P1=wcgi.o
22 P2=wproto.o winterp.o wsh.o wtcl.o whtml.o
23 P3=wproto.o wtest.o
24 CPP=$(CC) -E
25 DEFS=$(INCLUDE)
26
27 HTTPDDIR=/usr/local/etc/httpd
28 CGIBIN=$(HTTPDDIR)/cgi-bin
29 HTDOCS=$(HTTPDDIR)/htdocs
30
31 all: $(TPROG1) $(TPROG2)
32
33 $(TPROG1): $(P1)
34         $(CC) $(CFLAGS) -o $(TPROG1) $(P1) $(OLIB)
35
36 $(TPROG2): $(P2)
37         $(CC) $(CFLAGS) -o $(TPROG2) $(P2) $(OLIB) $(TCLLIB) -lm
38
39 $(TPROG3): $(P3)
40         $(CC) $(CFLAGS) -o $(TPROG3) $(P3) $(OLIB)
41
42 install: $(TPROG1) $(TPROG2)
43         @for x in $(TPROG1) $(TPROG2); do \
44                 echo Installing $$x; \
45                 cp $$x $(CGIBIN); \
46                 chmod +x $(CGIBIN)/$$x; \
47         done
48         @for x in $(WSCRIPTS); do \
49                 echo Installing $$x; \
50                 cp $$x $(CGIBIN); \
51         done
52         @for x in $(HSCRIPTS); do \
53                 echo Installing $$x; \
54                 cp $$x $(HTDOCS); \
55         done
56
57 .c.o:
58         $(CC) -c $(DEFS) $(CFLAGS) $<
59
60 clean:
61         rm -f *.log *.[oa] $(TPROG1) $(TPROG2) $(TPROG3) 
62         rm -f core mon.out gmon.out errlist *~
63
64 depend: depend2
65
66 depend1:
67         sed '/^#Depend/q' <Makefile >Makefile.tmp
68         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
69         mv -f Makefile.tmp Makefile
70
71 depend2:
72         $(CPP) $(DEFS) -M *.c >.depend  
73
74 #GNU make style depend
75 ifeq (.depend,$(wildcard .depend))
76 include .depend
77 endif
78
79 #Depend --- DOT NOT DELETE THIS LINE