Some utility functions
[infodrom.org/service.infodrom.org] / Makefile
1 hostname=$(shell hostname)
2
3 ifeq ($(hostname),finlandia)
4 DEST = $(HOME)/public_html/new/service
5 else
6 ifeq ($(hostname),luonnotar)
7 DEST = /var/www/service.infodrom.org
8 else
9 ifeq ($(hostname),kyllikki)
10 DEST = $(HOME)/public_html/new/service
11 endif
12 endif
13 endif
14
15 FILES = --exclude "CVS/" --exclude "*imgdot-1x1-transp.gif" --include "*/"
16 FILES+= --include "*.html" --include "*.shtml" --include "*.php"
17 FILES+= --include "*.png" --include "*.gif" --include "*.jpg"
18 FILES+= --include "*.js"
19 FILES+= --include "*.css"
20 FILES+= --include favicon.ico
21 ifeq ($(hostname),luonnotar)
22 FILES+= --include .htaccess
23 FILES+= --exclude Infodrom/webstats/
24 endif
25 FILES+= --exclude "*"
26
27 build:
28         make -C src all
29
30 ifeq ($(hostname),finlandia)
31 test:
32         test -d $(DEST) || mkdir -p $(DEST)
33         rsync -lptr $(FILES) src/ $(DEST)/
34 #       cd src && for f in *.html; do cp $$f $(TEST)/$$f; done
35 endif
36
37 fix:
38 #        for f in src/index.*.php; do \
39 #          sed '1,/width="40"/ s/width="40"/width="250"/' < $$f > tmp; \
40 #          mv -f tmp $$f; \
41 #          sed '1,/width="40"/ s/width="40"/width="400"/' < $$f > tmp; \
42 #          mv -f tmp $$f; \
43 #        done
44
45 install: fix
46         test -d $(DEST) || mkdir -p $(DEST)
47         rsync -lptr $(FILES) src/ $(DEST)/
48 #       cd src && for f in *.html; do cp $$f $(DEST)/$$f; done
49         test -L /var/www/service.infodrom.org/Infodrom/stats/mailgraph.cgi || \
50             ln -s /usr/lib/cgi-bin/mailgraph.cgi \
51                 /var/www/service.infodrom.org/Infodrom/stats/mailgraph.cgi
52
53 clean:
54         -rm -f `find -name '*~'` `find -name '.?*.swp'`
55         -make -C src clean
56         -make -C Styles clean
57
58 depend:
59         make -C src rdepend