git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2007-01-04 04:44:48 +00:00
Родитель 784dedc5f0
Коммит 26608663cd
2 изменённых файлов: 190 добавлений и 47 удалений

Просмотреть файл

@ -1,3 +1,7 @@
Thu Jan 04 13:42:47 2007
* common.mk : restore changes
Thu Jan 04 10:33:54 2007 Koichi Sasada <ko1@atdot.net> Thu Jan 04 10:33:54 2007 Koichi Sasada <ko1@atdot.net>
* thread_pthread.ci : fix to skip using PTHREAD_STACK_MIN. * thread_pthread.ci : fix to skip using PTHREAD_STACK_MIN.

233
common.mk
Просмотреть файл

@ -1,11 +1,15 @@
bin: $(PROGRAM) $(WPROGRAM) bin: $(PROGRAM) $(WPROGRAM)
lib: $(LIBRUBY); lib: $(LIBRUBY)
dll: $(LIBRUBY_SO); dll: $(LIBRUBY_SO)
RUBYOPT = RUBYOPT =
STATIC_RUBY = static-ruby
EXTCONF = extconf.rb EXTCONF = extconf.rb
RBCONFIG = ./.rbconfig.time RBCONFIG = ./.rbconfig.time
LIBRUBY_EXTS = ./.libruby-with-ext.time
RDOCOUT = $(EXTOUT)/rdoc
DMYEXT = dmyext.$(OBJEXT) DMYEXT = dmyext.$(OBJEXT)
MAINOBJ = main.$(OBJEXT) MAINOBJ = main.$(OBJEXT)
@ -71,83 +75,216 @@ OBJS = array.$(OBJEXT) \
$(MISSING) $(MISSING)
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \ SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
--extout="$(EXTOUT)" \
--make="$(MAKE)" \ --make="$(MAKE)" \
--mflags="$(MFLAGS)" \ --mflags="$(MFLAGS)" \
--make-flags="$(MAKEFLAGS)" --make-flags="$(MAKEFLAGS)"
EXTMK_ARGS = $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension $(EXTS) --extstatic $(EXTSTATIC) -- EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) --
INSTRUBY_ARGS = $(SCRIPT_ARGS) --installed-list $(INSTALLED_LIST)
PRE_LIBRUBY_UPDATE = $(MINIRUBY) -e 'ARGV[1] or File.unlink(ARGV[0]) rescue nil' -- \
$(LIBRUBY_EXTS) $(LIBRUBY_SO_UPDATE)
TESTSDIR = $(srcdir)/test
TESTWORKDIR = testwork
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) prog: $(PROGRAM) $(WPROGRAM)
miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(MINIOBJS) $(OBJS) $(DMYEXT) miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(MINIOBJS) $(OBJS) $(DMYEXT)
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP) $(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
$(LIBRUBY_A): $(OBJS) $(DMYEXT) $(LIBRUBY_A): $(OBJS) $(DMYEXT) $(ARCHFILE)
$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(ARCHFILE) $(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE)
static-ruby: $(MAINOBJ) $(EXTOBJS) $(LIBRUBY_A) $(LIBRUBY_EXTS):
@exit > $@
$(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
@$(RM) $@ @$(RM) $@
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBY_A) $(LIBS) $(OUTFLAG)$@ $(PURIFY) $(CC) $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(XLDFLAGS)
ruby.imp: $(LIBRUBY_A) ruby.imp: $(OBJS)
@$(NM) -Pgp $(LIBRUBY_A) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@ @$(NM) -Pgp $(OBJS) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@
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: pre-install-nodoc do-install-nodoc post-install-nodoc
pre-install-nodoc:: pre-install-local pre-install-ext
do-install-nodoc:
$(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
post-install-nodoc:: post-install-local post-install-ext
install-local: pre-install-local do-install-local post-install-local install-local: pre-install-local do-install-local post-install-local
pre-install-local:: pre-install-bin pre-install-lib pre-install-man
do-install-local:
$(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
post-install-local:: post-install-bin post-install-lib post-install-man
install-ext: pre-install-ext do-install-ext post-install-ext install-ext: pre-install-ext do-install-ext post-install-ext
pre-install-ext:: pre-install-ext-arch pre-install-ext-comm
do-install-ext:
$(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=ext
post-install-ext:: post-install-ext-arch post-install-ext-comm
do-install-local: $(RBCONFIG) install-arch: pre-install-arch do-install-arch post-install-arch
$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --mantype="$(MANTYPE)" pre-install-arch:: pre-install-bin pre-install-ext-arch
do-install-ext: $(RBCONFIG) do-install-arch:
$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) install $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=bin --install=ext-arch
post-install-arch:: post-install-bin post-install-ext-arch
install-bin: $(RBCONFIG) install-comm: pre-install-comm do-install-comm post-install-comm
$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=bin pre-install-comm:: pre-install-lib pre-install-ext-comm pre-install-man
install-lib: $(RBCONFIG) do-install-comm:
$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=lib $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
install-man: $(RBCONFIG) post-install-comm:: post-install-lib post-install-ext-comm post-install-man
$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=man --mantype="$(MANTYPE)"
install-bin: pre-install-bin do-install-bin post-install-bin
pre-install-bin:: install-prereq
do-install-bin:
$(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=bin
post-install-bin::
@$(NULLCMD)
install-lib: pre-install-lib do-install-lib post-install-lib
pre-install-lib:: install-prereq
do-install-lib:
$(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=lib
post-install-lib::
@$(NULLCMD)
install-ext-comm: pre-install-ext-comm do-install-ext-comm post-install-ext-comm
pre-install-ext-comm:: install-prereq
do-install-ext-comm:
$(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=ext-comm
post-install-ext-comm::
@$(NULLCMD)
install-ext-arch: pre-install-ext-arch do-install-ext-arch post-install-ext-arch
pre-install-ext-arch:: install-prereq
do-install-ext-arch:
$(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=ext-arch
post-install-ext-arch::
@$(NULLCMD)
install-man: pre-install-man do-install-man post-install-man
pre-install-man:: install-prereq
do-install-man:
$(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
post-install-man::
@$(NULLCMD)
what-where: no-install
no-install: no-install-nodoc no-install-doc
what-where-all: no-install-all
no-install-all: no-install-nodoc
what-where-nodoc: no-install-nodoc
no-install-nodoc: pre-no-install-nodoc dont-install-nodoc post-no-install-nodoc
pre-no-install-nodoc:: pre-no-install-local pre-no-install-ext
dont-install-nodoc:
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --mantype="$(MANTYPE)"
post-no-install-nodoc:: post-no-install-local post-no-install-ext
what-where-all no-install-all: no-install no-install-doc
what-where no-install: no-install-local no-install-ext
what-where-local: no-install-local what-where-local: no-install-local
no-install-local: $(RBCONFIG) no-install-local: pre-no-install-local dont-install-local post-no-install-local
$(MINIRUBY) $(srcdir)/instruby.rb -n $(SCRIPT_ARGS) --mantype="$(MANTYPE)" pre-no-install-local:: pre-no-install-bin pre-no-install-lib pre-no-install-man
dont-install-local:
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=local --mantype="$(MANTYPE)"
post-no-install-local:: post-no-install-bin post-no-install-lib post-no-install-man
what-where-ext: no-install-ext what-where-ext: no-install-ext
no-install-ext: $(RBCONFIG) no-install-ext: pre-no-install-ext dont-install-ext post-no-install-ext
$(MINIRUBY) $(srcdir)/ext/extmk.rb -n $(EXTMK_ARGS) install pre-no-install-ext:: pre-no-install-ext-arch pre-no-install-ext-comm
dont-install-ext:
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=ext
post-no-install-ext:: post-no-install-ext-arch post-no-install-ext-comm
install-doc: pre-install-doc do-install-doc post-install-doc what-where-arch: no-install-arch
no-install-arch: pre-no-install-arch dont-install-arch post-no-install-arch
pre-no-install-arch:: pre-no-install-bin pre-no-install-ext-arch
dont-install-arch:
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=bin --install=ext-arch
post-no-install-arch:: post-no-install-lib post-no-install-man post-no-install-ext-arch
what-where-comm: no-install-comm
no-install-comm: pre-no-install-comm dont-install-comm post-no-install-comm
pre-no-install-comm:: pre-no-install-lib pre-no-install-ext-comm pre-no-install-man
dont-install-comm:
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=lib --install=ext-comm --install=man
post-no-install-comm:: post-no-install-lib post-no-install-ext-comm post-no-install-man
what-where-bin: no-install-bin
no-install-bin: pre-no-install-bin dont-install-bin post-no-install-bin
pre-no-install-bin:: install-prereq
dont-install-bin:
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=bin
post-no-install-bin::
@$(NULLCMD)
what-where-lib: no-install-lib
no-install-lib: pre-no-install-lib dont-install-lib post-no-install-lib
pre-no-install-lib:: install-prereq
dont-install-lib:
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=lib
post-no-install-lib::
@$(NULLCMD)
what-where-ext-comm: no-install-ext-comm
no-install-ext-comm: pre-no-install-ext-comm dont-install-ext-comm post-no-install-ext-comm
pre-no-install-ext-comm:: install-prereq
dont-install-ext-comm:
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=ext-comm
post-no-install-ext-comm::
@$(NULLCMD)
what-where-ext-arch: no-install-ext-arch
no-install-ext-arch: pre-no-install-ext-arch dont-install-ext-arch post-no-install-ext-arch
pre-no-install-ext-arch:: install-prereq
dont-install-ext-arch:
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=ext-arch
post-no-install-ext-arch::
@$(NULLCMD)
what-where-man: no-install-man
no-install-man: pre-no-install-man dont-install-man post-no-install-man
pre-no-install-man:: install-prereq
dont-install-man:
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=man --mantype="$(MANTYPE)"
post-no-install-man::
@$(NULLCMD)
install-doc: rdoc pre-install-doc do-install-doc post-install-doc
pre-install-doc:: install-prereq
do-install-doc: $(PROGRAM) do-install-doc: $(PROGRAM)
$(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
post-install-doc::
@$(NULLCMD)
rdoc: $(PROGRAM) PHONY
@echo Generating RDoc documentation @echo Generating RDoc documentation
$(RUNRUBY) "$(srcdir)/bin/rdoc" --all --ri --op "$(RIDATADIR)" "$(srcdir)" $(RUNRUBY) "$(srcdir)/bin/rdoc" --all --ri --op "$(RDOCOUT)" "$(srcdir)"
pre-install: pre-install-local pre-install-ext what-where-doc: no-install-doc
pre-install-local:: PHONY no-install-doc: pre-no-install-doc dont-install-doc post-no-install-doc
pre-install-ext:: PHONY pre-no-install-doc:: install-prereq
pre-install-doc:: PHONY dont-install-doc::
$(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
post-no-install-doc::
@$(NULLCMD)
post-install: post-install-local post-install-ext install-prereq:
post-install-local:: PHONY @exit > $(INSTALLED_LIST)
post-install-ext:: PHONY
post-install-doc:: PHONY
# no ext
# clean: clean-ext clean-local
clean: 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)
@$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) @$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) .*.time
@$(RM) *.inc @$(RM) *.inc
clean-ext: clean-ext:
@-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) clean @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) clean
@ -167,15 +304,15 @@ check: test test-all
test: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY test: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) PHONY
@$(MINIRUBY) $(srcdir)/rubytest.rb @$(MINIRUBY) $(srcdir)/rubytest.rb
test-all: miniruby$(EXEEXT) ruby test-all:
$(RUNRUBY) -C "$(srcdir)/test" runner.rb --runner=$(TESTUI) $(TESTS) $(RUNRUBY) "$(srcdir)/test/runner.rb" --basedir="$(TESTSDIR)" --runner=$(TESTUI) $(TESTS)
extconf: extconf:
$(MINIRUBY) -I$(srcdir)/lib -run -e mkdir -- -p "$(EXTCONFDIR)" $(MINIRUBY) -I$(srcdir)/lib -run -e mkdir -- -p "$(EXTCONFDIR)"
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS) $(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
$(RBCONFIG): $(srcdir)/mkconfig.rb config.status $(PREP) $(RBCONFIG): $(srcdir)/mkconfig.rb config.status $(PREP)
$(MINIRUBY) $(srcdir)/mkconfig.rb -timestamp=$@ \ @$(MINIRUBY) $(srcdir)/mkconfig.rb -timestamp=$@ \
-install_name=$(RUBY_INSTALL_NAME) \ -install_name=$(RUBY_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) rbconfig.rb -so_name=$(RUBY_SO_NAME) rbconfig.rb
@ -211,6 +348,8 @@ nt.$(OBJEXT): {$(VPATH)}nt.c
x68.$(OBJEXT): {$(VPATH)}x68.c x68.$(OBJEXT): {$(VPATH)}x68.c
os2.$(OBJEXT): {$(VPATH)}os2.c os2.$(OBJEXT): {$(VPATH)}os2.c
dl_os2.$(OBJEXT): {$(VPATH)}dl_os2.c dl_os2.$(OBJEXT): {$(VPATH)}dl_os2.c
ia64.$(OBJEXT): {$(VPATH)}ia64.s
$(CC) $(CFLAGS) -c $<
# when I use -I., there is confliction at "OpenFile" # when I use -I., there is confliction at "OpenFile"
# so, set . into environment varible "include" # so, set . into environment varible "include"