ruby/win32/Makefile.sub

1439 строки
40 KiB
Makefile
Исходник Обычный вид История

2019-04-28 05:35:14 +03:00
# -*- mode: makefile; indent-tabs-mode: t -*-
SHELL = $(COMSPEC)
ECHO1 = $(V:1=@:)
RUNCMD = $(COMSPEC) /c
MKFILES = Makefile verconf.mk
NULLCMD = type nul
NULL = nul
CHDIR = cd
PATH_SEPARATOR = ;
TZ = # skip timezone tests
PWD = $(MAKEDIR)
2021-08-25 12:28:27 +03:00
empty =
!ifndef MFLAGS
MFLAGS=-l
!endif
!ifndef REVISION_FORCE
!if "$(HAVE_BASERUBY)" == "yes"
REVISION_FORCE = PHONY
!endif
!endif
!ifndef CROSS_COMPILING
CROSS_COMPILING = no
!endif
!ifndef win_srcdir
win_srcdir = $(srcdir)/win32
!endif
!if exist(verconf.mk)
! include verconf.mk
!endif
#### Start of system configuration section. ####
!if defined(pathlist)
PATH = $(pathlist:;=/bin;)$(PATH)
INCLUDE = $(pathlist:;=/include;)
LIB = $(pathlist:;=/lib;)
!endif
## variables may be overridden by $(compile_dir)/Makefile
!ifndef srcdir
srcdir = ..
!endif
!ifndef RUBY_BASE_NAME
RUBY_BASE_NAME = ruby
!endif
!ifndef RUBY_INSTALL_NAME
RUBY_INSTALL_NAME = $(PROGRAM_PREFIX)$(RUBY_BASE_NAME)$(PROGRAM_SUFFIX)
!endif
!if !defined(RUBYW_INSTALL_NAME) || "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)"
RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw)
!endif
!if "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)"
RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
!endif
STUBPROGRAM = rubystub$(EXEEXT)
!if !defined(icondirs) && defined(ICONDIRS)
icondirs=$(ICONDIRS)
!endif
!if defined(icondirs)
icondirs=$(icondirs:\=/)
iconinc=-I$(icondirs: = -I)
!endif
###############
.SUFFIXES: .def .lib
!if !defined(CC)
CC = cl -nologo
!endif
!if !defined(CPP) || "$(CPP)" == "cl"
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
CPP = $(CC) -E
!endif
!if !defined(YACC)
YACC = bison
!endif
AR = lib -nologo
PURIFY =
AUTOCONF = autoconf
IFCHANGE = $(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat
RM = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat
RMDIR = $(COMSPEC) /C $(srcdir:/=\)\win32\rmdirs.bat
RMDIRS = $(COMSPEC) /C $(srcdir:/=\)\win32\rmdirs.bat
RMALL = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat -f -r
MAKEDIRS = $(COMSPEC) /E:ON /C $(srcdir:/=\)\win32\makedirs.bat
CP = copy > nul
MV = move > nul
RM1 = del /f /q
!if !defined(BASERUBY)
BASERUBY = ruby
!endif
!if !defined(TEST_RUNNABLE)
TEST_RUNNABLE = yes
!endif
!if !defined(MACHINE)
MACHINE = x86
!endif
!if "$(MACHINE)" == "x86"
!if !defined(PROCESSOR_LEVEL)
PROCESSOR_LEVEL = 5
!endif
!if 6 < $(PROCESSOR_LEVEL)
PROCESSOR_LEVEL = 6
!endif
!if $(MSC_VER) < 1400
PROCESSOR_FLAG = -G$(PROCESSOR_LEVEL)
!endif
CPU = i$(PROCESSOR_LEVEL)86
ARCH = i386
!else
CPU = $(MACHINE)
ARCH = $(MACHINE)
!endif
!if !defined(DEBUGFLAGS)
DEBUGFLAGS = -Zi
!endif
!if "$(RUBY_DEVEL)" == "yes"
XCFLAGS = $(XCFLAGS) -DRUBY_DEVEL=1
!endif
!if !defined(OPTFLAGS)
!if $(MSC_VER) < 1400
OPTFLAGS = -O2b2xg-
!else
OPTFLAGS = -O2sy-
!endif
!endif
!if !defined(PLATFORM)
PLATFORM = mswin32
!endif
!if !defined(RT)
!error RT not defined. Retry from configure pass.
!endif
!ifndef NTVER
NTVER = 0x0600
!endif
!ifdef NTVER
ARCHDEFS = -D_WIN32_WINNT=$(NTVER) $(ARCHDEFS)
!endif
* Makefile.in (PLATFORM_DIR): add a variable for `win32` directory. * Makefile.in (clean-platform): add new target. It cleans `win32` directory. * common.mk (clean): add a dependency for `win32` directory. * common.mk (distclean): ditto. * common.mk (distclean-platform): add new target. It cleans `win32` directory. * common.mk ($(PLATFORM_D)): add new target to make `win32` directory. * common.mk (win32/win32.$(OBJEXT)): move win32.o into `win32` directory. * common.mk (win32/file.$(OBJEXT)): add new target for win32/file.c. * configure.in: move win32.o into `win32` directory and add win32/file.o to MISSING. * file.c (file_load_ok, rb_file_load_ok): replace static file_load_ok() with public rb_file_load_ok(). It's to link Windows implementation in win32/file.c. * file.c (rb_find_file_ext_safe): ditto. * file.c (rb_find_file_safe): ditto. * win32/file.c (rb_file_load_ok): new file. Add Windows specific optimized implementation of rb_file_load_ok(). We created a separated file to avoid too many #ifdef macro which is unreadable. * win32/Makefile.sub (PLATFORM_DIR): add a variable for `win32` directory. * win32/Makefile.sub (MISSING): move win32.obj into `win32` directory and add win32/file.obj to MISSING. * win32/Makefile.sub (MAKEDIRS): replace MINIRUBY with BASERUBY. It's because miniruby doesn't exist when making `win32` directory. * win32/Makefile.sub (clean-platform): add new target to clean `win32` directory. * win32/Makefile.sub ({$(srcdir)}.c{}.obj): make it not match win32/file.c to build properly. * win32/Makefile.sub (win32/win32.$(OBJEXT)): move win32.obj into `win32` directory. Patch created with Luis Lavena. [ruby-core:42480] [Feature #5999] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-28 19:51:25 +04:00
!if !defined(PLATFORM_DIR)
PLATFORM_DIR = win32
!endif
arch = $(ARCH)-$(PLATFORM)
sitearch = $(ARCH)-$(RT)
!if !defined(ruby_version)
ruby_version = $(MAJOR).$(MINOR).0+$(ABI_VERSION)
!endif
!if !defined(RUBY_VERSION_NAME)
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
!endif
RUBY_PROGRAM_VERSION = $(MAJOR).$(MINOR).$(TEENY)
!ifndef RUBY_SO_NAME
RUBY_SO_NAME = $(RT)-$(RUBY_BASE_NAME)$(ruby_version:.=)
!if "$(ARCH)" != "i386"
RUBY_SO_NAME = $(ARCH)-$(RUBY_SO_NAME)
!endif
!endif
!ifndef RUBY_PLATFORM
RUBY_PLATFORM = $(arch)
!endif
!if !defined(prefix)
prefix = /usr
!endif
!if !defined(exec_prefix)
exec_prefix = $(prefix)
!endif
!if !defined(libdir_basename)
libdir_basename = lib
!endif
!if !defined(libdir)
libdir = $(exec_prefix)/$(libdir_basename)
!endif
!if !defined(datadir)
datadir = $(prefix)/share
!endif
!ifndef EXTOUT
EXTOUT = .ext
!endif
!ifndef TESTUI
TESTUI = console
!endif
!ifndef TESTS
TESTS =
!endif
!ifndef CAPITARGET
! ifdef DOXYGEN
CAPITARGET = capi
! else
CAPITARGET = nodoc
! endif
!endif
!ifndef DOCTARGETS
! if "$(RDOCTARGET)" == "rdoc" || "$(RDOCTARGET)" == ""
DOCTARGETS = $(DOCTARGETS) rdoc
! endif
! if "$(CAPITARGET)" == "capi"
DOCTARGETS = $(DOCTARGETS) capi
! endif
!endif
!ifndef INSTALLDOC
! if "$(DOCTARGETS)" != ""
INSTALLDOC = all
! else
INSTALLDOC = nodoc
DOCTARGETS = nodoc
! endif
!endif
!if !defined(OUTFLAG)
OUTFLAG = -Fe
!endif
!if !defined(COUTFLAG)
COUTFLAG = -Fo
!endif
!if !defined(CPPOUTFLAG)
! if $(MSC_VER) < 1600
CPPOUTFLAG = >
! else
CPPOUTFLAG = -Fi
! endif
!endif
!if !defined(CSRCFLAG)
CSRCFLAG = -Tc
!endif
!if !defined(RUNTIMEFLAG)
RUNTIMEFLAG = -MD
!endif
!if !defined(COMPILERFLAG)
COMPILERFLAG = -Zm600
!endif
!if !defined(WARNFLAGS)
!if $(MSC_VER) >= 1400
WARNFLAGS = -W2 -wd4100 -wd4127 -wd4210 -wd4214 -wd4255 -wd4574 \
-wd4668 -wd4710 -wd4711 -wd4820 -wd4996 \
-we4028 -we4142 -we4047
!else
WARNFLAGS = -W2
!endif
!endif
WERRORFLAG = -WX
!if !defined(CFLAGS_NO_ARCH)
CFLAGS_NO_ARCH = $(RUNTIMEFLAG) $(DEBUGFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(COMPILERFLAG)
!endif
!if !defined(ARCH_FLAG)
ARCH_FLAG = $(PROCESSOR_FLAG)
!endif
!if !defined(CFLAGS)
CFLAGS = $(CFLAGS_NO_ARCH) $(ARCH_FLAG)
!endif
!if !defined(CXXFLAGS)
CXXFLAGS = $(CFLAGS)
!endif
!if !defined(LDFLAGS)
LDFLAGS = -incremental:no -debug -opt:ref -opt:icf
!endif
!if !defined(XLDFLAGS)
XLDFLAGS = -stack:$(STACK)
!endif
!if !defined(RFLAGS)
RFLAGS = -r
!endif
!if !defined(EXTLIBS)
EXTLIBS =
!endif
!if !defined(EXTSOLIBS)
EXTSOLIBS =
!endif
!if !defined(LIBS)
LIBS = user32.lib advapi32.lib shell32.lib ws2_32.lib
!if $(MSC_VER) >= 1400
LIBS = $(LIBS) iphlpapi.lib
!endif
LIBS = $(LIBS) imagehlp.lib shlwapi.lib bcrypt.lib $(EXTLIBS)
!endif
!if !defined(MISSING)
MISSING = crypt.obj ffs.obj langinfo.obj lgamma_r.obj strlcat.obj strlcpy.obj win32/win32.obj win32/file.obj setproctitle.obj
!if $(RT_VER) < 120
MISSING = $(MISSING) acosh.obj cbrt.obj erf.obj nan.obj tgamma.obj
!endif
MISSING = $(MISSING) explicit_bzero.obj
!endif
DLNOBJ = dln.obj
!if "$(ARCH)" == "x64"
COROUTINE_OBJ = coroutine/win64/Context.obj
COROUTINE_SRC = $(COROUTINE_OBJ:.obj=.asm)
!elseif "$(ARCH)" == "i386"
COROUTINE_OBJ = coroutine/win32/Context.obj
COROUTINE_SRC = $(COROUTINE_OBJ:.obj=.asm)
!else
COROUTINE_OBJ = coroutine/copy/Context.obj
COROUTINE_SRC = $(COROUTINE_OBJ:.obj=.c)
!endif
COROUTINE_H = $(COROUTINE_OBJ:.obj=.h)
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
ARFLAGS = -machine:$(MACHINE) -out:
LD = $(CC)
LDSHARED = $(LD) -LD
XCFLAGS = -DRUBY_EXPORT $(INCFLAGS) $(XCFLAGS)
!if $(MSC_VER) >= 1400
# Prevents VC++ 2005 (cl ver 14) warnings
MANIFESTTOOL = mt -nologo
LDSHARED_0 = @if exist $(@).manifest $(MINIRUBY) -run -e wait_writable -- -n 10 $@
LDSHARED_1 = @if exist $(@).manifest $(MANIFESTTOOL) -manifest $(@).manifest -outputresource:$(@);2
LDSHARED_2 = @if exist $(@).manifest @$(RM) $(@:/=\).manifest
!endif
CPPFLAGS = $(DEFS) $(ARCHDEFS) $(CPPFLAGS)
!if "$(USE_RUBYGEMS)" == "no"
CPPFLAGS = -DDISABLE_RUBYGEMS $(CPPFLAGS)
!endif
!ifndef MJIT_SUPPORT
MJIT_SUPPORT = yes
!endif
!if "$(CPPOUTFLAG)" == ">"
MJIT_HEADER_FLAGS =
!else
MJIT_HEADER_FLAGS = -P
!endif
MJIT_HEADER_SUFFIX =
MJIT_HEADER_ARCH =
MJIT_HEADER_INSTALL_DIR = include/$(RUBY_VERSION_NAME)/$(arch)
MJIT_PRECOMPILED_HEADER_NAME = rb_mjit_header-$(RUBY_PROGRAM_VERSION).pch
MJIT_PRECOMPILED_HEADER = $(MJIT_HEADER_INSTALL_DIR)/$(MJIT_PRECOMPILED_HEADER_NAME)
!ifndef MJIT_CC
MJIT_CC = $(CC)
!endif
!ifndef MJIT_OPTFLAGS
# TODO: Use only $(OPTFLAGS) for performance. It requires to modify flags for precompiled header too.
# For now, using flags used for building precompiled header to make JIT succeed.
MJIT_OPTFLAGS = -DMJIT_HEADER $(CFLAGS) $(XCFLAGS) $(CPPFLAGS)
!endif
!ifndef MJIT_DEBUGFLAGS
# TODO: Make this work... Another header for debug build needs to be installed first.
MJIT_DEBUGFLAGS = $(empty) $(DEBUGFLAGS) $(empty)
MJIT_DEBUGFLAGS = $(MJIT_DEBUGFLAGS: -Zi = -Z7 )
!endif
!ifndef MJIT_LDSHARED
MJIT_LDSHARED = $(MJIT_CC) -LD
!endif
POSTLINK =
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
DLDFLAGS = $(LDFLAGS) -dll
MAINLIBS = $(LIBS)
SOLIBS =
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
!ifndef RCFLAGS
!if $(MSC_VER) >= 1600
RCFLAGS=-nologo
!endif
!endif
ENABLE_SHARED = yes
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
LIBRUBY_LDSHARED = $(LDSHARED)
LIBRUBY_DLDFLAGS = $(EXTLDFLAGS) -implib:dummy.lib -def:$(RUBYDEF)
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
EXEEXT = .exe
EXECUTABLE_EXTS = ".exe",".com",".cmd",".bat"
!if !defined(PROGRAM)
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
!endif
!if !defined(WPROGRAM) && defined(RUBYW_INSTALL_NAME)
WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
!endif
RUBYDEF = $(RUBY_SO_NAME).def
!if "$(CROSS_COMPILING)" == "yes"
MINIRUBY = $(RUBY) -I$(MAKEDIR) -r$(arch)-fake
RUNRUBY = $(MINIRUBY)
!else
MINIRUBY = .\miniruby$(EXEEXT) -I$(srcdir)/lib -I.
RUNRUBY = .\$(PROGRAM) -I$(srcdir)/lib -I"$(EXTOUT)/$(arch)" -I.
!endif
MINIRUBY = $(MINIRUBY) $(MINIRUBYOPT)
2020-04-04 21:57:05 +03:00
RUNRUBY = $(RUNRUBY) "$(tooldir)/runruby.rb" --extout="$(EXTOUT)" $(RUNRUBYOPT) -- $(RUN_OPTS)
!if "$(CROSS_COMPILING)" == "yes"
XRUBY = $(MINIRUBY)
BOOTSTRAPRUBY = $(BASERUBY)
!else
BOOTSTRAPRUBY = $(MINIRUBY)
XRUBY = $(RUNRUBY)
!endif
BTESTRUBY = $(MINIRUBY)
!ifndef RUBY
RUBY = ruby
!endif
DTRACE_EXT = dmyh
!if !defined(STACK)
2019-06-19 12:06:57 +03:00
!if "$(ARCH)" == "x64"
STACK = 0x400000
!else
STACK = 0x200000
!endif
!if defined(STACK_COMMIT)
STACK = $(STACK),$(STACK_COMMIT)
!endif
!endif
ORGLIBPATH = $(LIB)
#### End of system configuration section. ####
LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
LIBRUBY_SO = $(RUBY_SO_NAME).dll
LIBRUBY_SONAME= $(RUBY_SO_NAME).dll
LIBRUBY = $(RUBY_SO_NAME).lib
LIBRUBYARG = $(LIBRUBY)
LIBRUBYARG_SHARED = $(LIBRUBY)
LIBRUBY_RELATIVE = yes
THREAD_MODEL = win32
THREAD_IMPL_H = thread_$(THREAD_MODEL).h
THREAD_IMPL_SRC = thread_$(THREAD_MODEL).c
!if "$(CROSS_COMPILING)" == "yes"
PREP = $(arch)-fake.rb
!else
PREP = miniruby$(EXEEXT)
!endif
!if !defined(EXTSTATIC)
EXTSTATIC =
!endif
OBJEXT = obj
ASMEXT = asm
INSTALLED_LIST= .installed.list
SRC_FILE = $(<:\=/)
OS_SRC_FILE = $(<:/=\)
DEST_FILE = $(@:\=/)
OS_DEST_FILE = $(@:/=\)
!if !defined(WINMAINOBJ)
WINMAINOBJ = winmain.$(OBJEXT)
!endif
MAINSRC = $(MAINOBJ:.obj=.c)
ARCHMINIOBJS = dmydln.$(OBJEXT) miniruby.res
LIBOBJS = $(MISSING) $(LIBOBJS)
!ifndef COMMON_LIBS
COMMON_LIBS = m
!endif
!ifndef COMMON_MACROS
COMMON_MACROS = WIN32_LEAN_AND_MEAN WIN32
!endif
!ifndef COMMON_HEADERS
COMMON_HEADERS = winsock2.h ws2tcpip.h windows.h
!endif
!if "$(EXTSTATIC)" == "static"
ENCOBJS = enc/encinit.$(OBJEXT) enc/libenc.lib enc/libtrans.lib
EXTOBJS = ext/extinit.$(OBJEXT)
! if !defined(ENCSTATIC)
ENCSTATIC = static
! endif
!else
ENCOBJS = dmyenc.$(OBJEXT)
EXTOBJS = dmyext.$(OBJEXT)
!endif
arch_hdrdir = $(EXTOUT)/include/$(arch)
top_srcdir = $(srcdir)
hdrdir = $(srcdir)/include
2020-04-04 21:57:05 +03:00
tooldir = $(srcdir)/tool
VPATH = $(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/missing;$(win_srcdir)
!ifndef GIT
GIT = git
!endif
!if "$(HAVE_GIT)" == "yes" || "$(HAVE_GIT)" == "no"
!else if "$(GIT)" == ""
HAVE_GIT = no
!else if [for %I in ($(GIT)) do @if not "%~xI" == "" exit 1]
! if [for %I in ($(GIT)) do @if not "%~$$PATH:I" == "" exit 1]
HAVE_GIT = yes
! else
HAVE_GIT = no
! endif
!else
! if [for %x in (%PATHEXT:;= %) do @for %I in ($(GIT)%x) do @if not "%~$$PATH:I" == "" exit 1]
HAVE_GIT = yes
! else
HAVE_GIT = no
! endif
!endif
2019-05-10 09:22:54 +03:00
!if defined(VCS)
!else if exist($(srcdir)/.git)
VCS = $(GIT)
VCSUP = $(VCS) pull --rebase $(GITPULLOPTIONS)
!else
VCSUP = rem
!endif
ruby_pc = $(RUBY_BASE_NAME)-$(MAJOR).$(MINOR).pc
MESSAGE_BEGIN = @(for %I in (
MESSAGE_END = ) do @echo.%~I)
ECHO_BEGIN = @echo.
ECHO_END =
all: $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub $(srcdir)/common.mk
prog: config
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
stub: $(STUBPROGRAM)
rubystub: $(STUBPROGRAM)
!if !exist(enc/trans/newline.c) && exist($(srcdir)/enc/trans/newline.c)
NEWLINE_C = $(srcdir)/enc/trans/newline.c
!else
NEWLINE_C = enc/trans/newline.c
!endif
!if !exist(miniprelude.c) && exist($(srcdir)/miniprelude.c)
MINIPRELUDE_C = $(srcdir)/miniprelude.c
!else
MINIPRELUDE_C = miniprelude.c
!endif
!if !exist(golf_prelude.c) && exist($(srcdir)/golf_prelude.c)
GOLF_PRELUDE_C = $(srcdir)/golf_prelude.c
!else
GOLF_PRELUDE_C = golf_prelude.c
!endif
RBCONFIG = ./.rbconfig.time
2021-08-07 12:32:24 +03:00
!if "$(GITHUB_ACTIONS)" == "true"
ACTIONS_GROUP = @echo ^#^#[group]$(@:yes-=)
ACTIONS_ENDGROUP = @echo ^#^#[endgroup]
!else
ACTIONS_GROUP = @:: $(empty)
ACTIONS_ENDGROUP = @::
!endif
ABI_VERSION_HDR = $(hdrdir)/ruby/internal/abi.h
!include $(srcdir)/common.mk
!ifdef SCRIPTPROGRAMS
!else if [echo>scriptbin.mk SCRIPTPROGRAMS = \]
!else if [for %I in ($(srcdir:/=\)\bin\*) do @echo>>scriptbin.mk %~nI.exe \]
!else if [echo.>>scriptbin.mk]
!else if [echo.>>scriptbin.mk]
!endif
!if [for %I in ($(srcdir:/=\)\bin\*) do @for %J in (\
"%~nI.exe: $$(srcdir)/bin/%~nI" \
" $$(ECHO) generating $$(@)" \
" $$(Q) copy /y /b $$(STUBPROGRAM) $$(@) > nul" \
" $$(Q) echo.>>$$(@)" \
" $$(Q) echo.>>$$(@)" \
" $$(Q) copy /b $$(@)+$$(srcdir:/=\)\bin\%~nI $$(@) > nul" \
"" \
) do @echo.%~J>>scriptbin.mk]
!else
! include scriptbin.mk
! if [del scriptbin.mk > nul]
! endif
!endif
scriptbin: $(SCRIPTPROGRAMS)
$(SCRIPTPROGRAMS): $(STUBPROGRAM)
update-src::
@cd "$(srcdir:/=\)" && set LC_TIME=C && $(VCSUP)
.PHONY: reconfig
reconfig $(MKFILES): $(srcdir)/common.mk $(srcdir)/version.h \
$(hdrdir)/ruby/version.h $(ABI_VERSION_HDR) \
$(win_srcdir)/Makefile.sub $(win_srcdir)/configure.bat \
$(win_srcdir)/setup.mak $(win_srcdir)/enc-setup.mak \
$(srcdir)/enc/Makefile.in
$(COMSPEC) /C $(win_srcdir:/=\)\configure.bat $(configure_args)
@fc Makefile Makefile.old > nul && echo Makefile unchanged || \
(echo $(MKFILES) was updated, re-run $(MAKE). & exit 1)
RUBY_CONFIG_H = $(arch_hdrdir)/ruby/config.h
CONFIG_H = ./.config.h.time
config: config.status
config.status: $(CONFIG_H)
BANG = !
!if !exist(config.status)
!else if [for /f "skip=1 delims=, tokens=2-3" %I in (config.status) do @ \
if "%I" == "@RUBY_SO_NAME@" ( \
if not "%J" == "$(RUBY_SO_NAME)" exit 1 \
) else if "%I" == "@target_alias@" ( \
if not "%J" == "$(ARCH)-$(PLATFORM)" exit 1 \
) \
]
config.status: nul
!endif
guard = INCLUDE_RUBY_CONFIG_H
$(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
@echo Creating config.h
!if !exist("$(arch_hdrdir)")
@md $(arch_hdrdir:/=\)
!endif
!if !exist("$(arch_hdrdir)/ruby")
@md $(arch_hdrdir:/=\)\ruby
!endif
@$(IFCHANGE) "--timestamp=$(@:/=\)" $(RUBY_CONFIG_H:/=\) <<
#ifndef $(guard)
#define $(guard) 1
!if defined(MSC_VER_LOWER)
#if (_MSC_VER < $(MSC_VER_LOWER)) || (_MSC_VER > $(MSC_VER_UPPER))
#error MSC version unmatch: $(MSC_VER_LOWER)..$(MSC_VER_UPPER) is expected.
#endif
!else
#if _MSC_VER != $(MSC_VER)
#error MSC version unmatch: $(MSC_VER) is expected.
#endif
!endif
#define RUBY_MSVCRT_VERSION $(RT_VER)
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
!if $(MSC_VER) >= 1800
#define HAVE_STDBOOL_H 1
!endif
#define HAVE_STDLIB_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
!if $(MSC_VER) >= 1400
#define HAVE_LONG_LONG 1
!else
#define ULL_TO_DOUBLE(n) ((double)(unsigned long)((n)>>32) * (1I64 << 32) + (unsigned long)(n))
!endif
#define HAVE_OFF_T 1
#define SIZEOF_INT 4
#define SIZEOF_SHORT 2
#define SIZEOF_LONG 4
!if $(MSC_VER) >= 1400
#define SIZEOF_LONG_LONG 8
!else
#define SIZEOF_LONG_LONG 0
!endif
#define SIZEOF___INT64 8
#ifndef _INTEGRAL_MAX_BITS
#define _INTEGRAL_MAX_BITS 64
#endif
#define SIZEOF_OFF_T 8
2019-06-19 12:06:57 +03:00
!if "$(ARCH)" == "x64"
#define SIZEOF_VOIDP 8
!else
#define SIZEOF_VOIDP 4
!endif
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
#define SIGNEDNESS_OF_TIME_T -1
#define NEGATIVE_TIME_T 1
!if $(RT_VER) >= 80
#define SIZEOF_TIME_T 8
#define TIMET2NUM(v) LL2NUM(v)
#define NUM2TIMET(v) NUM2LL(v)
!else
#define SIZEOF_TIME_T 4
#define TIMET2NUM(v) LONG2NUM(v)
#define NUM2TIMET(v) NUM2LONG(v)
!endif
#define CLOCKID2NUM(v) INT2NUM(v)
#define NUM2CLOCKID(v) NUM2INT(v)
#define SIZEOF_CLOCK_T 4
#define SIZEOF_RLIM_T 0
2019-06-19 12:06:57 +03:00
!if "$(ARCH)" == "x64"
#define SIZEOF_SIZE_T 8
#define SIZEOF_PTRDIFF_T 8
#define SIZEOF_INTPTR_T 8
#define SIZEOF_UINTPTR_T 8
!else
#define SIZEOF_SIZE_T 4
#define SIZEOF_PTRDIFF_T 4
#define SIZEOF_INTPTR_T 4
#define SIZEOF_UINTPTR_T 4
!endif
!if $(MSC_VER) < 1400
#define SIZE_MAX UINT_MAX
!endif
!if $(MSC_VER) >= 1800
#define HAVE_VA_COPY 1
!else
#define HAVE_VA_COPY_VIA_STRUCT_ASSIGNMENT 1
!endif
!if $(MSC_VER) > 1100
#define NORETURN(x) __declspec(noreturn) x
!endif
!if $(MSC_VER) >= 1300
#define DEPRECATED(x) __declspec(deprecated) x
#define RUBY_CXX_DEPRECATED(mesg) __declspec(deprecated(mesg))
#define NOINLINE(x) __declspec(noinline) x
!endif
#define ALWAYS_INLINE(x) __forceinline x
#define WARN_UNUSED_RESULT(x) x
#define MAYBE_UNUSED(x) x
!if !defined(VS2022_FP_BUG)
2022-02-19 15:22:13 +03:00
#define HAVE___ASSUME 1
!endif
#define FUNC_STDCALL(x) __stdcall x
#define FUNC_CDECL(x) __cdecl x
#define FUNC_FASTCALL(x) __fastcall x
!if $(MSC_VER) >= 1500
#define RUBY_FUNCTION_NAME_STRING __FUNCTION__
#define PACKED_STRUCT(x) __pragma(pack(push, 1)) x __pragma(pack(pop))
!else
#define PACKED_STRUCT(x) x
!endif
!if "$(MACHINE)" == "x86" || "$(ARCH)" == "x64"
#define PACKED_STRUCT_UNALIGNED(x) PACKED_STRUCT(x)
!else
#define PACKED_STRUCT_UNALIGNED(x) x
!endif
#define RUBY_EXTERN extern __declspec(dllimport)
#define RUBY_ALIGNAS(n) __declspec(align(n))
#define RUBY_ALIGNOF __alignof
#define HAVE_DECL_SYS_NERR 1
#define HAVE_LIMITS_H 1
#define HAVE_FCNTL_H 1
#define HAVE_SYS_UTIME_H 1
#define HAVE_FLOAT_H 1
#define HAVE_TIME_H 1
#define rb_pid_t int
#define rb_gid_t int
#define rb_uid_t int
#define HAVE_STRUCT_STAT_ST_RDEV 1
#define HAVE_STRUCT_TIMEVAL 1
!if $(MSC_VER) >= 1900
#define HAVE_STRUCT_TIMESPEC
!endif
!if $(MSC_VER) >= 1600
#define HAVE_STDINT_H 1
!else
#define int8_t signed char
#define uint8_t unsigned char
#define int16_t short
#define uint16_t unsigned short
#define int32_t int
#define uint32_t unsigned int
#define int64_t __int64
#define uint64_t unsigned __int64
#define INT8_MIN _I8_MIN
#define INT8_MAX _I8_MAX
#define UINT8_MAX _UI8_MAX
#define INT16_MIN _I16_MIN
#define INT16_MAX _I16_MAX
#define UINT16_MAX _UI16_MAX
#define INT32_MIN _I32_MIN
#define INT32_MAX _I32_MAX
#define UINT32_MAX _UI32_MAX
#define INT64_MIN _I64_MIN
#define INT64_MAX _I64_MAX
#define UINT64_MAX _UI64_MAX
!endif
#define HAVE_INT8_T 1
#define HAVE_UINT8_T 1
#define SIZEOF_INT8_T 1
#define SIZEOF_UINT8_T 1
#define HAVE_INT16_T 1
#define HAVE_UINT16_T 1
#define SIZEOF_INT16_T 2
#define SIZEOF_UINT16_T 2
#define HAVE_INT32_T 1
#define HAVE_UINT32_T 1
#define SIZEOF_INT32_T 4
#define SIZEOF_UINT32_T 4
#define HAVE_INT64_T 1
#define HAVE_UINT64_T 1
#define SIZEOF_INT64_T 8
#define SIZEOF_UINT64_T 8
#define HAVE_INTPTR_T 1
#define HAVE_UINTPTR_T 1
#define HAVE_SSIZE_T 1
2019-06-19 12:06:57 +03:00
!if "$(ARCH)" == "x64"
#define ssize_t __int64
#define PRI_PTR_PREFIX "I64"
!else
#define ssize_t int
#define PRI_PTR_PREFIX PRI_INT_PREFIX
!endif
#define PRI_LL_PREFIX "I64"
#define PRI_PIDT_PREFIX PRI_INT_PREFIX
#define GETGROUPS_T int
#define TYPEOF_TIMEVAL_TV_SEC long
!if $(RT_VER) >= 120
#define HAVE_ACOSH 1
#define HAVE_ASINH 1
#define HAVE_ATANH 1
#define HAVE_CBRT 1
#define HAVE_LOG2 1
#define log2(x) log2(x)
#define HAVE_ERF 1
#define HAVE_ERFC 1
#define HAVE_ROUND 1
#define HAVE_TGAMMA 1
#define HAVE_NEXTAFTER 1
!endif
#define HAVE_ALLOCA 1
#define HAVE_DUP2 1
#define HAVE_MEMCMP 1
#define HAVE_MEMMOVE 1
#define HAVE_MKDIR 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOCK_GETRES 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_SPAWNV 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_STRERROR 1
#define HAVE_STRFTIME 1
#define HAVE_STRCHR 1
#define HAVE_STRSTR 1
#define HAVE_FLOCK 1
#define HAVE_ISNAN 1
#define HAVE_FINITE 1
!if $(RT_VER) >= 120
#define HAVE_NAN 1
!endif
#define HAVE_HYPOT 1
#define HAVE_FMOD 1
#define HAVE_FREXP 1
#define HAVE_MODF 1
#define HAVE_WAITPID 1
#define HAVE_FSYNC 1
#define HAVE_GETCWD 1
#define HAVE_TRUNCATE 1
#define HAVE_FTRUNCATE 1
#define HAVE_LSTAT 1
#define HAVE_TIMES 1
#define HAVE_FCNTL 1
#define HAVE_LINK 1
#define HAVE_READLINK 1
#define HAVE_SYMLINK 1
#define HAVE_LCHOWN 1
#define HAVE__SETJMP 1
#define HAVE_TELLDIR 1
#define HAVE_SEEKDIR 1
#define HAVE_MKTIME 1
#define HAVE_COSH 1
#define HAVE_SINH 1
#define HAVE_TANH 1
#define HAVE_SIGNBIT 1
#define HAVE_TZNAME 1
#define HAVE_DAYLIGHT 1
#define HAVE_GMTIME_R 1
#define HAVE_CHMOD 1
#define HAVE_CHOWN 1
#define HAVE_DUP 1
#define HAVE_EXECL 1
#define HAVE_EXECLE 1
#define HAVE_EXECV 1
#define HAVE_EXECVE 1
#define HAVE_GETEGID 1
#define HAVE_GETEUID 1
#define HAVE_GETGID 1
#define HAVE_GETUID 1
#define HAVE_PCLOSE 1
#define HAVE_PIPE 1
#define HAVE_POPEN 1
#define HAVE_SHUTDOWN 1
#define HAVE_SYSTEM 1
#define HAVE_TZSET 1
#define HAVE_UMASK 1
!if $(RT_VER) > 120
#define HAVE_QSORT_S
!endif
#define HAVE_TYPE_NET_LUID 1
!if $(MSC_VER) >= 1600
#define HAVE_NULLPTR 1
!endif
#define SETPGRP_VOID 1
#define RSHIFT(x,y) ((x)>>(int)y)
#define HAVE_RB_FD_INIT 1
#define RUBY_SETJMP(env) _setjmp(env)
#define RUBY_LONGJMP(env,val) longjmp(env,val)
#define RUBY_JMP_BUF jmp_buf
#ifndef __cplusplus
#define inline __inline
!if $(MSC_VER) >= 1800
#define restrict __restrict
!else
#define restrict /* not supported */
!endif
#endif
#define NEED_IO_SEEK_BETWEEN_RW 1
2019-06-19 12:06:57 +03:00
!if "$(MACHINE)" == "x86" || "$(ARCH)" == "x64"
#define STACK_GROW_DIRECTION -1
!endif
#define COROUTINE_H "$(COROUTINE_H)"
#define THREAD_IMPL_H "$(THREAD_IMPL_H)"
#define THREAD_IMPL_SRC "$(THREAD_IMPL_SRC)"
#define LOAD_RELATIVE 1
#define DLEXT ".so"
!if "$(libdir_basename)" != "lib"
#define LIBDIR_BASENAME "$(libdir_basename)"
!endif
!if "$(EXTSTATIC)" == "static"
#define EXTSTATIC 1
!endif
#define EXECUTABLE_EXTS $(EXECUTABLE_EXTS)
#define RUBY_COREDLL "$(RT)"
#define RUBY_PLATFORM "$(arch)"
#define RUBY_SITEARCH "$(sitearch)"
!if "$(MJIT_SUPPORT)" == "yes"
#define USE_MJIT 1
!else
#define USE_MJIT 0
!endif
#endif /* $(guard) */
<<
#!if exist($(RUBY_CONFIG_H))
#! if exist(config_h.bak)
# @del $(RUBY_CONFIG_H:.h=_h).bak
#! endif
# @copy $(RUBY_CONFIG_H) $(RUBY_CONFIG_H:.h=_h).bak
#!endif
#!if exist($(RUBY_CONFIG_H))
# @echo NMAKE will abort if config.h is changed, then restart NMAKE.
# @fc.exe $(RUBY_CONFIG_H) $(RUBY_CONFIG_H:.h=_h).bak > nul
# @echo $(RUBY_CONFIG_H) unchanged.
# @del $(RUBY_CONFIG_H)
# @ren $(RUBY_CONFIG_H:.h=_h).bak $(RUBY_CONFIG_H)
#!endif
EXECUTABLE_EXTS = $(EXECUTABLE_EXTS:"=) # "
EXECUTABLE_EXTS = $(EXECUTABLE_EXTS:,= )
config.status: $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub $(srcdir)/common.mk
@echo Creating <<$@
# Generated automatically by Makefile.sub.
s,@SHELL@,$$(COMSPEC),;t t
s,@BUILD_FILE_SEPARATOR@,\,;t t
s,@PATH_SEPARATOR@,;,;t t
s,@CFLAGS@,$(CFLAGS),;t t
s,@WERRORFLAG@,$(WERRORFLAG),;t t
s,@DEFS@,$(DEFS),;t t
s,@CPPFLAGS@,$(CPPFLAGS),;t t
s,@CXXFLAGS@,$(CXXFLAGS),;t t
s,@FFLAGS@,$(FFLAGS),;t t
s,@LDFLAGS@,$(LDFLAGS),;t t
s,@LIBS@,user32.lib,;t t
s,@MAINLIBS@,$(MAINLIBS),;t t
s,@exec_prefix@,$${prefix},;t t
s,@prefix@,$(prefix),;t t
s,@program_transform_name@,s,.*,$(PROGRAM_PREFIX)&$(PROGRAM_SUFFIX),,;t t
s,@bindir@,$${exec_prefix}/bin,;t t
s,@sbindir@,$${exec_prefix}/sbin,;t t
s,@libexecdir@,$${exec_prefix}/libexec,;t t
s,@datadir@,$${prefix}/share,;t t
s,@sysconfdir@,,;t t
s,@sharedstatedir@,$${prefix}/com,;t t
s,@localstatedir@,$${prefix}/var,;t t
s,@libdir@,$${exec_prefix}/$(libdir_basename),;t t
s,@includedir@,$${prefix}/include,;t t
s,@oldincludedir@,/usr/include,;t t
s,@infodir@,$${datadir}/info,;t t
s,@mandir@,$${datadir}/man,;t t
s,@ridir@,$${datadir}/ri,;t t
s,@docdir@,$${datadir}/doc/$${RUBY_BASE_NAME},;t t
s,@build@,$(CPU)-pc-$(PLATFORM),;t t
s,@build_alias@,$(CPU)-$(PLATFORM),;t t
s,@build_cpu@,$(CPU),;t t
s,@build_vendor@,pc,;t t
s,@build_os@,$(PLATFORM),;t t
s,@host@,$(CPU)-pc-$(PLATFORM),;t t
s,@host_alias@,$(CPU)-$(PLATFORM),;t t
s,@host_cpu@,$(CPU),;t t
s,@host_vendor@,pc,;t t
s,@host_os@,$(PLATFORM),;t t
s,@target@,$(ARCH)-pc-$(PLATFORM),;t t
s,@target_alias@,$(ARCH)-$(PLATFORM),;t t
s,@target_cpu@,$(ARCH),;t t
s,@target_vendor@,pc,;t t
s,@target_os@,$(PLATFORM),;t t
s,@NULLCMD@,:,;t t
s,@CC@,$(CC),;t t
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
s,@CPP@,$(CPP),;t t
s,@CXX@,$$(CC),;t t
s,@LD@,$$(CC),;t t
s,@YACC@,$(YACC),;t t
s,@RANLIB@,,;t t
s,@AR@,$(AR),;t t
s,@ARFLAGS@,$(ARFLAGS),;t t
s,@LN_S@,$(LN_S),;t t
s,@SET_MAKE@,MFLAGS = -$$(MAKEFLAGS),;t t
s,@RM@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rm.bat,;t t
s,@RMDIR@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rmdirs.bat,:t t
s,@RMDIRS@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rmdirs.bat,;t t
s,@RMALL@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rm.bat -f -r,:t t
s,@MAKEDIRS@,$$(COMSPEC) /E:ON /C $$(top_srcdir:/=\)\win32\makedirs.bat,;t t
s,@LIBOBJS@,$(LIBOBJS),;t t
s,@ALLOCA@,$(ALLOCA),;t t
s,@EXEEXT@,.exe,;t t
s,@EXECUTABLE_EXTS@,$(EXECUTABLE_EXTS),;t t
s,@OBJEXT@,$(OBJEXT),;t t
s,@ASMEXT@,$(ASMEXT),;t t
s,@XCFLAGS@,$(XCFLAGS),;t t
s,@XLDFLAGS@,$(XLDFLAGS),;t t
s,@DLDFLAGS@,$(DLDFLAGS) $$(LIBPATH),;t t
s,@EXTDLDFLAGS@,$(EXTDLDFLAGS),;t t
s,@ARCH_FLAG@,$(ARCH_FLAG),;t t
s,@STATIC@,$(STATIC),;t t
s,@CCDLFLAGS@,,;t t
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
s,@LDSHARED@,$(LDSHARED),;t t
s,@SOEXT@,dll,;t t
s,@DLEXT@,so,;t t
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
s,@LIBEXT@,lib,;t t
s,@STRIP@,$(STRIP),;t t
s,@ENCSTATIC@,$(ENCSTATIC),;t t
s,@EXTSTATIC@,$(EXTSTATIC),;t t
s,@setup@,Setup,;t t
s,@MINIRUBY@,$(MINIRUBY),;t t
s,@PREP@,miniruby$(EXEEXT),;t t
s,@RUNRUBY@,$(RUNRUBY),;t t
s,@EXTOUT@,$(EXTOUT),;t t
s,@ARCHFILE@,,;t t
s,@RDOCTARGET@,,;t t
s,@LIBRUBY_LDSHARED@,$(LIBRUBY_LDSHARED),;t t
s,@LIBRUBY_DLDFLAGS@,$(LIBRUBY_DLDFLAGS),;t t
s,@RUBY_BASE_NAME@,$(RUBY_BASE_NAME),;t t
s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t
s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t
s,@RUBY_SO_NAME@,$(RUBY_SO_NAME),;t t
s,@LIBRUBY_A@,$$(RUBY_SO_NAME)-static.lib,;t t
s,@LIBRUBY_SO@,$$(RUBY_SO_NAME).dll,;t t
s,@LIBRUBY_ALIASES@,$(LIBRUBY_ALIASES),;t t
s,@LIBRUBY@,$$(RUBY_SO_NAME).lib,;t t
s,@LIBRUBYARG@,$$(LIBRUBYARG_SHARED),;t t
s,@LIBRUBYARG_STATIC@,$$(LIBRUBY_A) $$(MAINLIBS),;t t
s,@LIBRUBYARG_SHARED@,$$(LIBRUBY),;t t
s,@SOLIBS@,$(SOLIBS),;t t
s,@DLDLIBS@,$(DLDLIBS),;t t
s,@ENABLE_SHARED@,yes,;t t
s,@BASERUBY@,$(BASERUBY),;t t
s,@OUTFLAG@,$(OUTFLAG),;t t
s,@COUTFLAG@,$(COUTFLAG),;t t
s,@CSRCFLAG@,$(CSRCFLAG),;t t
s,@CPPOUTFILE@,-P,;t t
s,@PRELOADENV@,,;t t
s,@LIBPATHENV@,PATH,;t t
s,@LIBPATHFLAG@, -libpath:%s,;t t
s,@RPATHFLAG@,,;t t
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
s,@LIBARG@,%s.lib,;t t
s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) -link $$(DLDFLAGS) -implib:$$(*F:.so=)-$$(arch).lib -pdb:$$(*F:.so=)-$$(arch).pdb -def:$$(DEFFILE),;t t
!if $(MSC_VER) >= 1400
s,@LINK_SO@,@if exist $$(@).manifest $$(RUBY) -run -e wait_writable -- -n 10 $$(@),;t t
s,@LINK_SO@,@if exist $$(@).manifest $(MANIFESTTOOL) -manifest $$(@).manifest -outputresource:$$(@);2,;t t
s,@LINK_SO@,@if exist $$(@).manifest $$(RM) $$(@:/=\).manifest,;t t
!endif
s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$(@) -c $$(CSRCFLAG)$$(<:\=/),;t t
s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$(@) -c -Tp$$(<:\=/),;t t
s,@ASSEMBLE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -Fa$$(@) -c $$(CSRCFLAG)$$(<:\=/),;t t
s,@ASSEMBLE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -Fa$$(@) -c -Tp$$(<:\=/),;t t
s,@COMPILE_RULES@,{$$(*VPATH*)}.%s.%s: .%s.%s:,;t t
s,@CXX_EXT@,cpp,;t t
s,@RULE_SUBST@,{.;$$(VPATH)}%s,;t t
s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) -link $$(LDFLAGS) $$(LIBPATH) $$(XLDFLAGS),;t t
s,@COMMON_LIBS@,$(COMMON_LIBS),;t t
s,@COMMON_MACROS@,$(COMMON_MACROS),;t t
s,@COMMON_HEADERS@,$(COMMON_HEADERS),;t t
s,@cleanobjs@,$$*.exp $$*.lib $$*.pdb,;t t
s,@DISTCLEANFILES@,vc*.pdb,;t t
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
s,@EXPORT_PREFIX@, ,;t t
s,@archlibdir@,$${libdir}/$${arch},;t t
s,@sitearchlibdir@,$${libdir}/$${sitearch},;t t
s,@archincludedir@,$${includedir}/$${arch},;t t
s,@sitearchincludedir@,$${includedir}/$${sitearch},;t t
s,@arch@,$(ARCH)-$(PLATFORM),;t t
s,@sitearch@,$(ARCH)-$(RT),;t t
s,@MAJOR@,$(MAJOR),;t t
s,@MINOR@,$(MINOR),;t t
s,@TEENY@,$(TEENY),;t t
s,@ruby_version@,$(ruby_version),;t t
s,@RUBY_PROGRAM_VERSION@,$$(MAJOR).$$(MINOR).$$(TEENY),;t t
s,@RUBY_API_VERSION@,$$(MAJOR).$$(MINOR),;t t
s,@rubylibprefix@,$${prefix}/lib/$${RUBY_BASE_NAME},;t t
s,@rubyarchdir@,$${rubylibdir}/$${arch},;t t
s,@rubylibdir@,$${rubylibprefix}/$${ruby_version},;t t
s,@sitedir@,$${rubylibprefix}/site_ruby,;t t
s,@sitearchdir@,$${sitelibdir}/$${sitearch},;t t
s,@sitelibdir@,$${sitedir}/$${ruby_version},;t t
s,@vendordir@,$${rubylibprefix}/vendor_ruby,;t t
s,@vendorarchdir@,$${vendorlibdir}/$${sitearch},;t t
s,@vendorlibdir@,$${vendordir}/$${ruby_version},;t t
s,@rubyhdrdir@,$$(includedir)/$${RUBY_BASE_NAME}-$$(ruby_version),;t t
s,@sitehdrdir@,$$(rubyhdrdir)/site_ruby,;t t
s,@vendorhdrdir@,$$(rubyhdrdir)/vendor_ruby,;t t
s,@rubyarchhdrdir@,$$(rubyhdrdir)/$${arch},;t t
s,@sitearchhdrdir@,$$(sitehdrdir)/$${sitearch},;t t
s,@vendorarchhdrdir@,$$(vendorhdrdir)/$${sitearch},;t t
s,@PLATFORM_DIR@,$(PLATFORM_DIR),;t t
s,@THREAD_MODEL@,$(THREAD_MODEL),;t t
s,@configure_args@,--with-make-prog=nmake --enable-shared $(configure_args),;t t
s,@configure_input@,$$configure_input,;t t
s,@srcdir@,$(srcdir),;t t
s,@top_srcdir@,$(srcdir),;t t
s,@try_header@,try_compile,;t t
s,@ruby_pc@,$(ruby_pc),;t t
s,@MJIT_SUPPORT@,$(MJIT_SUPPORT),;t t
<<KEEP
miniruby: miniruby$(EXEEXT)
miniruby$(EXEEXT):
@echo $(LIBS)
$(ECHO) linking $(@:\=/)
$(Q) $(PURIFY) $(CC) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(LIBS) -Fe$@ -link $(LDFLAGS)
@$(RM) miniruby.lib miniruby.exp
$(Q) miniruby.exe -v
$(Q) $(LDSHARED_1)
$(Q) $(LDSHARED_2)
miniruby.rc:
@exit > $@
!if "$(PROGRAM)" != ""
$(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
$(ECHO) linking $(@:\=/)
$(Q) $(PURIFY) $(CC) $(MAINOBJ) $(EXTOBJS) $(RUBY_INSTALL_NAME).res \
$(OUTFLAG)$@ $(LIBRUBYARG) -link $(LDFLAGS) $(XLDFLAGS)
$(Q) $(LDSHARED_0)
$(Q) $(LDSHARED_1)
$(Q) $(LDSHARED_2)
!endif
!if "$(WPROGRAM)" != ""
$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res
$(ECHO) linking $(@:\=/)
$(Q) $(PURIFY) $(CC) $(MAINOBJ) $(WINMAINOBJ) \
$(RUBYW_INSTALL_NAME).res $(OUTFLAG)$@ $(LIBRUBYARG) \
-link $(LDFLAGS) $(XLDFLAGS) -subsystem:Windows
$(Q) $(LDSHARED_0)
$(Q) $(LDSHARED_1)
$(Q) $(LDSHARED_2)
!endif
!if "$(STUBPROGRAM)" != ""
$(STUBPROGRAM): rubystub.$(OBJEXT) $(LIBRUBY) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
$(ECHO) linking $(@:\=/)
$(Q) $(PURIFY) $(CC) rubystub.$(OBJEXT) $(RUBY_INSTALL_NAME).res \
$(OUTFLAG)$@ $(LIBRUBYARG) -link $(LDFLAGS) $(XLDFLAGS)
$(Q) $(LDSHARED_0)
$(Q) $(LDSHARED_1)
$(Q) $(LDSHARED_2)
!endif
!if "$(LIBRUBY_SO_UPDATE)" == ""
PRE_LIBRUBY_UPDATE = $(RM) $(LIBRUBY_EXTS)
!else
PRE_LIBRUBY_UPDATE =
!endif
$(LIBRUBY_A): $(OBJS) $(INITOBJS)
!if "$(EXTSTATIC)" != ""
@-$(PRE_LIBRUBY_UPDATE)
!endif
$(ECHO) linking static-library $(@:\=/)
$(Q) $(AR) $(ARFLAGS)$@ $(OBJS) $(INITOBJS)
$(LIBRUBY): $(RUBYDEF)
$(ECHO) linking import-library $(@:\=/)
$(Q) $(AR) $(ARFLAGS)$@ -def:$(RUBYDEF)
$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
@echo $(DLDOBJS)
!if "$(EXTSTATIC)" == ""
@-$(PRE_LIBRUBY_UPDATE)
!endif
$(ECHO) linking shared-library $(@:\=/)
$(Q) $(LDSHARED) $(DLDOBJS) $(LIBRUBY_A) \
$(RUBY_SO_NAME).res $(SOLIBS) $(EXTSOLIBS) $(LIBS) -Fe$@ -link $(LDFLAGS) \
$(LIBRUBY_DLDFLAGS)
@$(RM) dummy.lib dummy.exp
$(Q) $(LDSHARED_0)
$(Q) $(LDSHARED_1)
$(Q) $(LDSHARED_2)
# | findstr -v -c:LNK4049 -c:LNK4217
$(RUBYDEF): $(LIBRUBY_A) $(RBCONFIG)
$(ECHO) generating $(@:\=/)
$(Q) $(MINIRUBY) $(srcdir)/win32/mkexports.rb \
-output=$@ -arch=$(ARCH) $(LIBRUBY_A)
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
{$(win_srcdir)}.def.lib:
$(Q) $(AR) $(ARFLAGS)$@ -def:$<
clean-local::
$(Q)$(RM) $(WINMAINOBJ) ext\extinit.c ext\extinit.$(OBJEXT) ext\vc*.pdb miniruby.lib
$(Q)$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
$(Q)$(RM) miniruby.rc $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
$(Q)$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF) ext\ripper\y.output
distclean-local::
$(Q)$(RM) ext\config.cache $(RBCONFIG:/=\) $(CONFIG_H:/=\)
-$(Q)$(RM) $(INSTALLED_LIST:/=\) $(arch_hdrdir:/=\)\ruby\config.h verconf.h
-$(Q)$(RMDIRS) $(arch_hdrdir:/=\)\ruby
ext/clean.mk ext/distclean.mk ext/realclean.mk::
$(Q)if exist $(EXTS_MK) $(MAKE) -k -f $(EXTS_MK) top_srcdir=$(srcdir) $(*F)
ext/clean gems/clean ext/distclean gems/distclean ext/realclean gems/realclean::
$(Q)cd $(@D) 2>nul && (for /R $(EXTS) %I in (.) \
do $(Q)if exist %I\Makefile ( \
cd %I && ( \
call set n=%I && \
call set n=%n:%CD%\$(@D)\=% && \
call set n=%n:\.=% && \
call echo $(@F)ing %n:\=/% & \
$(MAKE) $(MFLAGS) $(@F) & \
cd %CD% & \
$(RMDIRS) %I \
))) || @
ext/distclean gems/distclean ext/realclean gems/realclean::
$(Q)cd $(@D) 2>nul && (for /R $(EXTS) %I in (exts.mk*) \
do $(Q)(del %I & rmdir %~dpI)) || @
-$(Q)rmdir $(@D) 2> nul || @
clean-enc distclean-enc realclean-enc:
!if exist($(ENC_MK))
$(ECHO) $(@:-enc=ing) encodings
-$(Q)$(MAKE) $(MAKE_ENC) $(@:-enc=)
!endif
$(RBCONFIG): $(PREP)
$(RCFILES): $(RBCONFIG) $(srcdir)/revision.h $(srcdir)/win32/resource.rb
* configure.in (XCFLAGS): CFLAGS to comile ruby itself. * configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:03:46 +04:00
@$(MINIRUBY) $(srcdir)/win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) \
-rubyw_name=$(RUBYW_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) \
. $(icondirs) $(win_srcdir)
benchmark: introduce benchmark_driver.gem Makefile.in: Clone benchmark-driver repository in benchmark/benchmark-driver `make update-benchmark-driver`, like simplecov. win32/Makefile.sub: Roughly do the same thing. .gitignore: Ignore the cloned repository. common.mk: Trigger `make update-benchmark-driver` to run `make benchmark` and adjust arguments for benchmark_driver.gem. benchmark/require.yml: renamed from benchmark/bm_require.rb, benchmark/prepare_require.rb benchmark/require_thread.yml: renamed from benchmark/bm_require_thread.rb, benchmark/prepare_require_thread.rb benchmark/so_count_words.yml: renamed from benchmark/bm_so_count_words.rb, benchmark/prepare_so_count_words.rb, benchmark/wc.input.base benchmark/so_k_nucleotide.yml: renamed from benchmark/bm_so_k_nucleotide.rb, benchmark/prepare_so_k_nucleotide.rb, benchmark/make_fasta_output.rb benchmark/so_reverse_complement.yml: renamed from benchmark/bm_so_reverse_complement.rb, benchmark/prepare_so_reverse_complement.rb, benchmark/make_fasta_output.rb I'm sorry but I made some duplications between benchmark/require.yml and benchmark/require_thread.yml, and between benchmark/so_k_nucleotide.yml and benchmark/so_reverse_complement.yml. If you're not comfortable with it, please combine these YAMLs to share the same prelude. One YAML file can have multiple benchmark definitions sharing prelude. benchmark/driver.rb: Replace its core feature with benchmark_driver.gem. Some old features are gone for now, but I'll add them again later. [Misc #14902] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08 17:38:05 +03:00
update-benchmark-driver:
$(GIT) clone https://github.com/benchmark-driver/benchmark-driver $(srcdir)/benchmark/benchmark-driver || \
$(GIT) -C $(srcdir)/benchmark/benchmark-driver pull origin master
$(ruby_pc): $(RBCONFIG)
2020-04-04 21:57:05 +03:00
@$(BOOTSTRAPRUBY) $(tooldir)/expand-config.rb \
-output=$@ -mode=$(INSTALL_DATA_MODE) -config=rbconfig.rb \
$(srcdir)/template/ruby.pc.in
{$(srcdir)/coroutine/win32}.asm{coroutine/win32}.obj:
$(ECHO) assembling $(<:\=/)
$(Q) $(AS) $(ASFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(<:\=/)
{$(srcdir)/coroutine/win64}.asm{coroutine/win64}.obj:
$(ECHO) assembling $(<:\=/)
$(Q) $(AS) $(ASFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(<:\=/)
{$(srcdir)/enc/trans}.c.obj:
$(ECHO) compiling $(<:\=/)
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
{$(srcdir)/enc}.c.obj:
$(ECHO) compiling $(<:\=/)
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
{$(srcdir)/missing}.c.obj:
$(ECHO) compiling $(<:\=/)
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
{$(win_srcdir)}.c.obj:
$(ECHO) compiling $(<:\=/)
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
* Makefile.in (PLATFORM_DIR): add a variable for `win32` directory. * Makefile.in (clean-platform): add new target. It cleans `win32` directory. * common.mk (clean): add a dependency for `win32` directory. * common.mk (distclean): ditto. * common.mk (distclean-platform): add new target. It cleans `win32` directory. * common.mk ($(PLATFORM_D)): add new target to make `win32` directory. * common.mk (win32/win32.$(OBJEXT)): move win32.o into `win32` directory. * common.mk (win32/file.$(OBJEXT)): add new target for win32/file.c. * configure.in: move win32.o into `win32` directory and add win32/file.o to MISSING. * file.c (file_load_ok, rb_file_load_ok): replace static file_load_ok() with public rb_file_load_ok(). It's to link Windows implementation in win32/file.c. * file.c (rb_find_file_ext_safe): ditto. * file.c (rb_find_file_safe): ditto. * win32/file.c (rb_file_load_ok): new file. Add Windows specific optimized implementation of rb_file_load_ok(). We created a separated file to avoid too many #ifdef macro which is unreadable. * win32/Makefile.sub (PLATFORM_DIR): add a variable for `win32` directory. * win32/Makefile.sub (MISSING): move win32.obj into `win32` directory and add win32/file.obj to MISSING. * win32/Makefile.sub (MAKEDIRS): replace MINIRUBY with BASERUBY. It's because miniruby doesn't exist when making `win32` directory. * win32/Makefile.sub (clean-platform): add new target to clean `win32` directory. * win32/Makefile.sub ({$(srcdir)}.c{}.obj): make it not match win32/file.c to build properly. * win32/Makefile.sub (win32/win32.$(OBJEXT)): move win32.obj into `win32` directory. Patch created with Luis Lavena. [ruby-core:42480] [Feature #5999] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-28 19:51:25 +04:00
{$(srcdir)}.c{}.obj:
$(ECHO) compiling $(<:\=/)
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
.c.obj:
$(ECHO) compiling $(<:\=/)
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
{$(srcdir)/missing}.c.asm:
$(ECHO) translating $(<:\=/)
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/)
{$(win_srcdir)}.c.asm:
$(ECHO) translating $(<:\=/)
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/)
{$(srcdir)}.c{}.asm:
$(ECHO) translating $(<:\=/)
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/)
.c.asm:
$(ECHO) translating $(<:\=/)
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/)
{$(srcdir)/missing}.c.i:
$(ECHO) preprocessing $(<:\=/)
$(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Fi:$@ $(CSRCFLAG)$(<:\=/)
{$(win_srcdir)}.c.i:
$(ECHO) preprocessing $(<:\=/)
$(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Fi:$@ $(CSRCFLAG)$(<:\=/)
{$(srcdir)}.c{}.i:
$(ECHO) preprocessing $(<:\=/)
$(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Fi:$@ $(CSRCFLAG)$(<:\=/)
.c.i:
$(ECHO) preprocessing $(<:\=/)
$(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Fi:$@ $(CSRCFLAG)$(<:\=/)
.rc.res:
$(ECHO) compiling $(<:\=/)
$(Q) $(RC) $(RCFLAGS) -I. -I$(<D) $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:\=/)
lex.c: {$(srcdir)}lex.c.blt
copy $(?:/=\) $@
$(srcdir)/enc/jis/props.h: {$(srcdir)}enc/jis/props.h.blt
@if not exist $(@D:/=\) md $(@D:/=\)
$(ECHO) copying $@
$(Q) copy $(?:/=\) $(@:/=\) > nul
$(OBJS): {$(hdrdir)/ruby}win32.h
win32/win32.$(OBJEXT): {$(VPATH)}id.h
* Makefile.in (PLATFORM_DIR): add a variable for `win32` directory. * Makefile.in (clean-platform): add new target. It cleans `win32` directory. * common.mk (clean): add a dependency for `win32` directory. * common.mk (distclean): ditto. * common.mk (distclean-platform): add new target. It cleans `win32` directory. * common.mk ($(PLATFORM_D)): add new target to make `win32` directory. * common.mk (win32/win32.$(OBJEXT)): move win32.o into `win32` directory. * common.mk (win32/file.$(OBJEXT)): add new target for win32/file.c. * configure.in: move win32.o into `win32` directory and add win32/file.o to MISSING. * file.c (file_load_ok, rb_file_load_ok): replace static file_load_ok() with public rb_file_load_ok(). It's to link Windows implementation in win32/file.c. * file.c (rb_find_file_ext_safe): ditto. * file.c (rb_find_file_safe): ditto. * win32/file.c (rb_file_load_ok): new file. Add Windows specific optimized implementation of rb_file_load_ok(). We created a separated file to avoid too many #ifdef macro which is unreadable. * win32/Makefile.sub (PLATFORM_DIR): add a variable for `win32` directory. * win32/Makefile.sub (MISSING): move win32.obj into `win32` directory and add win32/file.obj to MISSING. * win32/Makefile.sub (MAKEDIRS): replace MINIRUBY with BASERUBY. It's because miniruby doesn't exist when making `win32` directory. * win32/Makefile.sub (clean-platform): add new target to clean `win32` directory. * win32/Makefile.sub ({$(srcdir)}.c{}.obj): make it not match win32/file.c to build properly. * win32/Makefile.sub (win32/win32.$(OBJEXT)): move win32.obj into `win32` directory. Patch created with Luis Lavena. [ruby-core:42480] [Feature #5999] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-28 19:51:25 +04:00
dir.$(OBJEXT) win32/win32.$(OBJEXT): {$(srcdir)}win32/dir.h
file.$(OBJEXT) win32/win32.$(OBJEXT): {$(VPATH)}win32/file.h
ext/extinit.obj: ext/extinit.c $(SETUP)
$(ECHO) compiling ext/extinit.c
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
probes.h: {$(VPATH)}probes.dmyh
@$(ECHO) making dummy <<$(DEST_FILE)
#include "$(*F).dmyh"
<<KEEP
main: mjit-headers
yes-mjit-headers: $(MJIT_PRECOMPILED_HEADER)
clean-local::
$(Q)$(RM) $(MJIT_PRECOMPILED_HEADER_NAME) $(MJIT_PRECOMPILED_HEADER_NAME:.pch=.)$(OBJEXT)
$(Q)$(RM) $(TIMESTAMPDIR)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=.time) mjit_config.h
$(Q)$(RM) $(MJIT_HEADER_INSTALL_DIR)/rb_mjit_header-*.pch
$(Q)$(RM) $(MJIT_HEADER_INSTALL_DIR)/rb_mjit_header-*.$(OBJEXT)
-$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) 2> $(NULL) || exit 0
$(Q)$(RM) $(arch_hdrdir)/rb_mjit_header-*.pch
$(Q)$(RM) $(arch_hdrdir)/rb_mjit_header-*.$(OBJEXT)
# Non-mswin environment is not using prebuilt precompiled header because upgrading compiler
# or changing compiler options may break MJIT so build (currently only by --mjit-debug though).
#
# But mswin is building precompiled header because cl.exe cannot leave macro after preprocess.
# As a workaround to use macro without installing many source files, it uses precompiled header
# without sufficient guard for a broken build.
#
# TODO: Fix the above issue by including VC version in header name, and create another header
# for --mjit-debug as well.
$(TIMESTAMPDIR)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=).time: probes.h vm.$(OBJEXT)
$(ECHO) building $(@F:.time=.pch)
$(Q) $(CC) -DMJIT_HEADER $(CFLAGS: -Zi = -Z7 ) $(XCFLAGS:-DRUBY_EXPORT =) -URUBY_EXPORT $(CPPFLAGS) $(srcdir)/vm.c -c -Yc \
MJIT MSVC: Use /Z7 to avoid PDB write race With MSVC, MJIT uses the /Fd option on an installed PDB file when compiling. Combined with the /Zi option, this causes the PDB file to be modified every time MJIT compiles. Concurrent modifications to the same PDB file is known to cause problems. MSVC even has an option, /FS to deal with it. When running MJIT tests in parallel, sometimes this leads to corrupting the PDB file, breaking subsequent compilations. On CI, we get messages like these: rb_mjit_header-3.1.0.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header. To avoid this race, use the /Z7 option when building precompiled header, which asks the compiler to put debug info into the .obj file, eliminating the need for pointing the compiler to the PDB file for the precompiled header. The /Fd option is changed to use a unique path based on the name of the dll output. Because of the /debug linker flag, we generate a PDB file at runtime even though we use /Z7. There are a couple things missing from this change: - Because MJIT uses the interpreter's CFLAGS build option and that contains /Zi, putting /Z7 at the end leads to a build warning - With /Z7 no PDB file is built anymore, so the code for installing the PDB file can be removed There might also be other problems with this change I haven't noticed while developing this change using Github Actions. I don't have a Windows dev environment with Visual Studio so I can't finish this change easily. Please feel free to complete this change if it makes sense. Note: - On master, you can see the PDB file changing with llvm-pdbutil or a simple checksum. There is an age field in the file that is bumped - I'm not sure if users can specify compile flags on MSVC. If they couldn't, maybe it's easier to change MJIT's compile options to use /Z7 when building the precompile header. - MJIT could pass different options at runtime to generate fewer files. Right now it inherits the /DEBUG linker flag which causes a PDB file to be generated at runtime even though /Z7 is used. Relevant MSVC docs: - [/Zi,/Z7](https://docs.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format?view=msvc-160) - [/DEBUG](https://docs.microsoft.com/en-us/cpp/build/reference/debug-generate-debug-info?view=msvc-160) - [/FS](https://docs.microsoft.com/en-us/cpp/build/reference/fs-force-synchronous-pdb-writes?view=msvc-160)
2021-10-29 00:48:21 +03:00
$(COUTFLAG)$(@F:.time=.)$(OBJEXT) -Fd$(@F:.time=.pdb) -Fp$(@F:.time=.pch).new -Z7
$(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.pch) $(@F:.time=.pch).new
$(MJIT_PRECOMPILED_HEADER_NAME): $(TIMESTAMPDIR)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=).time
$(MJIT_PRECOMPILED_HEADER): $(MJIT_PRECOMPILED_HEADER_NAME)
$(Q) $(MAKEDIRS) $(MJIT_HEADER_INSTALL_DIR)
$(Q) $(MAKE_LINK) $(MJIT_PRECOMPILED_HEADER_NAME) $@
$(Q) $(MAKE_LINK) $(MJIT_PRECOMPILED_HEADER_NAME:.pch=.)$(OBJEXT) $(MJIT_HEADER_INSTALL_DIR)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=.)$(OBJEXT)
$(Q) $(MAKEDIRS) $(arch_hdrdir)
$(Q) $(MAKE_LINK) $(MJIT_PRECOMPILED_HEADER_NAME) $(arch_hdrdir)/$(MJIT_PRECOMPILED_HEADER_NAME)
$(Q) $(MAKE_LINK) $(MJIT_PRECOMPILED_HEADER_NAME:.pch=.)$(OBJEXT) $(arch_hdrdir)/$(MJIT_PRECOMPILED_HEADER_NAME:.pch=.)$(OBJEXT)
INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
vmtc.inc vm.inc mjit_compile.inc
!if [exit > insns_rules.mk]
!else if [for %I in ($(INSNS)) do \
@for %J in (\
"%I: $$(srcdir)/insns.def {$$(VPATH)}vm_opts.h \" \
" $$(srcdir)/defs/opt_operand.def $$(srcdir)/defs/opt_insn_unif.def \" \
2020-04-04 21:57:05 +03:00
" $$(tooldir)/insns2vm.rb" \
" @$$(RM) $$(PROGRAM)" \
2020-04-04 21:57:05 +03:00
" $$(Q) $$(BASERUBY) -Ku $$(tooldir)/insns2vm.rb $$(INSNS2VMOPT) %I" \
"" \
) do @echo.%~J>>insns_rules.mk]
!else
! include insns_rules.mk
! if [del insns_rules.mk > nul]
! endif
!endif
verconf.h: verconf.mk
loadpath: verconf.h
@$(CPP) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/loadpath.c | \
sed -e '1,/^const char ruby_initial_load_paths/d;/;/,$$d' \
-e '/^^ /!d;s/ *"\\\\0"$$//;s/" *"//g'
mjit_config.h: $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
@echo making <<$@
#ifndef RUBY_MJIT_CONFIG_H
#define RUBY_MJIT_CONFIG_H 1
#define MJIT_CONFIG_ESCAPED_EQ "="
#define MJIT_HEADER_INSTALL_DIR "/$(MJIT_HEADER_INSTALL_DIR)"
#define MJIT_MIN_HEADER_NAME "$(MJIT_MIN_HEADER_NAME)"
#define MJIT_PRECOMPILED_HEADER_NAME "$(MJIT_PRECOMPILED_HEADER_NAME)"
<<KEEP
@
@(set sep=#define MJIT_CC_COMMON ) & \
for %I in ($(MJIT_CC)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
@echo /* MJIT_CC_COMMON */>> $@
@
@(set sep=#define MJIT_CFLAGS ) & \
for %I in ($(RUNTIMEFLAG) $(ARCH_FLAG)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
@echo /* MJIT_CFLAGS */>> $@
@
@(set sep=#define MJIT_OPTFLAGS ) & \
for %I in ($(MJIT_OPTFLAGS:^==" MJIT_CONFIG_ESCAPED_EQ ")) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
@echo /* MJIT_OPTFLAGS */>> $@
@
@(set sep=#define MJIT_DEBUGFLAGS ) & \
for %I in ($(MJIT_DEBUGFLAGS:^==" MJIT_CONFIG_ESCAPED_EQ ")) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
@echo /* MJIT_DEBUGFLAGS */>> $@
@
@(set sep=#define MJIT_LDSHARED ) & \
for %I in ($(MJIT_LDSHARED)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
@echo /* MJIT_LDSHARED */>> $@
@
@(set sep=#define MJIT_DLDFLAGS ) & \
for %I in ($(DLDFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
@echo /* MJIT_DLDFLAGS */>> $@
@
@(set sep=#define MJIT_LIBS ) & \
for %I in ($(LIBRUBYARG_SHARED)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
@echo /* MJIT_LIBS */>> $@
@
@echo.>> $@
@echo #endif /* RUBY_MJIT_CONFIG_H */>> $@
@$(Q:@=: :) type $@