Initial files, copied, partially adjusted already
[infodrom.org/luonnotar.infodrom.org] / src / Makefile
1 WML_FILES = $(wildcard *.wml)
2 FILES = $(WML_FILES:%.wml=%.html)
3 SFILES = $(WML_FILES:%.wml=%.shtml)
4 PFILES = $(WML_FILES:%.wml=%.php3)
5
6 DIRS = $(shell find . -maxdepth 1 -type d -not -name . -not -name CVS)
7
8 ROOT_PREFIX = $(shell perl -MCwd -e '$$_ = cwd;s/^.*src\/?//;@f=split /\//;$$n=$$\#f+1;print "../"x $$n;' )
9
10 IFLAGS = -I. -I$(ROOT_PREFIX)../Styles
11
12 .SUFFIXES: .wml .html
13
14 .wml.html:
15         /usr/bin/wml -n $(IFLAGS) $*.wml| sed 's:"\([a-zA-Z0-9_\.-]*\.\)\?imgdot-1x1-transp\(-ffffff\)\?\.gif":"$(ROOT_PREFIX)gifs/imgdot-1x1-transp.gif":' > $*.html
16         $(ROOT_PREFIX)../bin/fixsuffix $*.html
17
18 all: $(FILES)
19         test -z "$(DIRS)" || for d in "" $(DIRS); do if [ -n "$$d" ]; then (cp Makefile $$d && cd $$d && make all); fi; done
20
21 dir: $(FILES)
22
23 clean:
24         rm -f $(FILES) $(SFILES) $(PFILES) .depend *.imgdot-1x1-transp.gif imgdot-1x1-transp.gif
25         test -z "$(DIRS)" || for d in "" $(DIRS); do if [ -n "$$d" ]; then (cp Makefile $$d && cd $$d && make clean); fi; done
26         test -z "$(ROOT_PREFIX)" || rm -f Makefile
27
28 install:
29         cd $(ROOT_PREFIX).. && make install
30
31 test:
32         cd $(ROOT_PREFIX).. && make test
33
34 depend .depend:
35         $(ROOT_PREFIX)../bin/wmldepend.sh $(IFLAGS) $(WML_FILES) > .depend
36
37 rdepend:
38         make depend
39         test -z "$(DIRS)" || for d in "" $(DIRS); do if [ -n "$$d" ]; then (cp Makefile $$d && cd $$d && make rdepend); fi; done
40
41 include .depend