mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
2d03f7274f
EPERM on cygwin and mingw. * Makefile.in ($(LIBRUBY_SO)): use wildcard option of objcopy. * configure.in (DLDFLAGS): do not export all symbols. * cygwin/GNUmakefile.in (RUBYDEF): rejects symbols prefixex with Init_. * win32/mkexports.rb (Exports::Mingw): includes all symbols except for prefixed with Init_ as well as mswin32. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
292 lines
7.7 KiB
Makefile
292 lines
7.7 KiB
Makefile
SHELL = /bin/sh
|
|
NULLCMD = :
|
|
|
|
#### Start of system configuration section. ####
|
|
|
|
srcdir = @srcdir@
|
|
hdrdir = $(srcdir)/include
|
|
|
|
CC = @CC@
|
|
YACC = bison
|
|
PURIFY =
|
|
AUTOCONF = autoconf
|
|
@SET_MAKE@
|
|
MKFILES = @MAKEFILES@
|
|
BASERUBY = @BASERUBY@
|
|
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
bindir = @bindir@
|
|
sbindir = @sbindir@
|
|
libdir = @libdir@
|
|
libexecdir = @libexecdir@
|
|
datarootdir = @datarootdir@
|
|
datadir = @datadir@
|
|
arch = @arch@
|
|
sitearch = @sitearch@
|
|
sitedir = @sitedir@
|
|
|
|
TESTUI = console
|
|
TESTS =
|
|
RDOCTARGET = @RDOCTARGET@
|
|
|
|
EXTOUT = @EXTOUT@
|
|
RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
|
|
arch_hdrdir = $(EXTOUT)/include/$(arch)
|
|
VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/enc:$(srcdir)/missing
|
|
|
|
empty =
|
|
OUTFLAG = @OUTFLAG@$(empty)
|
|
COUTFLAG = @COUTFLAG@$(empty)
|
|
CFLAGS = @CFLAGS@ @ARCH_FLAG@
|
|
cflags = @cflags@
|
|
optflags = @optflags@
|
|
debugflags = @debugflags@
|
|
warnflags = @warnflags@
|
|
XCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) @XCFLAGS@
|
|
CPPFLAGS = @CPPFLAGS@
|
|
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
|
|
EXTLDFLAGS =
|
|
XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
|
|
EXTLIBS =
|
|
LIBS = @LIBS@ $(EXTLIBS)
|
|
MISSING = @LIBOBJS@ @ALLOCA@
|
|
LDSHARED = @LIBRUBY_LDSHARED@
|
|
DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(EXTLDFLAGS) @ARCH_FLAG@
|
|
SOLIBS = @SOLIBS@
|
|
MAINLIBS = @MAINLIBS@
|
|
ARCHMINIOBJS = @MINIOBJS@
|
|
BUILTIN_ENCOBJS = @BUILTIN_ENCOBJS@
|
|
BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@
|
|
BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@
|
|
|
|
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
|
|
RUBY_SO_NAME=@RUBY_SO_NAME@
|
|
EXEEXT = @EXEEXT@
|
|
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
|
RUBY = $(RUBY_INSTALL_NAME)
|
|
MINIRUBY = @MINIRUBY@ $(MINIRUBYOPT)
|
|
RUNRUBY = @RUNRUBY@ $(RUNRUBYOPT) --
|
|
|
|
#### End of system configuration section. ####
|
|
|
|
MAJOR= @MAJOR@
|
|
MINOR= @MINOR@
|
|
TEENY= @TEENY@
|
|
|
|
LIBRUBY_A = @LIBRUBY_A@
|
|
LIBRUBY_SO = @LIBRUBY_SO@
|
|
LIBRUBY_ALIASES= @LIBRUBY_ALIASES@
|
|
LIBRUBY = @LIBRUBY@
|
|
LIBRUBYARG = @LIBRUBYARG@
|
|
LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
|
|
LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
|
|
|
|
THREAD_MODEL = @THREAD_MODEL@
|
|
|
|
PREP = @PREP@
|
|
ARCHFILE = @ARCHFILE@
|
|
SETUP =
|
|
EXTSTATIC = @EXTSTATIC@
|
|
SET_LC_MESSAGES = env LC_MESSAGES=C
|
|
|
|
MAKEDIRS = @MAKEDIRS@
|
|
CP = cp
|
|
MV = mv
|
|
RM = rm -f
|
|
NM = @NM@
|
|
AR = @AR@
|
|
ARFLAGS = rcu
|
|
RANLIB = @RANLIB@
|
|
AS = @AS@
|
|
ASFLAGS = @ASFLAGS@
|
|
IFCHANGE = $(srcdir)/tool/ifchange
|
|
SET_LC_MESSAGES = env LC_MESSAGES=C
|
|
OBJDUMP = @OBJDUMP@
|
|
OBJCOPY = @OBJCOPY@
|
|
VCS = @VCS@
|
|
VCSUP = @VCSUP@
|
|
|
|
OBJEXT = @OBJEXT@
|
|
ASMEXT = S
|
|
DLEXT = @DLEXT@
|
|
MANTYPE = @MANTYPE@
|
|
|
|
INSTALLED_LIST= .installed.list
|
|
#### End of variables
|
|
|
|
all:
|
|
|
|
.DEFAULT: all
|
|
|
|
# Prevent GNU make v3 from overflowing arg limit on SysV.
|
|
.NOEXPORT:
|
|
|
|
miniruby$(EXEEXT):
|
|
@-if test -f $@; then mv -f $@ $@.old; $(RM) $@.old; fi
|
|
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(ARCHFILE) $(LIBS) $(OUTFLAG)$@
|
|
|
|
$(PROGRAM):
|
|
@$(RM) $@
|
|
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
|
|
|
|
# We must `rm' the library each time this rule is invoked because "updating" a
|
|
# MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
|
|
# supported.
|
|
$(LIBRUBY_A):
|
|
@$(RM) $@
|
|
$(AR) $(ARFLAGS) $@ $(OBJS) $(DMYEXT)
|
|
@-$(RANLIB) $@ 2> /dev/null || true
|
|
|
|
$(LIBRUBY_SO):
|
|
@-$(PRE_LIBRUBY_UPDATE)
|
|
$(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
|
|
-$(OBJCOPY) -w -L '@EXPORT_PREFIX@Init_*' $@
|
|
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
|
|
File.symlink "$(LIBRUBY_SO)", link}' \
|
|
$(LIBRUBY_ALIASES) || true
|
|
|
|
fake.rb: Makefile
|
|
@echo ' \
|
|
class Object; \
|
|
CROSS_COMPILING = RUBY_PLATFORM; \
|
|
remove_const :RUBY_PLATFORM; \
|
|
remove_const :RUBY_VERSION; \
|
|
RUBY_PLATFORM = "@arch@"; \
|
|
RUBY_VERSION = "@MAJOR@.@MINOR@.@TEENY@"; \
|
|
end; \
|
|
if RUBY_PLATFORM =~ /mswin|bccwin|mingw/; \
|
|
class File; \
|
|
remove_const :ALT_SEPARATOR; \
|
|
ALT_SEPARATOR = "\\"; \
|
|
end; \
|
|
end; \
|
|
' > $@
|
|
|
|
Makefile: $(srcdir)/Makefile.in $(srcdir)/enc/Makefile.in
|
|
Doxyfile: $(srcdir)/Doxyfile.in config.status
|
|
MAKE=$(MAKE) $(SHELL) ./config.status
|
|
|
|
$(MKFILES): config.status
|
|
MAKE=$(MAKE) $(SHELL) ./config.status
|
|
@{ \
|
|
echo "all:; -@rm -f conftest.mk"; \
|
|
echo "conftest.mk: .force; @echo AUTO_REMAKE"; \
|
|
echo ".force:"; \
|
|
} > conftest.mk || exit 1; \
|
|
$(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \
|
|
{ echo "Makefile updated, restart."; exit 1; }
|
|
|
|
uncommon.mk: $(srcdir)/common.mk
|
|
sed 's/{\$$([^(){}]*)[^{}]*}//g' $< > $@
|
|
|
|
config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in
|
|
MINIRUBY="$(MINIRUBY)" $(SHELL) ./config.status --recheck
|
|
|
|
$(srcdir)/configure: $(srcdir)/configure.in
|
|
cd $(srcdir) && $(AUTOCONF)
|
|
|
|
# Things which should be considered:
|
|
# * with gperf v.s. without gperf
|
|
# * ./configure v.s. ../ruby/configure
|
|
# * GNU make v.s. HP-UX make # HP-UX make invokes the action if lex.c and keywords has same mtime.
|
|
# * svn checkout generate a file with mtime as current time
|
|
# * XFS has a mtime with fractional part
|
|
lex.c: defs/keywords
|
|
@\
|
|
if cmp -s $(srcdir)/defs/lex.c.src $?; then \
|
|
set -x; \
|
|
cp $(srcdir)/lex.c.blt $@; \
|
|
else \
|
|
set -x; \
|
|
gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && \
|
|
mv $@.tmp $@ && \
|
|
cp $? $(srcdir)/defs/lex.c.src && \
|
|
cp $@ $(srcdir)/lex.c.blt; \
|
|
fi
|
|
|
|
.c.@OBJEXT@:
|
|
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $<
|
|
|
|
.s.@OBJEXT@:
|
|
$(AS) $(ASFLAGS) -o $@ $<
|
|
|
|
.c.S:
|
|
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -S $<
|
|
|
|
clean-local::
|
|
@$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output
|
|
|
|
distclean-local::
|
|
@$(RM) ext/config.cache $(RBCONFIG)
|
|
$(RM) Doxyfile
|
|
@-$(RM) run.gdb
|
|
-$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h
|
|
-rmdir -p $(arch_hdrdir)/ruby
|
|
|
|
clean-ext distclean-ext realclean-ext::
|
|
@set dummy ${EXTS}; shift; \
|
|
if test "$$#" = 0; then \
|
|
set dummy `find ext -name Makefile | sed 's:^ext/::;s:/Makefile$$::' | sort`; \
|
|
shift; \
|
|
fi; \
|
|
cd ext; \
|
|
for dir; do \
|
|
echo $(@:-ext=)ing "$$dir"; \
|
|
(cd "$$dir"; $(MAKE) $(MFLAGS) $(@:-ext=)) && \
|
|
case "$@" in \
|
|
*distclean-ext*|*realclean-ext*) \
|
|
rmdir -p "$$dir" 2> /dev/null;; \
|
|
esac; \
|
|
done
|
|
|
|
distclean-ext realclean-ext::
|
|
@-rmdir ext 2> /dev/null || true
|
|
|
|
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
|
|
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
|
|
|
|
up::
|
|
@LC_TIME=C cd "$(srcdir)" && $(VCSUP)
|
|
|
|
update-rubyspec:
|
|
@if [ -d $(srcdir)/spec/mspec ]; then \
|
|
cd $(srcdir)/spec/mspec; \
|
|
echo updating mspec ...; \
|
|
git pull; \
|
|
cd ../..; \
|
|
else \
|
|
echo retrieving mspec ...; \
|
|
git clone $(MSPEC_GIT_URL) $(srcdir)/spec/mspec; \
|
|
fi
|
|
@if [ -d $(srcdir)/spec/rubyspec ]; then \
|
|
cd $(srcdir)/spec/rubyspec; \
|
|
echo updating rubyspec ...; \
|
|
git pull; \
|
|
else \
|
|
echo retrieving rubyspec ...; \
|
|
git clone $(RUBYSPEC_GIT_URL) $(srcdir)/spec/rubyspec; \
|
|
fi
|
|
|
|
test-rubyspec:
|
|
@if [ ! -d $(srcdir)/spec/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi
|
|
$(RUNRUBY) $(srcdir)/spec/mspec/bin/mspec -B $(srcdir)/spec/default.mspec $(MSPECOPT)
|
|
|
|
INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
|
|
vmtc.inc vm.inc
|
|
|
|
$(INSNS):
|
|
@$(RM) $(PROGRAM)
|
|
$(BASERUBY) -Ks $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) $@
|
|
|
|
node_name.inc:
|
|
$(BASERUBY) -n $(srcdir)/tool/node_name.rb $? > $@
|
|
|
|
known_errors.inc:
|
|
$(BASERUBY) $(srcdir)/tool/generic_erb.rb -c -o $@ $(srcdir)/template/known_errors.inc.tmpl $(srcdir)/defs/known_errors.def
|
|
|
|
miniprelude.c:
|
|
$(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
|
|
|
|
newline.c:
|
|
$(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo newline.c $(srcdir)/enc/trans/newline.trans
|