OSDN Git Service

GNU_coreutils: Define a Makefile target to compile PO file.
[linuxjm/coreutils.git] / Makefile
1 NAME = coreutils
2 V = 8.16
3
4 DEST = draft/man1
5
6 # You must compile coreutils in advance.
7 # Use 'make all_programs' to compile binaries which are not
8 # compiled in default (like arch, hostname).
9 #srcdir = $(HOME)/JM-work/coreutils-8.16
10 srcdir = ./$(NAME)-$(V)
11 tarball = $(NAME)-$(V).tar.xz
12
13 PACKAGE_NAME = GNU $(NAME)
14 PACKAGE_VERSION = $(V)
15 PACKAGE_STRING = $(PACKAGE_NAME) $(PACKAGE_VERSION)
16
17 all:    build-man
18
19 #------------------------------------------------------------
20
21 tarball:        $(tarball)
22 $(tarball):
23         wget http://core.ring.gr.jp/pub/GNU/coreutils/$@
24
25 stamp-setup:    $(tarball)
26         tar xJf $^
27         ln -s $(srcdir) source
28         @(cd source \
29           && git init \
30           && git add . \
31           && git commit -m 'Import $(PACKAGE_NAME).' > /dev/null \
32         )
33         mkdir -p source/locale/$(LANG)/LC_MESSAGES
34         touch $@
35
36 stamp-configure:        stamp-setup
37         @(cd source && ./configure --localedir=`pwd`/locale)
38         touch stamp-configure
39
40 stamp-build:    stamp-configure
41         @(cd source \
42          && make \
43          && cd src \
44          && make all_programs \
45         )
46         touch $@
47
48 #------------------------------------------------------------
49
50 mo-ja = source/locale/$(LANG)/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:      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