1 # -*- mode: makefile; indent-tabs-mode: t -*-
6 MKFILES = Makefile verconf.mk
7 NULLCMD = exit /b0. # exit ignores the rest
11 TZ = # skip timezone tests
14 tooldir = $(srcdir)/tool
20 !if "$(BASERUBY)" == ""
21 ! if [ruby $(tooldir)/missing-baseruby.bat 2> nul]
22 ! else if [for %I in (ruby.exe) do @echo BASERUBY = %~s$$PATH:I > baseruby.mk]
26 ! if [del baseruby.mk]
28 !else if "$(BASERUBY)" == "no" || [($(BASERUBY) -eexit) > nul 2> nul]
31 !if "$(BASERUBY)" == ""
32 BASERUBY = $(tooldir:/=\)\missing-baseruby.bat
38 !ifndef REVISION_FORCE
39 !if "$(HAVE_BASERUBY)" == "yes"
40 REVISION_FORCE = PHONY
44 !ifndef CROSS_COMPILING
46 !else if "$(CROSS_COMPILING)" == "yes"
47 ! if "$(HAVE_BASERUBY)" != "yes"
48 ! error executable host ruby is required for cross-compiling
51 ! if "$(CROSS_COMPILING)" != "no"
52 ! error Bad CROSS_COMPILING
56 win_srcdir = $(srcdir)/win32
63 #### Start of system configuration section. ####
66 PATH = $(pathlist:;=/bin;)$(PATH)
67 INCLUDE = $(pathlist:;=/include;)
68 LIB = $(pathlist:;=/lib;)
71 ## variables may be overridden by $(compile_dir)/Makefile
75 !ifndef RUBY_BASE_NAME
78 !ifndef RUBY_INSTALL_NAME
79 RUBY_INSTALL_NAME = $(PROGRAM_PREFIX)$(RUBY_BASE_NAME)$(PROGRAM_SUFFIX)
81 !if !defined(RUBYW_INSTALL_NAME) || "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)"
82 RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw)
84 !if "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)"
85 RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
87 STUBPROGRAM = rubystub$(EXEEXT)
88 !if !defined(icondirs) && defined(ICONDIRS)
92 icondirs=$(icondirs:\=/)
93 iconinc=-I$(icondirs: = -I)
102 !if !defined(CPP) || "$(CPP)" == "cl"
106 YACC = $(BASERUBY) $(top_srcdir)/tool/lrama/exe/lrama
111 IFCHANGE = $(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat
112 RM = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat
114 RMDIR = $(COMSPEC) /C $(srcdir:/=\)\win32\rmdirs.bat
115 RMDIRS = $(COMSPEC) /C $(srcdir:/=\)\win32\rmdirs.bat
116 RMALL = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat -f -r
117 MAKEDIRS = $(COMSPEC) /E:ON /C $(srcdir:/=\)\win32\makedirs.bat
118 TOUCH = $(BASERUBY) -run -e touch --
122 !if !defined(BASERUBY)
125 !if !defined(TEST_RUNNABLE)
131 !if !defined(MACHINE)
134 !if "$(MACHINE)" == "x86"
135 !if !defined(PROCESSOR_LEVEL)
138 !if 6 < $(PROCESSOR_LEVEL)
141 !if $(MSC_VER) < 1400
142 PROCESSOR_FLAG = -G$(PROCESSOR_LEVEL)
144 CPU = i$(PROCESSOR_LEVEL)86
150 !if !defined(DEBUGFLAGS)
153 !if "$(RUBY_DEVEL)" == "yes"
154 XCFLAGS = $(XCFLAGS) -DRUBY_DEVEL=1
156 !if !defined(OPTFLAGS)
157 !if $(MSC_VER) < 1400
163 !if !defined(PLATFORM)
167 !error RT not defined. Retry from configure pass.
173 ARCHDEFS = -D_WIN32_WINNT=$(NTVER) $(ARCHDEFS)
175 !if !defined(PLATFORM_DIR)
179 arch = $(ARCH)-$(PLATFORM)
180 sitearch = $(ARCH)-$(RT)
181 !if !defined(ruby_version)
182 ruby_version = $(MAJOR).$(MINOR).0
184 !if defined(ABI_VERSION)
185 ruby_version = $(ruby_version)+$(ABI_VERSION)
187 !if !defined(RUBY_VERSION_NAME)
188 RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
190 RUBY_PROGRAM_VERSION = $(MAJOR).$(MINOR).$(TEENY)
193 RUBY_SO_NAME = $(RT)-$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0
194 !if "$(ARCH)" != "i386"
195 RUBY_SO_NAME = $(ARCH)-$(RUBY_SO_NAME)
198 !ifndef RUBY_PLATFORM
199 RUBY_PLATFORM = $(arch)
205 !if !defined(exec_prefix)
206 exec_prefix = $(prefix)
208 !if !defined(libdir_basename)
209 libdir_basename = lib
212 libdir = $(exec_prefix)/$(libdir_basename)
214 !if !defined(datadir)
215 datadir = $(prefix)/share
234 ! if "$(RDOCTARGET)" == "rdoc" || "$(RDOCTARGET)" == ""
235 DOCTARGETS = $(DOCTARGETS) rdoc
237 ! if "$(CAPITARGET)" == "capi"
238 DOCTARGETS = $(DOCTARGETS) capi
242 ! if "$(DOCTARGETS)" != ""
250 !if !defined(OUTFLAG)
253 !if !defined(COUTFLAG)
256 !if !defined(CPPOUTFLAG)
257 ! if $(MSC_VER) < 1600
263 !if !defined(CSRCFLAG)
266 !if !defined(RUNTIMEFLAG)
269 !if !defined(COMPILERFLAG)
270 COMPILERFLAG = -Zm600
272 !if !defined(WARNFLAGS)
273 !if $(MSC_VER) >= 1400
274 WARNFLAGS = -W2 -wd4100 -wd4127 -wd4210 -wd4214 -wd4255 -wd4574 \
275 -wd4668 -wd4710 -wd4711 -wd4820 -wd4996 \
276 -we4028 -we4142 -we4047
282 !if !defined(CFLAGS_NO_ARCH)
283 CFLAGS_NO_ARCH = $(RUNTIMEFLAG) $(DEBUGFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(COMPILERFLAG)
285 !if !defined(ARCH_FLAG)
286 ARCH_FLAG = $(PROCESSOR_FLAG)
289 CFLAGS = $(CFLAGS_NO_ARCH) $(ARCH_FLAG)
291 !if !defined(CXXFLAGS)
294 !if !defined(LDFLAGS)
295 LDFLAGS = -incremental:no -debug -opt:ref -opt:icf
297 !if !defined(XLDFLAGS)
298 XLDFLAGS = -stack:$(STACK)
303 !if !defined(EXTLIBS)
306 !if !defined(EXTSOLIBS)
310 LIBS = user32.lib advapi32.lib shell32.lib ws2_32.lib
311 !if $(MSC_VER) >= 1400
312 LIBS = $(LIBS) iphlpapi.lib
315 LIBS = $(LIBS) gmp.lib
317 LIBS = $(LIBS) imagehlp.lib shlwapi.lib bcrypt.lib $(EXTLIBS)
319 !if !defined(MISSING)
320 MISSING = crypt.obj ffs.obj langinfo.obj lgamma_r.obj strlcat.obj strlcpy.obj win32/win32.obj win32/file.obj setproctitle.obj
322 MISSING = $(MISSING) acosh.obj cbrt.obj erf.obj nan.obj tgamma.obj
324 MISSING = $(MISSING) explicit_bzero.obj
328 !if "$(ARCH)" == "x64"
329 COROUTINE_OBJ = coroutine/win64/Context.obj
330 COROUTINE_SRC = $(COROUTINE_OBJ:.obj=.asm)
331 !elseif "$(ARCH)" == "i386"
332 COROUTINE_OBJ = coroutine/win32/Context.obj
333 COROUTINE_SRC = $(COROUTINE_OBJ:.obj=.asm)
335 !error copy coroutine has been replaced with pthread implementation at 42130a64f02294dc8025af3a51bda518c67ab33d
337 COROUTINE_H = $(COROUTINE_OBJ:.obj=.h)
339 ARFLAGS = -machine:$(MACHINE) -out:
342 XCFLAGS = -DRUBY_EXPORT $(INCFLAGS) $(XCFLAGS)
343 !if $(MSC_VER) >= 1800
344 LDFLAGS = $(LDFLAGS) -manifest:embed,ID=2
345 !elseif $(MSC_VER) >= 1400
346 # Prevents VC++ 2005 (cl ver 14) warnings
347 MANIFESTTOOL = mt -nologo
348 LDSHARED_0 = @if exist $(@).manifest $(MINIRUBY) -run -e wait_writable -- -n 10 $@
349 LDSHARED_1 = @if exist $(@).manifest $(MANIFESTTOOL) -manifest $(@).manifest -outputresource:$(@);2
350 LDSHARED_2 = @if exist $(@).manifest @$(RM) $(@:/=\).manifest
352 CPPFLAGS = $(DEFS) $(ARCHDEFS) $(CPPFLAGS)
353 !if "$(USE_RUBYGEMS)" == "no"
354 CPPFLAGS = -DDISABLE_RUBYGEMS $(CPPFLAGS)
361 DLDFLAGS = $(LDFLAGS) -dll
364 RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
366 !if $(MSC_VER) >= 1600
372 LIBRUBY_LDSHARED = $(LDSHARED)
373 LIBRUBY_DLDFLAGS = $(EXTLDFLAGS) -implib:dummy.lib -def:$(RUBYDEF)
376 EXECUTABLE_EXTS = ".exe",".com",".cmd",".bat"
377 !if !defined(PROGRAM)
378 PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
380 !if !defined(WPROGRAM) && defined(RUBYW_INSTALL_NAME)
381 WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
383 RUBYDEF = $(RUBY_SO_NAME).def
384 !if "$(CROSS_COMPILING)" == "yes"
385 MINIRUBY = $(RUBY) -I$(MAKEDIR) -r$(arch)-fake
386 RUNRUBY = $(MINIRUBY)
388 MINIRUBY = .\miniruby$(EXEEXT) -I$(srcdir)/lib -I.
389 RUNRUBY = .\$(PROGRAM) -I$(srcdir)/lib -I"$(EXTOUT)/$(arch)" -I.
391 MINIRUBY = $(MINIRUBY) $(MINIRUBYOPT)
392 RUNRUBY = $(RUNRUBY) "$(tooldir)/runruby.rb" --extout="$(EXTOUT)" $(RUNRUBYOPT) -- $(RUN_OPTS)
393 yes_baseruby = $(HAVE_BASERUBY:no=)
394 no_baseruby = $(HAVE_BASERUBY:yes=)
395 !if "$(CROSS_COMPILING)" == "yes"
397 BOOTSTRAPRUBY = $(BASERUBY)
398 BOOTSTRAPRUBY_OPT = -r./$(arch)-fake
400 BOOTSTRAPRUBY = $(MINIRUBY)
404 BTESTRUBY = $(MINIRUBY) -r./$(arch)-fake
412 !if "$(ARCH)" == "x64"
417 !if defined(STACK_COMMIT)
418 STACK = $(STACK),$(STACK_COMMIT)
423 #### End of system configuration section. ####
425 LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
426 LIBRUBY_SO = $(RUBY_SO_NAME).dll
427 LIBRUBY_SONAME= $(RUBY_SO_NAME).dll
428 LIBRUBY = $(RUBY_SO_NAME).lib
429 LIBRUBYARG = $(LIBRUBY)
430 LIBRUBYARG_SHARED = $(LIBRUBY)
431 LIBRUBY_RELATIVE = yes
434 THREAD_IMPL_H = thread_$(THREAD_MODEL).h
435 THREAD_IMPL_SRC = thread_$(THREAD_MODEL).c
437 !if "$(CROSS_COMPILING)" == "yes"
438 PREP = $(arch)-fake.rb
441 PREP = miniruby$(EXEEXT)
445 !if !defined(EXTSTATIC)
452 INSTALLED_LIST= .installed.list
455 OS_SRC_FILE = $(<:/=\)
457 OS_DEST_FILE = $(@:/=\)
459 !if !defined(WINMAINOBJ)
460 WINMAINOBJ = winmain.$(OBJEXT)
462 MAINSRC = $(MAINOBJ:.obj=.c)
463 ARCHMINIOBJS = dmydln.$(OBJEXT) miniruby.res
464 LIBOBJS = $(MISSING) $(LIBOBJS)
469 !ifndef COMMON_MACROS
470 COMMON_MACROS = WIN32_LEAN_AND_MEAN WIN32
472 !ifndef COMMON_HEADERS
473 COMMON_HEADERS = winsock2.h ws2tcpip.h windows.h
476 !if "$(EXTSTATIC)" == "static"
477 ENCOBJS = enc/encinit.$(OBJEXT) enc/libenc.lib enc/libtrans.lib
478 EXTOBJS = ext/extinit.$(OBJEXT)
479 ! if !defined(ENCSTATIC)
483 ENCOBJS = dmyenc.$(OBJEXT)
484 EXTOBJS = dmyext.$(OBJEXT)
487 arch_hdrdir = $(EXTOUT)/include/$(arch)
488 top_srcdir = $(srcdir)
489 hdrdir = $(srcdir)/include
490 VPATH = $(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/missing;$(win_srcdir)
495 !if "$(HAVE_GIT)" == "yes" || "$(HAVE_GIT)" == "no"
496 !else if "$(GIT)" == ""
498 !else if [for %I in ($(GIT)) do @if not "%~xI" == "" exit 1]
499 ! if [for %I in ($(GIT)) do @if not "%~$$PATH:I" == "" exit 1]
505 ! if [for %x in (%PATHEXT:;= %) do @for %I in ($(GIT)%x) do @if not "%~$$PATH:I" == "" exit 1]
513 !else if exist($(srcdir)/.git)
515 VCSUP = $(VCS) pull --rebase $(GITPULLOPTIONS)
519 ruby_pc = $(RUBY_BASE_NAME)-$(MAJOR).$(MINOR).pc
521 MESSAGE_BEGIN = @(for %I in (
522 MESSAGE_END = ) do @echo.%~I)
526 all: $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub $(srcdir)/common.mk
532 rubystub: $(STUBPROGRAM)
534 !if !exist(enc/trans/newline.c) && exist($(srcdir)/enc/trans/newline.c)
535 NEWLINE_C = $(srcdir)/enc/trans/newline.c
537 NEWLINE_C = enc/trans/newline.c
539 !if !exist(miniprelude.c) && exist($(srcdir)/miniprelude.c)
540 MINIPRELUDE_C = $(srcdir)/miniprelude.c
542 MINIPRELUDE_C = miniprelude.c
544 !if !exist(golf_prelude.c) && exist($(srcdir)/golf_prelude.c)
545 GOLF_PRELUDE_C = $(srcdir)/golf_prelude.c
547 GOLF_PRELUDE_C = golf_prelude.c
549 RBCONFIG = ./.rbconfig.time
551 !if "$(GITHUB_ACTIONS)" == "true"
552 # 93(bright yellow) is copied from .github/workflows/mingw.yml
553 ACTIONS_GROUP = @echo ::group::
\e[93m$(@:yes-=)
\e[m
554 ACTIONS_ENDGROUP = @echo ::endgroup::
556 ACTIONS_GROUP = @:: $(empty)
557 ACTIONS_ENDGROUP = @::
560 ABI_VERSION_HDR = $(hdrdir)/ruby/internal/abi.h
562 !include $(srcdir)/common.mk
564 !ifdef SCRIPTPROGRAMS
565 !else if [echo>scriptbin.mk SCRIPTPROGRAMS = \]
566 !else if [for %I in ($(srcdir:/=\)\bin\*) do @echo>>scriptbin.mk %~nI.exe \]
567 !else if [echo.>>scriptbin.mk]
568 !else if [echo.>>scriptbin.mk]
570 !if [for %I in ($(srcdir:/=\)\bin\*) do @for %J in (\
571 "%~nI.exe: $$(srcdir)/bin/%~nI" \
572 " $$(ECHO) generating $$(@)" \
573 " $$(Q) copy /y /b $$(STUBPROGRAM) $$(@) > nul" \
574 " $$(Q) echo.>>$$(@)" \
575 " $$(Q) echo.>>$$(@)" \
576 " $$(Q) copy /b $$(@)+$$(srcdir:/=\)\bin\%~nI $$(@) > nul" \
578 ) do @echo.%~J>>scriptbin.mk]
580 ! include scriptbin.mk
581 ! if [del scriptbin.mk > nul]
585 scriptbin: $(SCRIPTPROGRAMS)
587 !if "$(SCRIPTPROGRAMS)" != ""
588 $(SCRIPTPROGRAMS): $(STUBPROGRAM)
592 @cd "$(srcdir:/=\)" && set LC_TIME=C && $(VCSUP)
595 reconfig $(MKFILES): $(srcdir)/common.mk $(srcdir)/version.h \
596 $(hdrdir)/ruby/version.h $(ABI_VERSION_HDR) \
597 $(win_srcdir)/Makefile.sub $(win_srcdir)/configure.bat \
598 $(win_srcdir)/setup.mak $(win_srcdir)/enc-setup.mak \
599 $(srcdir)/enc/Makefile.in
600 $(COMSPEC) /C $(win_srcdir:/=\)\configure.bat $(configure_args)
601 @fc Makefile Makefile.old > nul && echo Makefile unchanged || \
602 (echo $(MKFILES) was updated, re-run $(MAKE). & exit 1)
604 RUBY_CONFIG_H = $(arch_hdrdir)/ruby/config.h
605 CONFIG_H = ./.config.h.time
607 config: config.status
609 config.status: $(CONFIG_H)
613 !if !exist(config.status)
614 !else if [for /f "skip=1 delims=, tokens=2-3" %I in (config.status) do @ \
615 if "%I" == "@RUBY_SO_NAME@" ( \
616 if not "%J" == "$(RUBY_SO_NAME)" exit 1 \
617 ) else if "%I" == "@target_alias@" ( \
618 if not "%J" == "$(ARCH)-$(PLATFORM)" exit 1 \
624 guard = INCLUDE_RUBY_CONFIG_H
626 $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
627 @echo Creating config.h
628 !if !exist("$(arch_hdrdir)")
629 @md $(arch_hdrdir:/=\)
631 !if !exist("$(arch_hdrdir)/ruby")
632 @md $(arch_hdrdir:/=\)\ruby
634 @$(IFCHANGE) "--timestamp=$(@:/=\)" $(RUBY_CONFIG_H:/=\) <<
637 !if defined(MSC_VER_LOWER)
638 #if (_MSC_VER < $(MSC_VER_LOWER)) || (_MSC_VER > $(MSC_VER_UPPER))
639 #error MSC version unmatch: $(MSC_VER_LOWER)..$(MSC_VER_UPPER) is expected.
642 #if _MSC_VER != $(MSC_VER)
643 #error MSC version unmatch: $(MSC_VER) is expected.
646 #define RUBY_MSVCRT_VERSION $(RT_VER)
647 !if defined(ABI_VERSION)
648 #define RUBY_ABI_VERSION $(ABI_VERSION)
650 #define STDC_HEADERS 1
651 #define HAVE_SYS_TYPES_H 1
652 #define HAVE_SYS_STAT_H 1
653 !if $(MSC_VER) >= 1800
654 #define HAVE_STDBOOL_H 1
656 #define HAVE_STDLIB_H 1
657 #define HAVE_STDDEF_H 1
658 #define HAVE_STRING_H 1
659 #define HAVE_MEMORY_H 1
660 !if $(MSC_VER) >= 1920
661 #define HAVE_AFUNIX_H 1
663 !if $(MSC_VER) >= 1400
664 #define HAVE_LONG_LONG 1
666 #define ULL_TO_DOUBLE(n) ((double)(unsigned long)((n)>>32) * (1I64 << 32) + (unsigned long)(n))
669 #define rb_off_t __int64
670 #define SIGNEDNESS_OF_OFF_T -1
671 #define OFFT2NUM(v) LL2NUM(v)
672 #define NUM2OFFT(v) NUM2LL(v)
674 #define SIZEOF_SHORT 2
675 #define SIZEOF_LONG 4
676 !if $(MSC_VER) >= 1400
677 #define SIZEOF_LONG_LONG 8
679 #define SIZEOF_LONG_LONG 0
681 #define SIZEOF___INT64 8
682 #ifndef _INTEGRAL_MAX_BITS
683 #define _INTEGRAL_MAX_BITS 64
685 #define SIZEOF_OFF_T 8
686 !if "$(TARGET_OS)" == "mswin64"
687 #define SIZEOF_VOIDP 8
689 #define SIZEOF_VOIDP 4
691 #define SIZEOF_FLOAT 4
692 #define SIZEOF_DOUBLE 8
693 #define SIGNEDNESS_OF_TIME_T -1
694 #define NEGATIVE_TIME_T 1
696 #define SIZEOF_TIME_T 8
697 #define TIMET2NUM(v) LL2NUM(v)
698 #define NUM2TIMET(v) NUM2LL(v)
700 #define SIZEOF_TIME_T 4
701 #define TIMET2NUM(v) LONG2NUM(v)
702 #define NUM2TIMET(v) NUM2LONG(v)
704 #define CLOCKID2NUM(v) INT2NUM(v)
705 #define NUM2CLOCKID(v) NUM2INT(v)
706 #define SIZEOF_CLOCK_T 4
707 #define SIZEOF_RLIM_T 0
708 !if "$(TARGET_OS)" == "mswin64"
709 #define SIZEOF_SIZE_T 8
710 #define SIZEOF_PTRDIFF_T 8
711 #define SIZEOF_INTPTR_T 8
712 #define SIZEOF_UINTPTR_T 8
714 #define SIZEOF_SIZE_T 4
715 #define SIZEOF_PTRDIFF_T 4
716 #define SIZEOF_INTPTR_T 4
717 #define SIZEOF_UINTPTR_T 4
719 !if $(MSC_VER) < 1400
720 #define SIZE_MAX UINT_MAX
722 !if $(MSC_VER) >= 1800
723 #define HAVE_VA_COPY 1
725 #define HAVE_VA_COPY_VIA_STRUCT_ASSIGNMENT 1
727 !if $(MSC_VER) > 1100
728 #define NORETURN(x) __declspec(noreturn) x
730 !if $(MSC_VER) >= 1300
731 #define DEPRECATED(x) __declspec(deprecated) x
732 #define RUBY_CXX_DEPRECATED(mesg) __declspec(deprecated(mesg))
733 #define NOINLINE(x) __declspec(noinline) x
735 #define ALWAYS_INLINE(x) __forceinline x
736 #define WARN_UNUSED_RESULT(x) x
737 #define MAYBE_UNUSED(x) x
738 #define HAVE___ASSUME 1
739 #define FUNC_STDCALL(x) __stdcall x
740 #define FUNC_CDECL(x) __cdecl x
741 #define FUNC_FASTCALL(x) __fastcall x
742 !if $(MSC_VER) >= 1500
743 #define RUBY_FUNCTION_NAME_STRING __FUNCTION__
744 #define RBIMPL_ATTR_PACKED_STRUCT_BEGIN() __pragma(pack(push, 1))
745 #define RBIMPL_ATTR_PACKED_STRUCT_END() __pragma(pack(pop))
747 #define RUBY_EXTERN extern __declspec(dllimport)
748 #define RUBY_ALIGNAS(n) __declspec(align(n))
749 #define RUBY_ALIGNOF __alignof
750 #define HAVE_DECL_SYS_NERR 1
751 #define HAVE_LIMITS_H 1
752 #define HAVE_FCNTL_H 1
753 #define HAVE_SYS_UTIME_H 1
754 #define HAVE_FLOAT_H 1
755 #define HAVE_TIME_H 1
759 #define HAVE_STRUCT_STAT_ST_RDEV 1
760 #define HAVE_STRUCT_TIMEVAL 1
761 !if $(MSC_VER) >= 1900
762 #define HAVE_STRUCT_TIMESPEC
764 !if $(MSC_VER) >= 1600
765 #define HAVE_INTTYPES_H 1
766 #define HAVE_STDINT_H 1
768 #define int8_t signed char
769 #define uint8_t unsigned char
770 #define int16_t short
771 #define uint16_t unsigned short
773 #define uint32_t unsigned int
774 #define int64_t __int64
775 #define uint64_t unsigned __int64
776 #define INT8_MIN _I8_MIN
777 #define INT8_MAX _I8_MAX
778 #define UINT8_MAX _UI8_MAX
779 #define INT16_MIN _I16_MIN
780 #define INT16_MAX _I16_MAX
781 #define UINT16_MAX _UI16_MAX
782 #define INT32_MIN _I32_MIN
783 #define INT32_MAX _I32_MAX
784 #define UINT32_MAX _UI32_MAX
785 #define INT64_MIN _I64_MIN
786 #define INT64_MAX _I64_MAX
787 #define UINT64_MAX _UI64_MAX
789 #define HAVE_INT8_T 1
790 #define HAVE_UINT8_T 1
791 #define SIZEOF_INT8_T 1
792 #define SIZEOF_UINT8_T 1
793 #define HAVE_INT16_T 1
794 #define HAVE_UINT16_T 1
795 #define SIZEOF_INT16_T 2
796 #define SIZEOF_UINT16_T 2
797 #define HAVE_INT32_T 1
798 #define HAVE_UINT32_T 1
799 #define SIZEOF_INT32_T 4
800 #define SIZEOF_UINT32_T 4
801 #define HAVE_INT64_T 1
802 #define HAVE_UINT64_T 1
803 #define SIZEOF_INT64_T 8
804 #define SIZEOF_UINT64_T 8
805 #define HAVE_INTPTR_T 1
806 #define HAVE_UINTPTR_T 1
807 #define HAVE_SSIZE_T 1
808 !if "$(TARGET_OS)" == "mswin64"
809 #define ssize_t __int64
810 #define PRI_PTR_PREFIX "I64"
813 #define PRI_PTR_PREFIX PRI_INT_PREFIX
815 #define PRI_LL_PREFIX "I64"
816 #define PRI_PIDT_PREFIX PRI_INT_PREFIX
817 #define GETGROUPS_T int
818 #define TYPEOF_TIMEVAL_TV_SEC long
825 #define log2(x) log2(x)
829 #define HAVE_TGAMMA 1
830 #define HAVE_NEXTAFTER 1
832 #define HAVE_ALLOCA 1
834 #define HAVE_MEMCMP 1
835 #define HAVE_MEMMOVE 1
837 #define HAVE_CLOCK_GETTIME 1
838 #define HAVE_CLOCK_GETRES 1
839 #define HAVE_GETTIMEOFDAY 1
840 #define HAVE_SPAWNV 1
841 #define HAVE_STRCASECMP 1
842 #define HAVE_STRNCASECMP 1
843 #define HAVE_STRERROR 1
844 #define HAVE_STRFTIME 1
845 #define HAVE_STRCHR 1
846 #define HAVE_STRSTR 1
849 #define HAVE_FINITE 1
857 #define HAVE_WAITPID 1
859 #define HAVE_GETCWD 1
860 #define HAVE_TRUNCATE 1
861 #define HAVE_FTRUNCATE 1
866 #define HAVE_READLINK 1
867 #define HAVE_SYMLINK 1
868 #define HAVE_LCHOWN 1
869 #define HAVE__SETJMP 1
870 #define HAVE_TELLDIR 1
871 #define HAVE_SEEKDIR 1
872 #define HAVE_MKTIME 1
876 #define HAVE_SIGNBIT 1
877 #define HAVE_TZNAME 1
878 #define HAVE_DAYLIGHT 1
879 #define HAVE_GMTIME_R 1
884 #define HAVE_EXECLE 1
886 #define HAVE_EXECVE 1
887 #define HAVE_GETEGID 1
888 #define HAVE_GETEUID 1
889 #define HAVE_GETGID 1
890 #define HAVE_GETUID 1
891 #define HAVE_PCLOSE 1
894 #define HAVE_SHUTDOWN 1
895 #define HAVE_SYSTEM 1
901 #define HAVE_TYPE_NET_LUID 1
902 !if $(MSC_VER) >= 1600
903 #define HAVE_NULLPTR 1
905 #define SETPGRP_VOID 1
906 #define RSHIFT(x,y) ((x)>>(int)y)
907 #define HAVE_RB_FD_INIT 1
908 #define RUBY_SETJMP(env) _setjmp(env)
909 #define RUBY_LONGJMP(env,val) longjmp(env,val)
910 #define RUBY_JMP_BUF jmp_buf
912 #define inline __inline
913 !if $(MSC_VER) >= 1800
914 #define restrict __restrict
916 #define restrict /* not supported */
919 #define NEED_IO_SEEK_BETWEEN_RW 1
920 !if "$(MACHINE)" == "x86" || "$(ARCH)" == "x64"
921 #define STACK_GROW_DIRECTION -1
923 #define COROUTINE_H "$(COROUTINE_H)"
924 #define THREAD_IMPL_H "$(THREAD_IMPL_H)"
925 #define THREAD_IMPL_SRC "$(THREAD_IMPL_SRC)"
926 #define LOAD_RELATIVE 1
928 !if "$(libdir_basename)" != "lib"
929 #define LIBDIR_BASENAME "$(libdir_basename)"
931 !if "$(EXTSTATIC)" == "static"
934 !if "$(USE_GMP)" != ""
937 #define EXECUTABLE_EXTS $(EXECUTABLE_EXTS)
938 #define RUBY_COREDLL "$(RT)"
939 #define RUBY_PLATFORM "$(arch)"
940 #define RUBY_SITEARCH "$(sitearch)"
942 #endif /* $(guard) */
945 #!if exist($(RUBY_CONFIG_H))
946 #! if exist(config_h.bak)
947 # @del $(RUBY_CONFIG_H:.h=_h).bak
949 # @copy $(RUBY_CONFIG_H) $(RUBY_CONFIG_H:.h=_h).bak
951 #!if exist($(RUBY_CONFIG_H))
952 # @echo NMAKE will abort if config.h is changed, then restart NMAKE.
953 # @fc.exe $(RUBY_CONFIG_H) $(RUBY_CONFIG_H:.h=_h).bak > nul
954 # @echo $(RUBY_CONFIG_H) unchanged.
955 # @del $(RUBY_CONFIG_H)
956 # @ren $(RUBY_CONFIG_H:.h=_h).bak $(RUBY_CONFIG_H)
959 EXECUTABLE_EXTS = $(EXECUTABLE_EXTS:"=) # "
960 EXECUTABLE_EXTS = $(EXECUTABLE_EXTS:,= )
962 config.status: $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub $(srcdir)/common.mk
964 # Generated automatically by Makefile.sub.
965 s,@SHELL@,$$(COMSPEC),;t t
966 s,@BUILD_FILE_SEPARATOR@,\,;t t
967 s,@PATH_SEPARATOR@,;,;t t
968 s,@CFLAGS@,$(CFLAGS),;t t
969 s,@WERRORFLAG@,$(WERRORFLAG),;t t
970 s,@DEFS@,$(DEFS),;t t
971 s,@CPPFLAGS@,$(CPPFLAGS),;t t
972 s,@CXXFLAGS@,$(CXXFLAGS),;t t
973 s,@FFLAGS@,$(FFLAGS),;t t
974 s,@LDFLAGS@,$(LDFLAGS),;t t
975 s,@LIBS@,user32.lib,;t t
976 s,@MAINLIBS@,$(MAINLIBS),;t t
977 s,@exec_prefix@,$${prefix},;t t
978 s,@prefix@,$(prefix),;t t
979 s,@program_transform_name@,s,.*,$(PROGRAM_PREFIX)&$(PROGRAM_SUFFIX),,;t t
980 s,@bindir@,$${exec_prefix}/bin,;t t
981 s,@sbindir@,$${exec_prefix}/sbin,;t t
982 s,@libexecdir@,$${exec_prefix}/libexec,;t t
983 s,@datadir@,$${prefix}/share,;t t
985 s,@sharedstatedir@,$${prefix}/com,;t t
986 s,@localstatedir@,$${prefix}/var,;t t
987 s,@libdir@,$${exec_prefix}/$(libdir_basename),;t t
988 s,@includedir@,$${prefix}/include,;t t
989 s,@oldincludedir@,/usr/include,;t t
990 s,@infodir@,$${datadir}/info,;t t
991 s,@mandir@,$${datadir}/man,;t t
992 s,@ridir@,$${datadir}/ri,;t t
993 s,@docdir@,$${datadir}/doc/$${RUBY_BASE_NAME},;t t
994 s,@build@,$(CPU)-pc-$(PLATFORM),;t t
995 s,@build_alias@,$(CPU)-$(PLATFORM),;t t
996 s,@build_cpu@,$(CPU),;t t
997 s,@build_vendor@,pc,;t t
998 s,@build_os@,$(PLATFORM),;t t
999 s,@host@,$(CPU)-pc-$(PLATFORM),;t t
1000 s,@host_alias@,$(CPU)-$(PLATFORM),;t t
1001 s,@host_cpu@,$(CPU),;t t
1002 s,@host_vendor@,pc,;t t
1003 s,@host_os@,$(PLATFORM),;t t
1004 s,@target@,$(ARCH)-pc-$(PLATFORM),;t t
1005 s,@target_alias@,$(ARCH)-$(PLATFORM),;t t
1006 s,@target_cpu@,$(ARCH),;t t
1007 s,@target_vendor@,pc,;t t
1008 s,@target_os@,$(PLATFORM),;t t
1009 s,@NULLCMD@,$(NULLCMD),;t t
1014 s,@YACC@,$(YACC),;t t
1017 s,@ARFLAGS@,$(ARFLAGS),;t t
1018 s,@LN_S@,$(LN_S),;t t
1019 s,@SET_MAKE@,MFLAGS = -$$(MAKEFLAGS),;t t
1020 s,@RM@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rm.bat,;t t
1021 s,@RMDIR@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rmdirs.bat,:t t
1022 s,@RMDIRS@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rmdirs.bat,;t t
1023 s,@RMALL@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rm.bat -f -r,:t t
1024 s,@MAKEDIRS@,$$(COMSPEC) /E:ON /C $$(top_srcdir:/=\)\win32\makedirs.bat,;t t
1025 s,@LIBOBJS@,$(LIBOBJS),;t t
1026 s,@ALLOCA@,$(ALLOCA),;t t
1027 s,@EXEEXT@,.exe,;t t
1028 s,@EXECUTABLE_EXTS@,$(EXECUTABLE_EXTS),;t t
1029 s,@OBJEXT@,$(OBJEXT),;t t
1030 s,@ASMEXT@,$(ASMEXT),;t t
1031 s,@XCFLAGS@,$(XCFLAGS),;t t
1032 s,@XLDFLAGS@,$(XLDFLAGS),;t t
1033 s,@DLDFLAGS@,$(DLDFLAGS) $$(LIBPATH),;t t
1034 s,@EXTDLDFLAGS@,$(EXTDLDFLAGS),;t t
1035 s,@ARCH_FLAG@,$(ARCH_FLAG),;t t
1036 s,@STATIC@,$(STATIC),;t t
1038 s,@LDSHARED@,$(LDSHARED),;t t
1042 s,@STRIP@,$(STRIP),;t t
1043 s,@ENCSTATIC@,$(ENCSTATIC),;t t
1044 s,@EXTSTATIC@,$(EXTSTATIC),;t t
1045 s,@setup@,Setup,;t t
1046 s,@MINIRUBY@,$(MINIRUBY),;t t
1047 s,@PREP@,miniruby$(EXEEXT),;t t
1048 s,@RUNRUBY@,$(RUNRUBY),;t t
1049 s,@EXTOUT@,$(EXTOUT),;t t
1051 s,@RDOCTARGET@,,;t t
1052 s,@LIBRUBY_LDSHARED@,$(LIBRUBY_LDSHARED),;t t
1053 s,@LIBRUBY_DLDFLAGS@,$(LIBRUBY_DLDFLAGS),;t t
1054 s,@RUBY_BASE_NAME@,$(RUBY_BASE_NAME),;t t
1055 s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
1056 s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t
1057 s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t
1058 s,@RUBY_SO_NAME@,$(RUBY_SO_NAME),;t t
1059 s,@LIBRUBY_A@,$$(RUBY_SO_NAME)-static.lib,;t t
1060 s,@LIBRUBY_SO@,$$(RUBY_SO_NAME).dll,;t t
1061 s,@LIBRUBY_ALIASES@,$(LIBRUBY_ALIASES),;t t
1062 s,@LIBRUBY@,$$(RUBY_SO_NAME).lib,;t t
1063 s,@LIBRUBYARG@,$$(LIBRUBYARG_SHARED),;t t
1064 s,@LIBRUBYARG_STATIC@,$$(LIBRUBY_A) $$(MAINLIBS),;t t
1065 s,@LIBRUBYARG_SHARED@,$$(LIBRUBY),;t t
1066 s,@SOLIBS@,$(SOLIBS),;t t
1067 s,@DLDLIBS@,$(DLDLIBS),;t t
1068 s,@ENABLE_SHARED@,yes,;t t
1069 s,@BASERUBY@,$(BASERUBY),;t t
1070 s,@OUTFLAG@,$(OUTFLAG),;t t
1071 s,@COUTFLAG@,$(COUTFLAG),;t t
1072 s,@CSRCFLAG@,$(CSRCFLAG),;t t
1073 s,@CPPOUTFILE@,-P,;t t
1074 s,@PRELOADENV@,,;t t
1075 s,@LIBPATHENV@,PATH,;t t
1076 s,@LIBPATHFLAG@, -libpath:%s,;t t
1078 s,@LIBARG@,%s.lib,;t t
1079 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
1080 !if $(MSC_VER) >= 1400 && $(MSC_VER) < 1800
1081 s,@LINK_SO@,@if exist $$(@).manifest $$(RUBY) -run -e wait_writable -- -n 10 $$(@),;t t
1082 s,@LINK_SO@,@if exist $$(@).manifest $(MANIFESTTOOL) -manifest $$(@).manifest -outputresource:$$(@);2,;t t
1083 s,@LINK_SO@,@if exist $$(@).manifest $$(RM) $$(@:/=\).manifest,;t t
1085 s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$(@) -c $$(CSRCFLAG)$$(<:\=/),;t t
1086 s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$(@) -c -Tp$$(<:\=/),;t t
1087 s,@ASSEMBLE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -Fa$$(@) -c $$(CSRCFLAG)$$(<:\=/),;t t
1088 s,@ASSEMBLE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -Fa$$(@) -c -Tp$$(<:\=/),;t t
1089 s,@COMPILE_RULES@,{$$(*VPATH*)}.%s.%s: .%s.%s:,;t t
1090 s,@CXX_EXT@,cpp,;t t
1091 s,@RULE_SUBST@,{.;$$(VPATH)}%s,;t t
1092 s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) -link $$(LDFLAGS) $$(LIBPATH) $$(XLDFLAGS),;t t
1093 s,@COMMON_LIBS@,$(COMMON_LIBS),;t t
1094 s,@COMMON_MACROS@,$(COMMON_MACROS),;t t
1095 s,@COMMON_HEADERS@,$(COMMON_HEADERS),;t t
1096 s,@cleanobjs@,$$*.exp $$*.lib $$*.pdb,;t t
1097 s,@DISTCLEANFILES@,vc*.pdb,;t t
1098 s,@EXPORT_PREFIX@, ,;t t
1099 s,@archlibdir@,$${libdir}/$${arch},;t t
1100 s,@sitearchlibdir@,$${libdir}/$${sitearch},;t t
1101 s,@archincludedir@,$${includedir}/$${arch},;t t
1102 s,@sitearchincludedir@,$${includedir}/$${sitearch},;t t
1103 s,@arch@,$(ARCH)-$(PLATFORM),;t t
1104 s,@sitearch@,$(ARCH)-$(RT),;t t
1105 s,@MAJOR@,$(MAJOR),;t t
1106 s,@MINOR@,$(MINOR),;t t
1107 s,@TEENY@,$(TEENY),;t t
1108 s,@ruby_version@,$(ruby_version),;t t
1109 s,@RUBY_PROGRAM_VERSION@,$$(MAJOR).$$(MINOR).$$(TEENY),;t t
1110 s,@RUBY_API_VERSION@,$$(MAJOR).$$(MINOR),;t t
1111 s,@rubylibprefix@,$${prefix}/lib/$${RUBY_BASE_NAME},;t t
1112 s,@rubyarchdir@,$${rubylibdir}/$${arch},;t t
1113 s,@rubylibdir@,$${rubylibprefix}/$${ruby_version},;t t
1114 s,@sitedir@,$${rubylibprefix}/site_ruby,;t t
1115 s,@sitearchdir@,$${sitelibdir}/$${sitearch},;t t
1116 s,@sitelibdir@,$${sitedir}/$${ruby_version},;t t
1117 s,@vendordir@,$${rubylibprefix}/vendor_ruby,;t t
1118 s,@vendorarchdir@,$${vendorlibdir}/$${sitearch},;t t
1119 s,@vendorlibdir@,$${vendordir}/$${ruby_version},;t t
1120 s,@rubyhdrdir@,$$(includedir)/$${RUBY_BASE_NAME}-$$(ruby_version),;t t
1121 s,@sitehdrdir@,$$(rubyhdrdir)/site_ruby,;t t
1122 s,@vendorhdrdir@,$$(rubyhdrdir)/vendor_ruby,;t t
1123 s,@rubyarchhdrdir@,$$(rubyhdrdir)/$${arch},;t t
1124 s,@sitearchhdrdir@,$$(sitehdrdir)/$${sitearch},;t t
1125 s,@vendorarchhdrdir@,$$(vendorhdrdir)/$${sitearch},;t t
1126 s,@PLATFORM_DIR@,$(PLATFORM_DIR),;t t
1127 s,@THREAD_MODEL@,$(THREAD_MODEL),;t t
1128 s,@configure_args@,--with-make-prog=nmake --enable-shared $(configure_args),;t t
1129 s,@configure_input@,$$configure_input,;t t
1130 s,@srcdir@,$(srcdir),;t t
1131 s,@top_srcdir@,$(srcdir),;t t
1132 s,@try_header@,try_compile,;t t
1133 s,@ruby_pc@,$(ruby_pc),;t t
1134 s,@RJIT_SUPPORT@,$(RJIT_SUPPORT),;t t
1137 !if "$(HAVE_BASERUBY)" != "yes" || "$(CROSS_COMPILING)" == "yes"
1138 $(RBCONFIG): $(PREP)
1141 miniruby: miniruby$(EXEEXT)
1145 $(ECHO) linking $(@:\=/)
1146 $(Q) $(PURIFY) $(CC) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(LIBS) -Fe$@ -link $(LDFLAGS)
1147 @$(RM) miniruby.lib miniruby.exp
1148 $(Q) miniruby.exe -v
1155 !if "$(PROGRAM)" != ""
1156 $(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
1157 $(ECHO) linking $(@:\=/)
1158 $(Q) $(PURIFY) $(CC) $(MAINOBJ) $(EXTOBJS) $(RUBY_INSTALL_NAME).res \
1159 $(OUTFLAG)$@ $(LIBRUBYARG) -link $(LDFLAGS) $(XLDFLAGS)
1160 ! if defined(LDSHARED_0)
1167 !if "$(WPROGRAM)" != ""
1168 $(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res
1169 $(ECHO) linking $(@:\=/)
1170 $(Q) $(PURIFY) $(CC) $(MAINOBJ) $(WINMAINOBJ) \
1171 $(RUBYW_INSTALL_NAME).res $(OUTFLAG)$@ $(LIBRUBYARG) \
1172 -link $(LDFLAGS) $(XLDFLAGS) -subsystem:Windows
1173 ! if defined(LDSHARED_0)
1180 !if "$(STUBPROGRAM)" != ""
1181 $(STUBPROGRAM): rubystub.$(OBJEXT) $(LIBRUBY) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
1182 $(ECHO) linking $(@:\=/)
1183 $(Q) $(PURIFY) $(CC) rubystub.$(OBJEXT) $(RUBY_INSTALL_NAME).res \
1184 $(OUTFLAG)$@ $(LIBRUBYARG) -link $(LDFLAGS) $(XLDFLAGS)
1185 ! if defined(LDSHARED_0)
1192 !if "$(LIBRUBY_SO_UPDATE)" == ""
1193 PRE_LIBRUBY_UPDATE = $(RM) $(LIBRUBY_EXTS)
1195 PRE_LIBRUBY_UPDATE =
1198 $(LIBRUBY_A): $(OBJS) $(INITOBJS)
1199 !if "$(EXTSTATIC)" != ""
1200 @-$(PRE_LIBRUBY_UPDATE)
1202 $(ECHO) linking static-library $(@:\=/)
1203 $(Q) $(AR) $(ARFLAGS)$@ $(OBJS) $(INITOBJS)
1205 $(LIBRUBY): $(RUBYDEF)
1206 $(ECHO) linking import-library $(@:\=/)
1207 $(Q) $(AR) $(ARFLAGS)$@ -def:$(RUBYDEF)
1209 $(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
1211 !if "$(EXTSTATIC)" == ""
1212 @-$(PRE_LIBRUBY_UPDATE)
1214 $(ECHO) linking shared-library $(@:\=/)
1215 $(Q) $(LDSHARED) $(DLDOBJS) $(LIBRUBY_A) \
1216 $(RUBY_SO_NAME).res $(SOLIBS) $(EXTSOLIBS) $(LIBS) -Fe$@ -link $(LDFLAGS) \
1218 @$(RM) dummy.lib dummy.exp
1219 !if defined(LDSHARED_0)
1223 # | findstr -v -c:LNK4049 -c:LNK4217
1226 $(RUBYDEF): $(LIBRUBY_A) $(RBCONFIG)
1227 $(ECHO) generating $(@:\=/)
1228 $(Q) $(BOOTSTRAPRUBY_COMMAND) $(srcdir)/win32/mkexports.rb \
1229 -output=$@ -arch=$(ARCH) $(LIBRUBY_A)
1231 {$(win_srcdir)}.def.lib:
1232 $(Q) $(AR) $(ARFLAGS)$@ -def:$<
1235 $(Q)$(RM) $(WINMAINOBJ) ext\extinit.c ext\extinit.$(OBJEXT) ext\vc*.pdb miniruby.lib
1236 $(Q)$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
1237 $(Q)$(RM) miniruby.rc $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
1238 $(Q)$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF) ext\ripper\y.output
1241 $(Q)$(RM) ext\config.cache $(RBCONFIG:/=\) $(CONFIG_H:/=\)
1242 -$(Q)$(RM) $(INSTALLED_LIST:/=\) $(arch_hdrdir:/=\)\ruby\config.h verconf.h
1243 -$(Q)$(RMDIRS) $(arch_hdrdir:/=\)\ruby
1245 ext/clean.mk ext/distclean.mk ext/realclean.mk::
1246 $(Q)if exist $(EXTS_MK) $(MAKE) -k -f $(EXTS_MK) top_srcdir=$(srcdir) $(*F)
1248 ext/clean gems/clean ext/distclean gems/distclean ext/realclean gems/realclean::
1249 $(Q)cd $(@D) 2>nul && (for /R $(EXTS) %I in (.) \
1250 do $(Q)if exist %I\Makefile ( \
1253 call set n=%n:%CD%\$(@D)\=% && \
1254 call set n=%n:\.=% && \
1255 call echo $(@F)ing %n:\=/% & \
1256 $(MAKE) $(MFLAGS) $(@F) & \
1261 ext/distclean gems/distclean ext/realclean gems/realclean::
1262 $(Q)cd $(@D) 2>nul && (for /R $(EXTS) %I in (exts.mk*) \
1263 do $(Q)(del %I & rmdir %~dpI)) || @
1264 -$(Q)rmdir $(@D) 2> nul || @
1266 clean-enc distclean-enc realclean-enc:
1267 !if exist($(ENC_MK))
1268 $(ECHO) $(@:-enc=ing) encodings
1269 -$(Q)$(MAKE) $(MAKE_ENC) $(@:-enc=)
1272 $(RCFILES): $(RBCONFIG) $(srcdir)/revision.h $(srcdir)/win32/resource.rb
1273 @$(BOOTSTRAPRUBY_COMMAND) $(srcdir)/win32/resource.rb \
1274 -ruby_name=$(RUBY_INSTALL_NAME) \
1275 -rubyw_name=$(RUBYW_INSTALL_NAME) \
1276 -so_name=$(RUBY_SO_NAME) \
1277 . $(icondirs) $(win_srcdir)
1279 update-benchmark-driver:
1280 $(GIT) clone https://github.com/benchmark-driver/benchmark-driver $(srcdir)/benchmark/benchmark-driver || \
1281 $(GIT) -C $(srcdir)/benchmark/benchmark-driver pull origin master
1283 $(ruby_pc): $(RBCONFIG)
1284 @$(BOOTSTRAPRUBY) $(tooldir)/expand-config.rb \
1285 -output=$@ -mode=$(INSTALL_DATA_MODE) -config=rbconfig.rb \
1286 $(srcdir)/template/ruby.pc.in
1288 {$(srcdir)/coroutine/win32}.asm{coroutine/win32}.obj:
1289 $(ECHO) assembling $(<:\=/)
1290 $(Q) $(AS) $(ASFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(<:\=/)
1291 {$(srcdir)/coroutine/win64}.asm{coroutine/win64}.obj:
1292 $(ECHO) assembling $(<:\=/)
1293 $(Q) $(AS) $(ASFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(<:\=/)
1295 {$(srcdir)/prism}.c.obj:
1296 $(ECHO) compiling $(<:\=/)
1297 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
1298 {$(srcdir)/prism/enc}.c.obj:
1299 $(ECHO) compiling $(<:\=/)
1300 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
1301 {$(srcdir)/prism/util}.c.obj:
1302 $(ECHO) compiling $(<:\=/)
1303 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
1304 {$(srcdir)/enc/trans}.c.obj:
1305 $(ECHO) compiling $(<:\=/)
1306 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
1307 {$(srcdir)/enc}.c.obj:
1308 $(ECHO) compiling $(<:\=/)
1309 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
1310 {$(srcdir)/missing}.c.obj:
1311 $(ECHO) compiling $(<:\=/)
1312 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
1313 {$(win_srcdir)}.c.obj:
1314 $(ECHO) compiling $(<:\=/)
1315 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
1316 {$(srcdir)}.c{}.obj:
1317 $(ECHO) compiling $(<:\=/)
1318 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
1320 $(ECHO) compiling $(<:\=/)
1321 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/)
1323 {$(srcdir)/missing}.c.asm:
1324 $(ECHO) translating $(<:\=/)
1325 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/)
1326 {$(win_srcdir)}.c.asm:
1327 $(ECHO) translating $(<:\=/)
1328 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/)
1329 {$(srcdir)}.c{}.asm:
1330 $(ECHO) translating $(<:\=/)
1331 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/)
1333 $(ECHO) translating $(<:\=/)
1334 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/)
1336 {$(srcdir)/missing}.c.i:
1337 $(ECHO) preprocessing $(<:\=/)
1338 $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Fi:$@ $(CSRCFLAG)$(<:\=/)
1339 {$(win_srcdir)}.c.i:
1340 $(ECHO) preprocessing $(<:\=/)
1341 $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Fi:$@ $(CSRCFLAG)$(<:\=/)
1343 $(ECHO) preprocessing $(<:\=/)
1344 $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Fi:$@ $(CSRCFLAG)$(<:\=/)
1346 $(ECHO) preprocessing $(<:\=/)
1347 $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Fi:$@ $(CSRCFLAG)$(<:\=/)
1350 $(ECHO) compiling $(<:\=/)
1351 $(Q) $(RC) $(RCFLAGS) -I. -I$(<D) $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:\=/)
1353 lex.c: {$(srcdir)}lex.c.blt
1356 $(srcdir)/enc/jis/props.h: {$(srcdir)}enc/jis/props.h.blt
1357 @if not exist $(@D:/=\) md $(@D:/=\)
1359 $(Q) copy $(?:/=\) $(@:/=\) > nul
1361 $(OBJS): {$(hdrdir)/ruby}win32.h
1363 win32/win32.$(OBJEXT): {$(VPATH)}id.h
1364 dir.$(OBJEXT) win32/win32.$(OBJEXT): {$(srcdir)}win32/dir.h
1365 file.$(OBJEXT) win32/win32.$(OBJEXT): {$(VPATH)}win32/file.h
1367 !if "$(srcdir)" != "." && "$(HAVE_BASERUBY)" == "yes"
1368 revision.h: $(REVISION_H)
1371 ext/extinit.obj: ext/extinit.c $(SETUP)
1372 $(ECHO) compiling ext/extinit.c
1373 $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
1375 probes.h: {$(VPATH)}probes.dmyh
1376 @$(ECHO) making dummy <<$(DEST_FILE)
1377 #include "$(*F).dmyh"
1380 INSNS = optinsn.inc optunifs.inc insns.inc insns_info.inc \
1383 !if [exit > insns_rules.mk]
1384 !else if [for %I in ($(INSNS)) do \
1386 "%I: $$(srcdir)/insns.def {$$(VPATH)}vm_opts.h \" \
1387 " $$(srcdir)/defs/opt_operand.def $$(srcdir)/defs/opt_insn_unif.def \" \
1388 " $$(tooldir)/insns2vm.rb" \
1389 " @$$(RM) $$(PROGRAM)" \
1390 " $$(Q) $$(BASERUBY) -Ku $$(tooldir)/insns2vm.rb $$(INSNS2VMOPT) %I" \
1392 ) do @echo.%~J>>insns_rules.mk]
1394 ! include insns_rules.mk
1395 ! if [del insns_rules.mk > nul]
1399 verconf.h: verconf.mk
1402 @$(CPP) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/loadpath.c | \
1403 sed -e '1,/^const char ruby_initial_load_paths/d;/;/,$$d' \
1404 -e '/^^ /!d;s/ *"\\\\0"$$//;s/" *"//g'
1406 RUBYSPEC_CAPIEXT_SRCDIR = $(srcdir)/$(RUBYSPEC_CAPIEXT)
1407 RUBYSPEC_CAPIEXT_DEPS = $(RUBYSPEC_CAPIEXT_SRCDIR)/rubyspec.h $(RUBY_H_INCLUDES) $(LIBRUBY)
1408 RUBYSPEC_CAPIEXT_EXTS =
1410 !if [echo>rubyspec-capiext.mk RUBYSPEC_CAPIEXT_EXTS = \]
1411 !else if [for %I in ($(RUBYSPEC_CAPIEXT_SRCDIR)\*_spec.c) do \
1412 @echo. $$(RUBYSPEC_CAPIEXT)/%~nI.so \>>rubyspec-capiext.mk]
1413 !else if [echo. $$(empty)>>rubyspec-capiext.mk]
1415 ! include rubyspec-capiext.mk
1416 ! if [del rubyspec-capiext.mk > nul]
1420 $(RUBYSPEC_CAPIEXT_EXTS): $(RUBYSPEC_CAPIEXT_DEPS)
1421 rubyspec-capiext: $(RUBYSPEC_CAPIEXT_EXTS)
1424 {$(RUBYSPEC_CAPIEXT_SRCDIR)}.c{$(RUBYSPEC_CAPIEXT)}.so:
1425 $(ECHO) building $(@F)
1426 $(Q)$(MAKEDIRS) $(@D)
1427 $(Q)echo> $*.def EXPORTS
1428 $(Q)echo>> $*.def Init_$(*F)
1429 $(Q)$(LDSHARED) -Fe$(@) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) $< $(LIBRUBYARG) -link $(DLDFLAGS) $(LIBS) $(LOCAL_LIBS) -implib:$*.lib -pdb:$*.pdb -def:$*.def
1430 !if defined(LDSHARED_0)
1436 exts: rubyspec-capiext