OSDN Git Service

Translate common strings
[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 ja.po/ja.po.$(V) ]; then \
33           rm -f source/po/ja.po; \
34           ln -s ../../ja.po/ja.po.$(V) source/po/ja.po; \
35         else \
36           echo "No JM-maintained ja.po found for $(V)."; \
37         fi
38         touch $@
39
40 stamp-configure:        stamp-setup
41         @(cd source && ./configure --localedir=`pwd`/locale)
42         touch stamp-configure
43
44 stamp-build:    stamp-configure
45         @(cd source \
46          && make \
47          && make src/arch \
48          && make src/hostname \
49          && make man/arch.1 \
50          && make man/hostname.1 \
51         )
52         touch $@
53
54 #------------------------------------------------------------
55
56 mo-ja = source/locale/ja/LC_MESSAGES/coreutils.mo
57 gmo-ja = source/po/ja.gmo
58 po-ja = source/po/ja.po
59
60 $(mo-ja):       $(gmo-ja)
61         /bin/cp $^ $@
62
63 $(gmo-ja):      $(po-ja)
64         $(MAKE) -C source/po $$(basename $@)
65
66 catalog:        $(mo-ja)
67
68 build-man:      stamp-build catalog
69         $(MAKE) -C help2man.ja $@ PACKAGE_VERSION=$(PACKAGE_VERSION)
70
71 install:        build-man
72         $(MAKE) -C help2man.ja $@
73
74 clean:
75         $(MAKE) -C help2man.ja $@
76
77 clean-build:
78         (cd source && make distclean)
79         $(RM) stamp-configure stamp-build
80
81 clean-setup:
82         $(RM) -r $(srcdir)
83         $(RM) source
84         $(RM) stamp-setup stamp-configure stamp-build
85
86 realclean:      clean-setup clean
87
88 #------------------------------------------------------------
89
90 MAN2HTML = ../../admin/man-1.6g/man2html/man2html
91
92 html:   html-setup html-gen html-index
93
94 html-setup:
95         @set -e; if [ ! -e html ]; then \
96           echo "  MKDIR    html."; \
97           mkdir html; \
98         fi; \
99         for d in draft/man?; do \
100           dm=html/$$(basename $$d); \
101           echo "  MKDIR    $$dm"; \
102           mkdir -p $$dm; \
103         done
104
105 html-gen:
106         @set -e; for f in draft/man?/*.[1-8]; do \
107           n=$$(basename $$f); \
108           t=$$(echo $$f | cut -d / -f 2-3); \
109           o=original/$$t; \
110           echo "  GEN      html/$${t}.html"; \
111           $(MAN2HTML) $$f | tail -n +3 > html/$${t}.draft.html; \
112           $(MAN2HTML) $$o | tail -n +3 > html/$${t}.orig.html; \
113           printf "<html>\n" > html/$${t}.html; \
114           printf "<head><title>$$n</title></head>\n" >> html/$${t}.html; \
115           printf "<frameset cols=\"50%%,50%%\">\n" >> html/$${t}.html; \
116           printf "  <frame src=\"$$n.orig.html\" name=\"orig\" />\n" >> html/$${t}.html; \
117           printf "  <frame src=\"$$n.draft.html\" name=\"draft\" />\n" >> html/$${t}.html; \
118           printf "</frameset></html>\n" >> html/$${t}.html; \
119         done
120
121 html-index:
122         @set -e; echo "  GEN      index.html"; \
123         idx=html/index.html; \
124         printf "<html><head><title>" > $$idx; \
125         printf "Drafts of $(PACKAGE_STRING)</title></head>\n" >> $$idx; \
126         printf "<body><h1>Drafts of $(PACKAGE_STRING)</h1>\n<ul>\n" >> $$idx; \
127         for f in draft/man?/*.[1-8]; do \
128           t=$$(echo $$f | cut -d / -f 2-3).html; \
129           printf "<li><a href=\"$$t\">$$(basename $$f)</a></li>\n" >> $$idx; \
130         done; \
131         printf "</ul><hr>$$(LC_ALL=C date)</body></html>\n" >> $$idx