OSDN Git Service

Release pages for coreutils 8.25
[linuxjm/coreutils.git] / Makefile
1 NAME = coreutils
2 V = 8.25
3
4 DEST = draft/man1
5
6 # You must compile coreutils in advance.
7 srcdir = ./$(NAME)-$(V)
8 tarball = $(NAME)-$(V).tar.xz
9
10 PACKAGE_NAME = GNU $(NAME)
11 PACKAGE_VERSION = $(V)
12 PACKAGE_STRING = $(PACKAGE_NAME) $(PACKAGE_VERSION)
13
14 all:    build-man
15 source: stamp-build
16
17 #------------------------------------------------------------
18
19 tarball:        $(tarball)
20 $(tarball):
21         wget http://core.ring.gr.jp/pub/GNU/coreutils/$@
22
23 stamp-setup:    $(tarball)
24         tar xJf $^
25         ln -s $(srcdir) source
26         @(cd source \
27           && git init \
28           && git add . \
29           && git commit -m 'Import $(PACKAGE_NAME).' > /dev/null \
30         )
31         mkdir -p source/locale/ja/LC_MESSAGES
32         @set -e ; if [ -f patch-$(V).diff ]; then \
33           patch -p0 < patch-$(V).diff; \
34         fi
35         @set -e ; if [ -f ja.po/ja.po.$(V) ]; then \
36           rm -f source/po/ja.po; \
37           ln -s ../../ja.po/ja.po.$(V) source/po/ja.po; \
38           echo "Use JM-maintained ja.po for translation."; \
39         else \
40           echo "No JM-maintained ja.po found for $(V)."; \
41         fi
42         touch $@
43
44 stamp-configure:        stamp-setup
45         @(cd source && ./configure --localedir=`pwd`/locale)
46         touch stamp-configure
47
48 stamp-build:    stamp-configure
49         @(cd source \
50          && make \
51          && make src/arch \
52          && make src/hostname \
53          && make man/arch.1 \
54          && make man/hostname.1 \
55         )
56         touch $@
57
58 #------------------------------------------------------------
59
60 mo-ja = source/locale/ja/LC_MESSAGES/coreutils.mo
61 gmo-ja = source/po/ja.gmo
62 po-ja = source/po/ja.po
63
64 $(mo-ja):       $(gmo-ja)
65         /bin/cp $^ $@
66
67 $(gmo-ja):      $(po-ja)
68         $(MAKE) -C source/po $$(basename $@)
69
70 catalog:        $(mo-ja)
71
72 build-man:      stamp-build catalog
73         $(MAKE) -C help2man.ja $@ PACKAGE_VERSION=$(PACKAGE_VERSION)
74
75 install:        build-man
76         $(MAKE) -C help2man.ja $@
77
78 clean:
79         $(MAKE) -C help2man.ja $@
80
81 clean-build:
82         (cd source && make distclean)
83         $(RM) stamp-configure stamp-build
84
85 clean-setup:
86         $(RM) -r $(srcdir)
87         $(RM) source
88         $(RM) stamp-setup stamp-configure stamp-build
89
90 realclean:      clean-setup clean
91
92 #------------------------------------------------------------
93
94 MAN2HTML = ../../admin/man-1.6g/man2html/man2html
95
96 html:   html-setup html-gen html-index
97
98 html-setup:
99         @set -e; if [ ! -e html ]; then \
100           echo "  MKDIR    html."; \
101           mkdir html; \
102         fi; \
103         for d in draft/man?; do \
104           dm=html/$$(basename $$d); \
105           echo "  MKDIR    $$dm"; \
106           mkdir -p $$dm; \
107         done
108
109 html-gen:
110         @set -e; for f in draft/man?/*.[1-8]; do \
111           n=$$(basename $$f); \
112           t=$$(echo $$f | cut -d / -f 2-3); \
113           o=original/$$t; \
114           echo "  GEN      html/$${t}.html"; \
115           $(MAN2HTML) $$f | tail -n +3 > html/$${t}.draft.html; \
116           $(MAN2HTML) $$o | tail -n +3 > html/$${t}.orig.html; \
117           printf "<html>\n" > html/$${t}.html; \
118           printf "<head><title>$$n</title></head>\n" >> html/$${t}.html; \
119           printf "<frameset cols=\"50%%,50%%\">\n" >> html/$${t}.html; \
120           printf "  <frame src=\"$$n.orig.html\" name=\"orig\" />\n" >> html/$${t}.html; \
121           printf "  <frame src=\"$$n.draft.html\" name=\"draft\" />\n" >> html/$${t}.html; \
122           printf "</frameset></html>\n" >> html/$${t}.html; \
123         done
124
125 html-index:
126         @set -e; echo "  GEN      index.html"; \
127         idx=html/index.html; \
128         printf "<html><head><title>" > $$idx; \
129         printf "Drafts of $(PACKAGE_STRING)</title></head>\n" >> $$idx; \
130         printf "<body><h1>Drafts of $(PACKAGE_STRING)</h1>\n<ul>\n" >> $$idx; \
131         for f in draft/man?/*.[1-8]; do \
132           t=$$(echo $$f | cut -d / -f 2-3).html; \
133           printf "<li><a href=\"$$t\">$$(basename $$f)</a></li>\n" >> $$idx; \
134         done; \
135         printf "</ul><hr>$$(LC_ALL=C date)</body></html>\n" >> $$idx