* common.mk: add {pre,post}-install targets.
* instruby.rb (install?): install particular part. * bcc32/Makefile.sub (post-install-ext): remove debug information files after installation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a48c63f36b
commit
4a4ff7fac1
@ -1,4 +1,4 @@
|
|||||||
Thu Mar 3 18:38:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Mar 3 18:44:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* {bcc32,win32,wince}/Makefile.sub (config.h): check if affected
|
* {bcc32,win32,wince}/Makefile.sub (config.h): check if affected
|
||||||
when makefiles are modified.
|
when makefiles are modified.
|
||||||
@ -10,6 +10,13 @@ Thu Mar 3 18:38:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|||||||
|
|
||||||
* win32/resource.rb: more descriptions.
|
* win32/resource.rb: more descriptions.
|
||||||
|
|
||||||
|
* common.mk: add {pre,post}-install targets.
|
||||||
|
|
||||||
|
* instruby.rb (install?): install particular part.
|
||||||
|
|
||||||
|
* bcc32/Makefile.sub (post-install-ext): remove debug information
|
||||||
|
files after installation.
|
||||||
|
|
||||||
Thu Mar 3 11:49:51 2005 Kouhei Sutou <kou@cozmixng.org>
|
Thu Mar 3 11:49:51 2005 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
* sample/rss/tdiary_plugin/rss-recent.rb: added site information.
|
* sample/rss/tdiary_plugin/rss-recent.rb: added site information.
|
||||||
|
@ -426,6 +426,10 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
|
|||||||
-so_name=$(RUBY_SO_NAME) \
|
-so_name=$(RUBY_SO_NAME) \
|
||||||
. $(icondirs) $(srcdir)win32
|
. $(icondirs) $(srcdir)win32
|
||||||
|
|
||||||
|
post-install-ext::
|
||||||
|
$(MINIRUBY) -I$(srcdir)lib -rrbconfig -rfileutils \
|
||||||
|
-e 'FileUtils.rm_f(Dir[File.join(Config::CONFIG["archdir"],"**","*.tds")])'
|
||||||
|
|
||||||
clean-local::
|
clean-local::
|
||||||
@$(RM) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? $(RUBY_SO_NAME).lib
|
@$(RM) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? $(RUBY_SO_NAME).lib
|
||||||
@$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
|
@$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
|
||||||
|
29
common.mk
29
common.mk
@ -1,3 +1,4 @@
|
|||||||
|
bin: $(PROGRAM) $(WPROGRAM)
|
||||||
lib: $(LIBRUBY);
|
lib: $(LIBRUBY);
|
||||||
dll: $(LIBRUBY_SO);
|
dll: $(LIBRUBY_SO);
|
||||||
|
|
||||||
@ -61,6 +62,7 @@ EXTMK_ARGS = $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension $(EXTS) --extsta
|
|||||||
|
|
||||||
all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
|
all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
|
||||||
@$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS)
|
@$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS)
|
||||||
|
prog: $(PROGRAM) $(WPROGRAM)
|
||||||
|
|
||||||
miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(OBJS) $(DMYEXT)
|
miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(OBJS) $(DMYEXT)
|
||||||
|
|
||||||
@ -80,12 +82,22 @@ ruby.imp: $(LIBRUBY_A)
|
|||||||
install: install-nodoc $(RDOCTARGET)
|
install: install-nodoc $(RDOCTARGET)
|
||||||
install-all: install-nodoc install-doc
|
install-all: install-nodoc install-doc
|
||||||
|
|
||||||
install-nodoc: install-local install-ext
|
install-nodoc: install-local post-install-local install-ext post-install-ext
|
||||||
install-local: $(RBCONFIG)
|
install-local: pre-install-local do-install-local post-install-local
|
||||||
|
install-ext: pre-install-ext do-install-ext post-install-ext
|
||||||
|
|
||||||
|
do-install-local: $(RBCONFIG)
|
||||||
$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --mantype="$(MANTYPE)"
|
$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --mantype="$(MANTYPE)"
|
||||||
install-ext: $(RBCONFIG)
|
do-install-ext: $(RBCONFIG)
|
||||||
$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) install
|
$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) install
|
||||||
|
|
||||||
|
install-bin: $(RBCONFIG)
|
||||||
|
$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=bin
|
||||||
|
install-lib: $(RBCONFIG)
|
||||||
|
$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=lib
|
||||||
|
install-man: $(RBCONFIG)
|
||||||
|
$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=man --mantype="$(MANTYPE)"
|
||||||
|
|
||||||
what-where-all no-install-all: no-install no-install-doc
|
what-where-all no-install-all: no-install no-install-doc
|
||||||
what-where no-install: no-install-local no-install-ext
|
what-where no-install: no-install-local no-install-ext
|
||||||
what-where-local: no-install-local
|
what-where-local: no-install-local
|
||||||
@ -95,10 +107,19 @@ what-where-ext: no-install-ext
|
|||||||
no-install-ext: $(RBCONFIG)
|
no-install-ext: $(RBCONFIG)
|
||||||
$(MINIRUBY) $(srcdir)/ext/extmk.rb -n $(EXTMK_ARGS) install
|
$(MINIRUBY) $(srcdir)/ext/extmk.rb -n $(EXTMK_ARGS) install
|
||||||
|
|
||||||
install-doc: $(PROGRAM)
|
install-doc: pre-install-doc do-install-doc post-install-doc
|
||||||
|
do-install-doc: $(PROGRAM)
|
||||||
@echo Generating RDoc documentation
|
@echo Generating RDoc documentation
|
||||||
$(RUNRUBY) "$(srcdir)/bin/rdoc" --all --ri --op "$(RIDATADIR)" "$(srcdir)"
|
$(RUNRUBY) "$(srcdir)/bin/rdoc" --all --ri --op "$(RIDATADIR)" "$(srcdir)"
|
||||||
|
|
||||||
|
pre-install: pre-install-local pre-install-ext
|
||||||
|
pre-install-local:: PHONY
|
||||||
|
pre-install-ext:: PHONY
|
||||||
|
|
||||||
|
post-install: post-install-local post-install-ext
|
||||||
|
post-install-local:: PHONY
|
||||||
|
post-install-ext:: PHONY
|
||||||
|
|
||||||
clean: clean-ext clean-local
|
clean: clean-ext clean-local
|
||||||
clean-local::
|
clean-local::
|
||||||
@$(RM) $(OBJS) $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
|
@$(RM) $(OBJS) $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
|
||||||
|
@ -29,6 +29,7 @@ SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
|
|||||||
EXTOBJS += $(@:$(EXEEXT)=.res.@OBJEXT@)
|
EXTOBJS += $(@:$(EXEEXT)=.res.@OBJEXT@)
|
||||||
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
|
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
|
||||||
|
|
||||||
|
ruby: $(PROGRAM)
|
||||||
rubyw: $(WPROGRAM)
|
rubyw: $(WPROGRAM)
|
||||||
|
|
||||||
$(LIBRUBY): $(RUBY_EXP) $(LIBRUBY_SO)
|
$(LIBRUBY): $(RUBY_EXP) $(LIBRUBY_SO)
|
||||||
|
15
instruby.rb
15
instruby.rb
@ -11,6 +11,7 @@ require 'optparse'
|
|||||||
require 'optparse/shellwords'
|
require 'optparse/shellwords'
|
||||||
require 'tempfile'
|
require 'tempfile'
|
||||||
|
|
||||||
|
STDOUT.sync = true
|
||||||
File.umask(0)
|
File.umask(0)
|
||||||
|
|
||||||
def parse_args()
|
def parse_args()
|
||||||
@ -18,6 +19,7 @@ def parse_args()
|
|||||||
$destdir = nil
|
$destdir = nil
|
||||||
$make = 'make'
|
$make = 'make'
|
||||||
$mflags = []
|
$mflags = []
|
||||||
|
$install = []
|
||||||
opt = OptionParser.new
|
opt = OptionParser.new
|
||||||
opt.on('-n') {$dryrun = true}
|
opt.on('-n') {$dryrun = true}
|
||||||
opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
|
opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
|
||||||
@ -29,6 +31,7 @@ def parse_args()
|
|||||||
end
|
end
|
||||||
$mflags.concat(v)
|
$mflags.concat(v)
|
||||||
end
|
end
|
||||||
|
opt.on('--install=TYPE', [:bin, :lib, :man]) {|ins| $install << ins}
|
||||||
opt.parse! rescue abort [$!.message, opt].join("\n")
|
opt.parse! rescue abort [$!.message, opt].join("\n")
|
||||||
|
|
||||||
$make, *rest = Shellwords.shellwords($make)
|
$make, *rest = Shellwords.shellwords($make)
|
||||||
@ -57,6 +60,10 @@ include FileUtils::NoWrite if $dryrun
|
|||||||
@fileutils_output = STDOUT
|
@fileutils_output = STDOUT
|
||||||
@fileutils_label = ''
|
@fileutils_label = ''
|
||||||
|
|
||||||
|
def install?(type)
|
||||||
|
yield if $install.empty? or $install.include?(type)
|
||||||
|
end
|
||||||
|
|
||||||
def install(src, dest, options = {})
|
def install(src, dest, options = {})
|
||||||
options[:preserve] = true
|
options[:preserve] = true
|
||||||
super src, dest, options
|
super src, dest, options
|
||||||
@ -101,6 +108,7 @@ arc = CONFIG["LIBRUBY_A"]
|
|||||||
|
|
||||||
makedirs [bindir, libdir, rubylibdir, archlibdir, sitelibdir, sitearchlibdir]
|
makedirs [bindir, libdir, rubylibdir, archlibdir, sitelibdir, sitearchlibdir]
|
||||||
|
|
||||||
|
install?(:bin) do
|
||||||
ruby_bin = File.join(bindir, ruby_install_name)
|
ruby_bin = File.join(bindir, ruby_install_name)
|
||||||
|
|
||||||
install ruby_install_name+exeext, ruby_bin+exeext, :mode => 0755
|
install ruby_install_name+exeext, ruby_bin+exeext, :mode => 0755
|
||||||
@ -123,9 +131,11 @@ if dll == lib and dll != arc
|
|||||||
ln_sf(dll, File.join(libdir, link))
|
ln_sf(dll, File.join(libdir, link))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Dir.chdir srcdir
|
Dir.chdir srcdir
|
||||||
|
|
||||||
|
install?(:lib) do
|
||||||
ruby_shebang = File.join(CONFIG["bindir"], ruby_install_name)
|
ruby_shebang = File.join(CONFIG["bindir"], ruby_install_name)
|
||||||
if File::ALT_SEPARATOR
|
if File::ALT_SEPARATOR
|
||||||
ruby_bin_dosish = ruby_shebang.tr(File::SEPARATOR, File::ALT_SEPARATOR)
|
ruby_bin_dosish = ruby_shebang.tr(File::SEPARATOR, File::ALT_SEPARATOR)
|
||||||
@ -178,7 +188,9 @@ for f in Dir["lib/**/*{.rb,help-message}"]
|
|||||||
makedirs dir
|
makedirs dir
|
||||||
install f, dir, :mode => 0644
|
install f, dir, :mode => 0644
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
install?(:bin) do
|
||||||
for f in Dir["*.h"]
|
for f in Dir["*.h"]
|
||||||
install f, archlibdir, :mode => 0644
|
install f, archlibdir, :mode => 0644
|
||||||
end
|
end
|
||||||
@ -187,7 +199,9 @@ if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/
|
|||||||
makedirs File.join(archlibdir, "win32")
|
makedirs File.join(archlibdir, "win32")
|
||||||
install "win32/win32.h", File.join(archlibdir, "win32"), :mode => 0644
|
install "win32/win32.h", File.join(archlibdir, "win32"), :mode => 0644
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
install?(:man) do
|
||||||
for mdoc in Dir["*.[1-9]"]
|
for mdoc in Dir["*.[1-9]"]
|
||||||
next unless File.file?(mdoc) and open(mdoc){|fh| fh.read(1) == '.'}
|
next unless File.file?(mdoc) and open(mdoc){|fh| fh.read(1) == '.'}
|
||||||
|
|
||||||
@ -214,5 +228,6 @@ for mdoc in Dir["*.[1-9]"]
|
|||||||
install w.path, destfile, :mode => 0644
|
install w.path, destfile, :mode => 0644
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# vi:set sw=2:
|
# vi:set sw=2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user