OSDN Git Service

Add --delete option to rsync to remove obsolete files from WWWROOT.
[linuxjm/jm.git] / www / Makefile
1 #
2 # Makefile for contents in www
3 #
4 include ../JM.rules
5
6 ifndef WORKDIR
7         WORKDIR = /var/tmp/JM
8 endif
9
10 ifndef DATE
11         DATE := $(shell env LANG=C date +"%Y%m%d")
12 endif
13
14 .SUFFIXES: .m4 .html
15
16 .m4.html:
17         m4 -P -D _WORKDIR=$(WORKDIR) $*.m4 | cat -s | nkf -j > $*.html
18
19 CONTENTS = index.html download.html section.html copyright.html \
20         README.html INSTALL.html \
21         missing.html nosuchpage.html manerror.html mail_error.html \
22         news.html news2001.html news2000.html news1999.html \
23         news2002.html news2003.html news2004.html news2005.html news2006.html
24 #
25 # rules
26 #
27 all: contents
28         make -C INDEX/
29         make -C guidance/ WWWROOT=$(WWWROOT)
30         make -C man-ja/
31         make -C rpm/ DATE=$(DATE)
32         make -C announcement/
33
34 contents: $(CONTENTS)
35
36 *.html: jm_www.m4
37
38 index.html: news.m4 ../stamp/latest-archive-modified
39
40 README.html: ../dist/README
41
42 INSTALL.html: ../dist/INSTALL
43
44 ../dist/README ../dist/INSTALL:
45         $(MAKE) -C .. -f Makefile.dist
46
47 download.html: download.m4 ../stamp/latest-archive-modified
48         m4 -P -D _WORKDIR=$(WORKDIR) -D _DATE=$(DATE) $< | nkf -j > $@
49
50 ../stamp/latest-archive-modified:
51         make -C .. stamp/latest-archive-modified
52
53 clean:
54         @rm -f $(CONTENTS) *.tar.gz
55         -$(RM) -rf per-pkg/
56         -$(RM) -f rpm/*.rpm rpm/index.html
57         make -C INDEX/ clean
58         make -C guidance/ clean
59         make -C man-ja/ clean
60         make -C announcement/ clean
61
62 install: all
63         $(MAKE) -C guidance  WWWROOT=$(WWWROOT) install
64         $(RSYNC) -a --delete -v \
65         --exclude='bin' \
66         --exclude='*.m4' \
67         --exclude='*.perl' \
68         --exclude='*.list' \
69         --exclude='Makefile' \
70         --exclude='ChangeLog' \
71         --exclude='.gitignore' \
72         * $(WWWROOT)
73         $(MAKE) -C ../admin/site WWWROOT=$(WWWROOT) install