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