OSDN Git Service

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