From bfffda6171175500a16a36785ed414b251f826cf Mon Sep 17 00:00:00 2001
From: j8takagi <j8takagi@nifty.com>
Date: Thu, 1 Nov 2012 18:53:28 +0900
Subject: [PATCH] =?utf8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?=
 =?utf8?q?=E5=8F=8D=E6=98=A0=E3=81=AE=E4=BB=95=E7=B5=84=E3=81=BF=E3=82=92?=
 =?utf8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 Makefile                            | 12 +++++++-----
 VERSION                             |  2 +-
 src/Makefile                        |  7 +++++--
 test/system/casl2/opt_h/0.txt       |  2 +-
 test/system/casl2/opt_opterr/0.txt  |  2 +-
 test/system/casl2/opt_v/0.txt       |  1 +
 test/system/comet2/opt_h/0.txt      |  2 +-
 test/system/comet2/opt_opterr/0.txt |  2 +-
 test/system/comet2/opt_v/0.txt      |  1 +
 test/system/dumpword/opt_v/0.txt    |  1 +
 10 files changed, 20 insertions(+), 12 deletions(-)
 create mode 100644 test/system/casl2/opt_v/0.txt
 create mode 100644 test/system/comet2/opt_v/0.txt
 create mode 100644 test/system/dumpword/opt_v/0.txt

diff --git a/Makefile b/Makefile
index 6e145d7..5d57356 100644
--- a/Makefile
+++ b/Makefile
@@ -6,16 +6,17 @@ WHICH ?= which
 ECHO ?= echo
 INSTALL ?= install
 SED ?= sed
+CAT ?= cat
 
 prefix ?= ~
 bindir ?= $(prefix)/bin
-casl2libdir ?= $(prefix)/yacasl2/casl2lib
+casl2libdir ?= $(prefix)/lib/casl2
 
 VERSIONFILES = include/package.h test/system/casl2/opt_v/0.txt test/system/comet2/opt_v/0.txt test/system/dumpword/opt_v/0.txt
 
 all: build info html gtags
 
-build: version
+build:
 	$(MAKE) -C src all
 
 gtags:
@@ -55,10 +56,11 @@ install-casl2lib:
 uninstall-casl2lib:
 	@$(MAKE) -C as/casl2lib uninstall-casl2lib
 
-version: $(VERSIONFILES)
+version: VERSION $(VERSIONFILES)
+	@$(ECHO) "YACASL2 Version:" `$(CAT) VERSION`
 
-$(VERSIONFILES):
-	for f in $(VERSIONFILES); do $(SED) -e "s/@@VERSION@@/`cat VERSION`/g" $$f.version >$$f; done
+$(VERSIONFILES): VERSION
+	$(SED) -e "s/@@VERSION@@/`cat VERSION`/g" $@.version >$@
 
 clean: clean-src clean-gtags clean-doc clean-doc-inner clean-version
 
diff --git a/VERSION b/VERSION
index e6ea989..48bfc31 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2p0
+0.2p2
diff --git a/src/Makefile b/src/Makefile
index afb82a6..1da58bf 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -13,9 +13,12 @@ CASL2SRC := struct.c hash.c
 ASSRC := assemble.c token.c label.c
 EXECSRC := exec.c dump.c
 
-.PHONY: all clean
+.PHONY: all version clean
 
-all: ../casl2 ../comet2 ../dumpword ctags etags
+all: version ../casl2 ../comet2 ../dumpword ctags etags
+
+version:
+	$(MAKE) -C .. version
 
 ../casl2: casl2.o $(subst .c,.o,$(COMMONSRC) $(CASL2SRC) $(ASSRC) $(EXECSRC))
 	$(CC) $(CFLAGS) -o $@ $^
diff --git a/test/system/casl2/opt_h/0.txt b/test/system/casl2/opt_h/0.txt
index 335b97e..bf49402 100644
--- a/test/system/casl2/opt_h/0.txt
+++ b/test/system/casl2/opt_h/0.txt
@@ -1 +1 @@
-Usage: ../../../../casl2 [-slLaAtTdh] [-oO[<OBJECTFILE>]] [-M <MEMORYSIZE>] [-C <CLOCKS>] FILE1[ FILE2  ...]
+Usage: ../../../../casl2 [-slLaAtTdvh] [-oO[<OBJECTFILE>]] [-M <MEMORYSIZE>] [-C <CLOCKS>] FILE1[ FILE2  ...]
diff --git a/test/system/casl2/opt_opterr/0.txt b/test/system/casl2/opt_opterr/0.txt
index 335b97e..bf49402 100644
--- a/test/system/casl2/opt_opterr/0.txt
+++ b/test/system/casl2/opt_opterr/0.txt
@@ -1 +1 @@
-Usage: ../../../../casl2 [-slLaAtTdh] [-oO[<OBJECTFILE>]] [-M <MEMORYSIZE>] [-C <CLOCKS>] FILE1[ FILE2  ...]
+Usage: ../../../../casl2 [-slLaAtTdvh] [-oO[<OBJECTFILE>]] [-M <MEMORYSIZE>] [-C <CLOCKS>] FILE1[ FILE2  ...]
diff --git a/test/system/casl2/opt_v/0.txt b/test/system/casl2/opt_v/0.txt
new file mode 100644
index 0000000..f945c59
--- /dev/null
+++ b/test/system/casl2/opt_v/0.txt
@@ -0,0 +1 @@
+casl2 of YACASL2 version 0.2p2
diff --git a/test/system/comet2/opt_h/0.txt b/test/system/comet2/opt_h/0.txt
index b4b0041..9385315 100644
--- a/test/system/comet2/opt_h/0.txt
+++ b/test/system/comet2/opt_h/0.txt
@@ -1 +1 @@
-Usage: ../../../../comet2 [-tTdh] [-M <MEMORYSIZE>] [-C <CLOCKS>] FILE
+Usage: ../../../../comet2 [-tTdvh] [-M <MEMORYSIZE>] [-C <CLOCKS>] FILE
diff --git a/test/system/comet2/opt_opterr/0.txt b/test/system/comet2/opt_opterr/0.txt
index b4b0041..9385315 100644
--- a/test/system/comet2/opt_opterr/0.txt
+++ b/test/system/comet2/opt_opterr/0.txt
@@ -1 +1 @@
-Usage: ../../../../comet2 [-tTdh] [-M <MEMORYSIZE>] [-C <CLOCKS>] FILE
+Usage: ../../../../comet2 [-tTdvh] [-M <MEMORYSIZE>] [-C <CLOCKS>] FILE
diff --git a/test/system/comet2/opt_v/0.txt b/test/system/comet2/opt_v/0.txt
new file mode 100644
index 0000000..3953d3b
--- /dev/null
+++ b/test/system/comet2/opt_v/0.txt
@@ -0,0 +1 @@
+comet2 of YACASL2 version 0.2p2
diff --git a/test/system/dumpword/opt_v/0.txt b/test/system/dumpword/opt_v/0.txt
new file mode 100644
index 0000000..2841fe6
--- /dev/null
+++ b/test/system/dumpword/opt_v/0.txt
@@ -0,0 +1 @@
+dumpword of YACASL2 version 0.2p2
-- 
2.18.0