OSDN Git Service

GNU_coreutils: Refactor the make system.
authorAkihiro MOTOKI <amotoki@gmail.com>
Thu, 12 Apr 2012 19:18:24 +0000 (04:18 +0900)
committerAkihiro MOTOKI <amotoki@gmail.com>
Thu, 12 Apr 2012 19:18:24 +0000 (04:18 +0900)
Deploying the source code is done in Makefile in the top dir.
Makefile in help2man.ja now dedicated to generate manpages by help2man.

manual/GNU_coreutils/.gitignore [new file with mode: 0644]
manual/GNU_coreutils/Makefile [new file with mode: 0644]
manual/GNU_coreutils/help2man.ja/.gitignore [new file with mode: 0644]
manual/GNU_coreutils/help2man.ja/Makefile

diff --git a/manual/GNU_coreutils/.gitignore b/manual/GNU_coreutils/.gitignore
new file mode 100644 (file)
index 0000000..a9c152a
--- /dev/null
@@ -0,0 +1,4 @@
+coreutils-*/
+source
+coreutils-*.tar.*
+stamp-*
diff --git a/manual/GNU_coreutils/Makefile b/manual/GNU_coreutils/Makefile
new file mode 100644 (file)
index 0000000..d43505a
--- /dev/null
@@ -0,0 +1,64 @@
+NAME = coreutils
+V = 8.16
+
+DEST = draft/man1
+
+# You must compile coreutils in advance.
+# Use 'make all_programs' to compile binaries which are not
+# compiled in default (like arch, hostname).
+#srcdir = $(HOME)/JM-work/coreutils-8.16
+srcdir = ./$(NAME)-$(V)
+tarball = $(NAME)-$(V).tar.xz
+
+PACKAGE_NAME = GNU $(NAME)
+PACKAGE_VERSION = $(V)
+PACKAGE_STRING = $(PACKAGE_NAME) $(PACKAGE_VERSION)
+
+all:   build-man
+
+tarball:       $(tarball)
+$(tarball):
+       wget http://core.ring.gr.jp/pub/GNU/coreutils/$@
+
+stamp-setup:   $(tarball)
+       tar xJf $^
+       ln -s $(srcdir) source
+       @(cd source \
+         && git init \
+         && git add . \
+         && git commit -m 'Import $(PACKAGE_NAME).' > /dev/null \
+       )
+       mkdir -p source/locale/$(LANG)/LC_MESSAGES
+       touch $@
+
+stamp-configure:       stamp-setup
+       @(cd source && ./configure --localedir=`pwd`/locale)
+       touch stamp-configure
+
+stamp-build:   stamp-configure
+       @(cd source \
+        && make \
+        && cd src \
+        && make all_programs \
+       )
+       touch $@
+
+build-man:
+       $(MAKE) -C help2man.ja $@ PACKAGE_VERSION=$(PACKAGE_VERSION)
+
+install:       build-man
+       $(MAKE) -C help2man.ja $@
+
+clean:
+       $(MAKE) -C help2man.ja $@
+
+clean-build:
+       (cd source && make distclean)
+       $(RM) stamp-configure stamp-build
+
+clean-setup:
+       $(RM) -r $(srcdir)
+       $(RM) source
+       $(RM) stamp-setup stamp-configure stamp-build
+
+realclean:     clean-setup clean
diff --git a/manual/GNU_coreutils/help2man.ja/.gitignore b/manual/GNU_coreutils/help2man.ja/.gitignore
new file mode 100644 (file)
index 0000000..f7e585b
--- /dev/null
@@ -0,0 +1 @@
+*.1
index 0eeaa8c..8dcd16b 100644 (file)
@@ -1,5 +1,9 @@
-NAME = coreutils
-V = 8.16
+PACKAGE_STRING = GNU coreutils
+srcdir = ../source
+DEST = ../draft/man1
+
+FILES = $(wildcard *.x)
+MANPAGES = $(patsubst %.x,%.1,$(FILES))
 
 LANG = ja_JP.UTF-8
 HELP2MAN = /usr/bin/help2man
@@ -7,21 +11,6 @@ LN_S = ln -s
 INSTALL = install
 AM_V_GEN = @echo "  GEN     " $@;
 
-FILES = $(wildcard *.x)
-MANPAGES = $(patsubst %.x,%.1,$(FILES))
-DEST = ../draft/man1
-
-# You must compile coreutils in advance.
-# Use 'make all_programs' to compile binaries which are not
-# compiled in default (like arch, hostname).
-#srcdir = $(HOME)/JM-work/coreutils-8.16
-srcdir = ./$(NAME)-$(V)
-tarball = $(NAME)-$(V).tar.xz
-
-PACKAGE_NAME = GNU $(NAME)
-PACKAGE_VERSION = $(V)
-PACKAGE_STRING = $(PACKAGE_NAME) $(PACKAGE_VERSION)
-
 .SUFFIXES: .x .1
 
 # Ensure that help2man runs the ../src/ginstall binary as
@@ -32,52 +21,14 @@ mapped_name = `echo $*|sed 's/^install$$/ginstall/; s/^test$$/[/'`
 
 all:   build-man
 
-tarball:       $(tarball)
-$(tarball):
-       wget http://core.ring.gr.jp/pub/GNU/coreutils/$@
-
-stamp-setup:   $(tarball)
-       tar xJf $^
-       @(cd $(srcdir) \
-         && git init \
-         && git add . \
-         && git commit -m 'Import $(PACKAGE_NAME).' > /dev/null \
-       )
-       mkdir -p $(srcdir)/locale/$(LANG)/LC_MESSAGES
-       touch $@
-
-stamp-configure:       stamp-setup
-       @(cd $(srcdir) && ./configure --localedir=`pwd`/locale)
-       touch stamp-configure
-
-stamp-build:   stamp-configure
-       @(cd $(srcdir) \
-        && make \
-        && cd src \
-        && make all_programs \
-       )
-       touch $@
-
 build-man:     $(MANPAGES)
 
-$(MANPAGES):   stamp-build
-
 install:       build-man
        $(INSTALL) --mode=644 $(MANPAGES) $(DEST)
 
 clean:
        $(RM) $(MANPAGES)
 
-clean-build:
-       (cd $(srcdir) && make distclean)
-       $(RM) stamp-configure stamp-build
-
-clean-setup:
-       $(RM) -r $(srcdir)
-       $(RM) stamp-setup stamp-configure stamp-build
-
-realclean:     clean-setup clean
-
 .x.1:
        $(AM_V_GEN)rm -f $@ $@-t                                        \
        && {                                            \
@@ -85,7 +36,7 @@ realclean:    clean-setup clean
             mkdir $t;                                  \
             sed -e '/^\.\\\"O/d' ./$*.x > $t/$*.x;     \
             (cd $t && $(LN_S) ../$(srcdir)/src/$(mapped_name) $*); \
-               $(HELP2MAN)                             \
+            $(HELP2MAN)                                \
                --locale=$(LANG)                        \
                --source='$(PACKAGE_STRING)'            \
                --include=$t/$*.x                       \