зеркало из https://github.com/github/ruby.git
* common.mk (revision.h): extracts revision number with ``svn info''.
* common.mk (up): target to update from the repository. * Makefile.in, {win,bcc}32/Makefile.sub (IFCHANGE): tool to update a file if changed. * tool/ifchange: for unixen. * win32/ifchange.bat: some fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a984e00b80
Коммит
6d91bf3b0c
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
Fri Jan 25 18:27:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* common.mk (revision.h): extracts revision number with ``svn info''.
|
||||
|
||||
* common.mk (up): target to update from the repository.
|
||||
|
||||
* Makefile.in, {win,bcc}32/Makefile.sub (IFCHANGE): tool to update a
|
||||
file if changed.
|
||||
|
||||
* tool/ifchange: for unixen.
|
||||
|
||||
* win32/ifchange.bat: some fix
|
||||
|
||||
Fri Jan 25 17:12:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ruby.c (load_file): set default to ASCII-8BIT explicitly if -K
|
||||
|
|
|
@ -92,6 +92,8 @@ ARFLAGS = rcu
|
|||
RANLIB = @RANLIB@
|
||||
AS = @AS@
|
||||
ASFLAGS = @ASFLAGS@
|
||||
IFCHANGE = $(srcdir)/tool/ifchange
|
||||
SET_LC_MESSAGES = LC_MESSAGES=C
|
||||
|
||||
OBJEXT = @OBJEXT@
|
||||
ASMEXT = S
|
||||
|
|
|
@ -70,6 +70,7 @@ BASERUBY = ruby
|
|||
|
||||
PURIFY =
|
||||
AUTOCONF = autoconf
|
||||
IFCHANGE = $(srcdir:/=\)\win32\ifchange.bat
|
||||
RM = $(srcdir:/=\)\win32\rm.bat
|
||||
CP = copy > nul
|
||||
MV = move > nul
|
||||
|
@ -248,7 +249,7 @@ config.status: $(CONFIG_H)
|
|||
$(CONFIG_H): $(MKFILES) $(srcdir)/bcc32/Makefile.sub
|
||||
@if not exist $(arch_hdrdir:/=\) md $(arch_hdrdir:/=\)
|
||||
@if not exist $(arch_hdrdir:/=\)\ruby md $(arch_hdrdir:/=\)\ruby
|
||||
@$(srcdir:/=\)\win32\ifchange.bat $(RUBY_CONFIG_H:/=\) &&|
|
||||
@$(IFCHANGE) $(RUBY_CONFIG_H:/=\) &&|
|
||||
\#define HAVE_SYS_TYPES_H 1
|
||||
\#define HAVE_SYS_STAT_H 1
|
||||
\#define HAVE_STDLIB_H 1
|
||||
|
|
15
common.mk
15
common.mk
|
@ -98,6 +98,8 @@ TESTWORKDIR = testwork
|
|||
|
||||
BOOTSTRAPRUBY = $(BASERUBY)
|
||||
|
||||
VCS = svn
|
||||
|
||||
all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY) encs
|
||||
@$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS)
|
||||
prog: $(PROGRAM) $(WPROGRAM)
|
||||
|
@ -698,7 +700,7 @@ vm.inc: $(srcdir)/template/vm.inc.tmpl
|
|||
|
||||
srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c $(srcdir)/ext/ripper/ripper.c
|
||||
|
||||
incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}revision.h
|
||||
incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h $(srcdir)/revision.h
|
||||
|
||||
node_name.inc: {$(VPATH)}node.h
|
||||
$(BASERUBY) -n $(srcdir)/tool/node_name.rb $? > $@
|
||||
|
@ -724,8 +726,11 @@ PRELUDES = prelude.c miniprelude.c golf_prelude.c
|
|||
docs:
|
||||
$(BASERUBY) -I$(srcdir) $(srcdir)/tool/makedocs.rb $(INSNS2VMOPT)
|
||||
|
||||
revision.h:
|
||||
exit > $@
|
||||
$(srcdir)/revision.h:
|
||||
@set LC_MESSAGES=C
|
||||
-@$(SET_LC_MESSAGES) $(VCS) info "$(@D)" | \
|
||||
sed -n "s/.*Rev:/#define RUBY_REVISION/p" > "$@.tmp"
|
||||
$(IFCHANGE) "$@" "$@.tmp"
|
||||
|
||||
$(srcdir)/ext/ripper/ripper.c:
|
||||
cd $(srcdir)/ext/ripper && exec $(MAKE) -f depend $(MFLAGS) top_srcdir=../.. srcdir=.
|
||||
|
@ -788,3 +793,7 @@ vtune: miniruby$(EXEEXT)
|
|||
|
||||
dist: $(PROGRAM)
|
||||
$(RUNRUBY) $(srcdir)/distruby.rb
|
||||
|
||||
up:
|
||||
@$(VCS) up "$(srcdir)" |\
|
||||
sed '-e$${' -eh "-es/[^0-9]//g" "-es/^/#define RUBY_REVISION /" "-ew$(srcdir)/revision.h" -eg "-e}"
|
||||
|
|
|
@ -63,6 +63,7 @@ YFLAGS = -o y.tab.c
|
|||
AR = lib -nologo
|
||||
PURIFY =
|
||||
AUTOCONF = autoconf
|
||||
IFCHANGE = $(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat
|
||||
RM = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat
|
||||
CP = copy > nul
|
||||
MV = move > nul
|
||||
|
@ -246,14 +247,6 @@ ASMEXT = asm
|
|||
|
||||
INSTALLED_LIST= .installed.list
|
||||
|
||||
!if [find "revision.h" $(srcdir:/=\)\version.h > nul 2> nul] == 0
|
||||
REVISION_H = revision.h
|
||||
REVISION_UP = revision-up
|
||||
!else
|
||||
REVISION_H = version.h
|
||||
REVISION_UP =
|
||||
!endif
|
||||
|
||||
!if !defined(WINMAINOBJ)
|
||||
WINMAINOBJ = winmain.$(OBJEXT)
|
||||
!endif
|
||||
|
@ -307,7 +300,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
|
|||
!if !exist("$(arch_hdrdir)/ruby")
|
||||
@md $(arch_hdrdir:/=\)\ruby
|
||||
!endif
|
||||
@$(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat $(RUBY_CONFIG_H:/=\) <<
|
||||
@$(IFCHANGE) $(RUBY_CONFIG_H:/=\) <<
|
||||
#if _MSC_VER != $(MSC_VER)
|
||||
#error MSC version unmatch: _MSC_VER: $(MSC_VER) is expected.
|
||||
#endif
|
||||
|
|
|
@ -1,13 +1,23 @@
|
|||
@echo off
|
||||
:: usage: ifchange target temporary
|
||||
|
||||
if "%1" == "" goto :end
|
||||
|
||||
set dest=%1
|
||||
set src=%2
|
||||
set dest=%dest:/=\%
|
||||
set src=%src:/=\%
|
||||
if not "%dest%" == "" if not "%dest%" == "%%dest:/=\%%" goto :nt
|
||||
|
||||
if not exist %2 goto :end
|
||||
|
||||
:: check if fc.exe works.
|
||||
echo foo > conftest1.tmp
|
||||
echo bar > conftest2.tmp
|
||||
fc.exe conftest1.tmp conftest2.tmp > nul
|
||||
echo foo > conftst1.tmp
|
||||
echo bar > conftst2.tmp
|
||||
fc.exe conftst1.tmp conftst2.tmp > nul
|
||||
if not errorlevel 1 goto :brokenfc
|
||||
del conftest1.tmp > nul
|
||||
del conftest2.tmp > nul
|
||||
del conftst1.tmp > nul
|
||||
del conftst2.tmp > nul
|
||||
|
||||
:: target does not exist or new file differs from it.
|
||||
if not exist %1 goto :update
|
||||
|
@ -27,6 +37,23 @@ echo assuming %1 should be changed.
|
|||
|
||||
:update
|
||||
echo %1 updated.
|
||||
if exist %1 del %1
|
||||
copy %2 %1 > nul
|
||||
:: if exist %1 del %1
|
||||
dir /b %2
|
||||
copy %2 %1
|
||||
del %2
|
||||
goto :end
|
||||
|
||||
:nt
|
||||
if not exist %src% goto :end
|
||||
if exist %dest% (
|
||||
fc.exe %dest% %src% > nul && (
|
||||
echo %dest% unchanged.
|
||||
del %src%
|
||||
goto :end
|
||||
)
|
||||
)
|
||||
echo %dest% updated.
|
||||
copy %src% %dest% > nul
|
||||
del %src%
|
||||
|
||||
:end
|
||||
|
|
Загрузка…
Ссылка в новой задаче