mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* common.mk (REVISION_H): keeps timestamp of revision.h.
[ruby-core:22900] * tool/ifchange, win32/ifchange.bat: extended --timestamp option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
40819d4599
commit
2bb561ea5f
4 changed files with 61 additions and 17 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Mon Mar 16 12:30:07 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* common.mk (REVISION_H): keeps timestamp of revision.h.
|
||||||
|
[ruby-core:22900]
|
||||||
|
|
||||||
|
* tool/ifchange, win32/ifchange.bat: extended --timestamp option.
|
||||||
|
|
||||||
Mon Mar 16 09:28:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Mar 16 09:28:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* Makefile.in, common.mk, win32/Makefile.sub: added preprocessing rules.
|
* Makefile.in, common.mk, win32/Makefile.sub: added preprocessing rules.
|
||||||
|
|
13
common.mk
13
common.mk
|
@ -16,6 +16,7 @@ STATIC_RUBY = static-ruby
|
||||||
EXTCONF = extconf.rb
|
EXTCONF = extconf.rb
|
||||||
RBCONFIG = ./.rbconfig.time
|
RBCONFIG = ./.rbconfig.time
|
||||||
LIBRUBY_EXTS = ./.libruby-with-ext.time
|
LIBRUBY_EXTS = ./.libruby-with-ext.time
|
||||||
|
REVISION_H = ./.revision.time
|
||||||
RDOCOUT = $(EXTOUT)/rdoc
|
RDOCOUT = $(EXTOUT)/rdoc
|
||||||
ID_H_TARGET = -id.h-
|
ID_H_TARGET = -id.h-
|
||||||
|
|
||||||
|
@ -657,7 +658,8 @@ srcs-ext: $(EXT_SRCS)
|
||||||
srcs-enc: $(ENC_MK)
|
srcs-enc: $(ENC_MK)
|
||||||
$(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) srcs
|
$(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) srcs
|
||||||
|
|
||||||
incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}transdb.h {$(VPATH)}known_errors.inc $(srcdir)/revision.h
|
incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}transdb.h {$(VPATH)}known_errors.inc \
|
||||||
|
$(srcdir)/revision.h $(REVISION_H)
|
||||||
|
|
||||||
insns: $(INSNS)
|
insns: $(INSNS)
|
||||||
|
|
||||||
|
@ -687,9 +689,12 @@ prereq: incs srcs preludes
|
||||||
preludes: {$(VPATH)}miniprelude.c
|
preludes: {$(VPATH)}miniprelude.c
|
||||||
preludes: {$(srcdir)}golf_prelude.c
|
preludes: {$(srcdir)}golf_prelude.c
|
||||||
|
|
||||||
$(srcdir)/revision.h: $(srcdir)/version.h $(srcdir)/ChangeLog $(srcdir)/tool/file2lastrev.rb $(REVISION_FORCE)
|
$(srcdir)/revision.h:
|
||||||
@-$(BASERUBY) $(srcdir)/tool/file2lastrev.rb --revision.h "$(@D)" > "$@.tmp"
|
@exit > $@
|
||||||
@$(IFCHANGE) "$@" "$@.tmp"
|
|
||||||
|
$(REVISION_H): $(srcdir)/version.h $(srcdir)/ChangeLog $(srcdir)/tool/file2lastrev.rb $(REVISION_FORCE)
|
||||||
|
@-$(BASERUBY) $(srcdir)/tool/file2lastrev.rb --revision.h "$(srcdir)" > "$(srcdir)/revision.tmp"
|
||||||
|
@$(IFCHANGE) "--timestamp=$@" "$(srcdir)/revision.h" "$(srcdir)/revision.tmp"
|
||||||
|
|
||||||
$(EXT_SRCS):
|
$(EXT_SRCS):
|
||||||
$(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) top_srcdir=../.. srcdir=.
|
$(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) top_srcdir=../.. srcdir=.
|
||||||
|
|
|
@ -1,11 +1,22 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# usage: ifchange target temporary
|
# usage: ifchange target temporary
|
||||||
|
|
||||||
unset timestamp
|
timestamp=
|
||||||
if [ "$1" = --timestamp ]; then
|
until [ "$0" = 0 ]; do
|
||||||
timestamp=yes
|
case "$1" in
|
||||||
|
--timestamp)
|
||||||
|
timestamp=.
|
||||||
|
;;
|
||||||
|
--timestamp=*)
|
||||||
|
timestamp="${1#*=}" || timestamp=`expr "$1" : '[^=]*=\(.*\)'`
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
shift
|
shift
|
||||||
fi
|
done
|
||||||
|
|
||||||
target="$1"
|
target="$1"
|
||||||
temp="$2"
|
temp="$2"
|
||||||
if [ "$temp" = - ]; then
|
if [ "$temp" = - ]; then
|
||||||
|
@ -13,6 +24,7 @@ if [ "$temp" = - ]; then
|
||||||
cat > "$temp" || exit $?
|
cat > "$temp" || exit $?
|
||||||
trap 'rm -f "$temp"' 0
|
trap 'rm -f "$temp"' 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if cmp "$target" "$temp" >/dev/null 2>&1; then
|
if cmp "$target" "$temp" >/dev/null 2>&1; then
|
||||||
echo "$target unchanged"
|
echo "$target unchanged"
|
||||||
rm -f "$temp"
|
rm -f "$temp"
|
||||||
|
@ -20,6 +32,18 @@ else
|
||||||
echo "$target updated"
|
echo "$target updated"
|
||||||
mv -f "$temp" "$target"
|
mv -f "$temp" "$target"
|
||||||
fi
|
fi
|
||||||
if [ $timestamp ]; then
|
|
||||||
touch `dirname "$target"`/.time.`basename "$target"`
|
if [ -n "${timestamp}" ]; then
|
||||||
|
if [ x"${timestamp}" = x. ]; then
|
||||||
|
case "$target" in
|
||||||
|
*/*)
|
||||||
|
timestamp="${target%/*}"/.time."${target##*/}" ||
|
||||||
|
timestamp=`dirname "$target"`/.time.`basename "$target"`
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
timestamp=.time."$target"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
: > "$timestamp"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,13 +1,20 @@
|
||||||
@echo off
|
@echo off
|
||||||
:: usage: ifchange target temporary
|
:: usage: ifchange target temporary
|
||||||
|
|
||||||
if "%1" == "" goto :end
|
|
||||||
|
|
||||||
set timestamp=
|
set timestamp=
|
||||||
if "%1" == "--timestamp" (
|
:optloop
|
||||||
set timestamp=yes
|
for %%I in (%1) do set opt=%%~I
|
||||||
|
if "%opt%" == "--timestamp" (
|
||||||
|
set timestamp=.
|
||||||
shift
|
shift
|
||||||
|
goto :optloop
|
||||||
|
) else if "%opt:~0,12%" == "--timestamp=" (
|
||||||
|
set timestamp=%opt:~12%
|
||||||
|
shift
|
||||||
|
goto :optloop
|
||||||
)
|
)
|
||||||
|
if "%opt%" == "" goto :end
|
||||||
|
|
||||||
set dest=%1
|
set dest=%1
|
||||||
set src=%2
|
set src=%2
|
||||||
set dest=%dest:/=\%
|
set dest=%dest:/=\%
|
||||||
|
@ -63,7 +70,8 @@ del %src%
|
||||||
|
|
||||||
:nt_end
|
:nt_end
|
||||||
if "%timestamp%" == "" goto :end
|
if "%timestamp%" == "" goto :end
|
||||||
for %%I in ("%dest%") do set timestamp=%%~dpI\.time.%%~nxI
|
if "%timestamp%" == "." (
|
||||||
if not exist "%timestamp%" copy nul "%timestamp%" > nul
|
for %%I in ("%dest%") do set timestamp=%%~dpI.time.%%~nxI
|
||||||
goto :end >> "%timestamp%"
|
)
|
||||||
|
goto :end > "%timestamp%"
|
||||||
:end
|
:end
|
||||||
|
|
Loading…
Reference in a new issue