[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
[ruby.git] / win32 / Makefile.sub
blob7dbb020eee11fc79274f015e6558bba31e734234
1 # -*- mode: makefile; indent-tabs-mode: t -*-
3 SHELL = $(COMSPEC)
4 ECHO1 = $(V:1=@:)
5 RUNCMD = $(COMSPEC) /c
6 MKFILES = Makefile verconf.mk
7 NULLCMD = exit /b0.             # exit ignores the rest
8 NULL = nul
9 CHDIR = cd
10 PATH_SEPARATOR = ;
11 TZ =                            # skip timezone tests
12 PWD = $(MAKEDIR)
13 empty =
14 tooldir = $(srcdir)/tool
16 !ifndef MFLAGS
17 MFLAGS=-l
18 !endif
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]
23 ! else
24 !   include baseruby.mk
25 ! endif
26 ! if [del baseruby.mk]
27 ! endif
28 !else if "$(BASERUBY)" == "no" || [($(BASERUBY) -eexit) > nul 2> nul]
29 BASERUBY =
30 !endif
31 !if "$(BASERUBY)" == ""
32 BASERUBY = $(tooldir:/=\)\missing-baseruby.bat
33 HAVE_BASERUBY = no
34 !else
35 HAVE_BASERUBY = yes
36 !endif
38 !ifndef REVISION_FORCE
39 !if "$(HAVE_BASERUBY)" == "yes"
40 REVISION_FORCE = PHONY
41 !endif
42 !endif
44 !ifndef CROSS_COMPILING
45 CROSS_COMPILING = no
46 !else if "$(CROSS_COMPILING)" == "yes"
47 ! if "$(HAVE_BASERUBY)" != "yes"
48 !   error executable host ruby is required for cross-compiling
49 ! endif
50 !else
51 ! if "$(CROSS_COMPILING)" != "no"
52 !   error Bad CROSS_COMPILING
53 ! endif
54 !endif
55 !ifndef win_srcdir
56 win_srcdir = $(srcdir)/win32
57 !endif
59 !if exist(verconf.mk)
60 ! include verconf.mk
61 !endif
63 #### Start of system configuration section. ####
65 !if defined(pathlist)
66 PATH = $(pathlist:;=/bin;)$(PATH)
67 INCLUDE = $(pathlist:;=/include;)
68 LIB = $(pathlist:;=/lib;)
69 !endif
71 ## variables may be overridden by $(compile_dir)/Makefile
72 !ifndef srcdir
73 srcdir = ..
74 !endif
75 !ifndef RUBY_BASE_NAME
76 RUBY_BASE_NAME = ruby
77 !endif
78 !ifndef RUBY_INSTALL_NAME
79 RUBY_INSTALL_NAME = $(PROGRAM_PREFIX)$(RUBY_BASE_NAME)$(PROGRAM_SUFFIX)
80 !endif
81 !if !defined(RUBYW_INSTALL_NAME) || "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)"
82 RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw)
83 !endif
84 !if "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)"
85 RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
86 !endif
87 STUBPROGRAM = rubystub$(EXEEXT)
88 !if !defined(icondirs) && defined(ICONDIRS)
89 icondirs=$(ICONDIRS)
90 !endif
91 !if defined(icondirs)
92 icondirs=$(icondirs:\=/)
93 iconinc=-I$(icondirs: = -I)
94 !endif
95 ###############
97 .SUFFIXES: .def .lib
99 !if !defined(CC)
100 CC = cl -nologo
101 !endif
102 !if !defined(CPP) || "$(CPP)" == "cl"
103 CPP = $(CC) -E
104 !endif
105 !if !defined(YACC)
106 YACC = $(BASERUBY) $(top_srcdir)/tool/lrama/exe/lrama
107 !endif
108 AR = lib -nologo
109 PURIFY =
110 AUTOCONF = autoconf
111 IFCHANGE = $(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat
112 RM = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat
113 RM1 = del
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 --
119 CP = copy > nul
120 MV = move > nul
121 RM1 = del /f /q
122 !if !defined(BASERUBY)
123 BASERUBY = ruby
124 !endif
125 !if !defined(TEST_RUNNABLE)
126 TEST_RUNNABLE = yes
127 !endif
129 CAT_DEPEND = type
131 !if !defined(MACHINE)
132 MACHINE = x86
133 !endif
134 !if "$(MACHINE)" == "x86"
135 !if !defined(PROCESSOR_LEVEL)
136 PROCESSOR_LEVEL = 5
137 !endif
138 !if 6 < $(PROCESSOR_LEVEL)
139 PROCESSOR_LEVEL = 6
140 !endif
141 !if $(MSC_VER) < 1400
142 PROCESSOR_FLAG = -G$(PROCESSOR_LEVEL)
143 !endif
144 CPU = i$(PROCESSOR_LEVEL)86
145 ARCH = i386
146 !else
147 CPU = $(MACHINE)
148 ARCH = $(MACHINE)
149 !endif
150 !if !defined(DEBUGFLAGS)
151 DEBUGFLAGS = -Zi
152 !endif
153 !if "$(RUBY_DEVEL)" == "yes"
154 XCFLAGS = $(XCFLAGS) -DRUBY_DEVEL=1
155 !endif
156 !if !defined(OPTFLAGS)
157 !if $(MSC_VER) < 1400
158 OPTFLAGS = -O2b2xg-
159 !else
160 OPTFLAGS = -O2sy-
161 !endif
162 !endif
163 !if !defined(PLATFORM)
164 PLATFORM = mswin32
165 !endif
166 !if !defined(RT)
167 !error RT not defined.  Retry from configure pass.
168 !endif
169 !ifndef NTVER
170 NTVER = 0x0600
171 !endif
172 !ifdef NTVER
173 ARCHDEFS = -D_WIN32_WINNT=$(NTVER) $(ARCHDEFS)
174 !endif
175 !if !defined(PLATFORM_DIR)
176 PLATFORM_DIR = win32
177 !endif
179 arch = $(ARCH)-$(PLATFORM)
180 sitearch = $(ARCH)-$(RT)
181 !if !defined(ruby_version)
182 ruby_version = $(MAJOR).$(MINOR).0
183 !endif
184 !if defined(ABI_VERSION)
185 ruby_version = $(ruby_version)+$(ABI_VERSION)
186 !endif
187 !if !defined(RUBY_VERSION_NAME)
188 RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
189 !endif
190 RUBY_PROGRAM_VERSION = $(MAJOR).$(MINOR).$(TEENY)
192 !ifndef RUBY_SO_NAME
193 RUBY_SO_NAME = $(RT)-$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0
194 !if "$(ARCH)" != "i386"
195 RUBY_SO_NAME = $(ARCH)-$(RUBY_SO_NAME)
196 !endif
197 !endif
198 !ifndef RUBY_PLATFORM
199 RUBY_PLATFORM = $(arch)
200 !endif
202 !if !defined(prefix)
203 prefix = /usr
204 !endif
205 !if !defined(exec_prefix)
206 exec_prefix = $(prefix)
207 !endif
208 !if !defined(libdir_basename)
209 libdir_basename = lib
210 !endif
211 !if !defined(libdir)
212 libdir = $(exec_prefix)/$(libdir_basename)
213 !endif
214 !if !defined(datadir)
215 datadir = $(prefix)/share
216 !endif
217 !ifndef EXTOUT
218 EXTOUT = .ext
219 !endif
220 !ifndef TESTUI
221 TESTUI = console
222 !endif
223 !ifndef TESTS
224 TESTS =
225 !endif
226 !ifndef CAPITARGET
227 ! ifdef DOXYGEN
228 CAPITARGET = capi
229 ! else
230 CAPITARGET = nodoc
231 ! endif
232 !endif
233 !ifndef DOCTARGETS
234 ! if "$(RDOCTARGET)" == "rdoc" || "$(RDOCTARGET)" == ""
235 DOCTARGETS = $(DOCTARGETS) rdoc
236 ! endif
237 ! if "$(CAPITARGET)" == "capi"
238 DOCTARGETS = $(DOCTARGETS) capi
239 ! endif
240 !endif
241 !ifndef INSTALLDOC
242 ! if "$(DOCTARGETS)" != ""
243 INSTALLDOC = all
244 ! else
245 INSTALLDOC = nodoc
246 DOCTARGETS = nodoc
247 ! endif
248 !endif
250 !if !defined(OUTFLAG)
251 OUTFLAG       = -Fe
252 !endif
253 !if !defined(COUTFLAG)
254 COUTFLAG      = -Fo
255 !endif
256 !if !defined(CPPOUTFLAG)
257 ! if $(MSC_VER) < 1600
258 CPPOUTFLAG    = >
259 ! else
260 CPPOUTFLAG    = -Fi
261 ! endif
262 !endif
263 !if !defined(CSRCFLAG)
264 CSRCFLAG      = -Tc
265 !endif
266 !if !defined(RUNTIMEFLAG)
267 RUNTIMEFLAG   = -MD
268 !endif
269 !if !defined(COMPILERFLAG)
270 COMPILERFLAG  = -Zm600
271 !endif
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
277 !else
278 WARNFLAGS = -W2
279 !endif
280 !endif
281 WERRORFLAG = -WX
282 !if !defined(CFLAGS_NO_ARCH)
283 CFLAGS_NO_ARCH = $(RUNTIMEFLAG) $(DEBUGFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(COMPILERFLAG)
284 !endif
285 !if !defined(ARCH_FLAG)
286 ARCH_FLAG = $(PROCESSOR_FLAG)
287 !endif
288 !if !defined(CFLAGS)
289 CFLAGS = $(CFLAGS_NO_ARCH) $(ARCH_FLAG)
290 !endif
291 !if !defined(CXXFLAGS)
292 CXXFLAGS = $(CFLAGS)
293 !endif
294 !if !defined(LDFLAGS)
295 LDFLAGS = -incremental:no -debug -opt:ref -opt:icf
296 !endif
297 !if !defined(XLDFLAGS)
298 XLDFLAGS = -stack:$(STACK)
299 !endif
300 !if !defined(RFLAGS)
301 RFLAGS = -r
302 !endif
303 !if !defined(EXTLIBS)
304 EXTLIBS =
305 !endif
306 !if !defined(EXTSOLIBS)
307 EXTSOLIBS =
308 !endif
309 !if !defined(LIBS)
310 LIBS = user32.lib advapi32.lib shell32.lib ws2_32.lib
311 !if $(MSC_VER) >= 1400
312 LIBS = $(LIBS) iphlpapi.lib
313 !endif
314 !if defined(USE_GMP)
315 LIBS = $(LIBS) gmp.lib
316 !endif
317 LIBS = $(LIBS) imagehlp.lib shlwapi.lib bcrypt.lib $(EXTLIBS)
318 !endif
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
321 !if $(RT_VER) < 120
322 MISSING = $(MISSING) acosh.obj cbrt.obj erf.obj nan.obj tgamma.obj
323 !endif
324 MISSING = $(MISSING) explicit_bzero.obj
325 !endif
326 DLNOBJ = dln.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)
334 !else
335 !error copy coroutine has been replaced with pthread implementation at 42130a64f02294dc8025af3a51bda518c67ab33d
336 !endif
337 COROUTINE_H = $(COROUTINE_OBJ:.obj=.h)
339 ARFLAGS = -machine:$(MACHINE) -out:
340 LD = $(CC)
341 LDSHARED = $(LD) -LD
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
351 !endif
352 CPPFLAGS = $(DEFS) $(ARCHDEFS) $(CPPFLAGS)
353 !if "$(USE_RUBYGEMS)" == "no"
354 CPPFLAGS = -DDISABLE_RUBYGEMS $(CPPFLAGS)
355 !endif
356 !ifndef RJIT_SUPPORT
357 RJIT_SUPPORT = no
358 !endif
360 POSTLINK =
361 DLDFLAGS = $(LDFLAGS) -dll
362 MAINLIBS = $(LIBS)
363 SOLIBS =
364 RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
365 !ifndef RCFLAGS
366 !if $(MSC_VER) >= 1600
367 RCFLAGS=-nologo
368 !endif
369 !endif
371 ENABLE_SHARED = yes
372 LIBRUBY_LDSHARED = $(LDSHARED)
373 LIBRUBY_DLDFLAGS = $(EXTLDFLAGS) -implib:dummy.lib -def:$(RUBYDEF)
375 EXEEXT = .exe
376 EXECUTABLE_EXTS = ".exe",".com",".cmd",".bat"
377 !if !defined(PROGRAM)
378 PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
379 !endif
380 !if !defined(WPROGRAM) && defined(RUBYW_INSTALL_NAME)
381 WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
382 !endif
383 RUBYDEF = $(RUBY_SO_NAME).def
384 !if "$(CROSS_COMPILING)" == "yes"
385 MINIRUBY = $(RUBY) -I$(MAKEDIR) -r$(arch)-fake
386 RUNRUBY = $(MINIRUBY)
387 !else
388 MINIRUBY = .\miniruby$(EXEEXT) -I$(srcdir)/lib -I.
389 RUNRUBY = .\$(PROGRAM) -I$(srcdir)/lib -I"$(EXTOUT)/$(arch)" -I.
390 !endif
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"
396 XRUBY = $(MINIRUBY)
397 BOOTSTRAPRUBY = $(BASERUBY)
398 BOOTSTRAPRUBY_OPT = -r./$(arch)-fake
399 !else
400 BOOTSTRAPRUBY = $(MINIRUBY)
401 BOOTSTRAPRUBY_OPT =
402 XRUBY = $(RUNRUBY)
403 !endif
404 BTESTRUBY = $(MINIRUBY) -r./$(arch)-fake
405 !ifndef RUBY
406 RUBY = ruby
407 !endif
409 DTRACE_EXT = dmyh
411 !if !defined(STACK)
412 !if "$(ARCH)" == "x64"
413 STACK = 0x400000
414 !else
415 STACK = 0x200000
416 !endif
417 !if defined(STACK_COMMIT)
418 STACK = $(STACK),$(STACK_COMMIT)
419 !endif
420 !endif
421 ORGLIBPATH = $(LIB)
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
433 THREAD_MODEL  = win32
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
439 BUILTIN_BINARY = no
440 !else
441 PREP          = miniruby$(EXEEXT)
442 BUILTIN_BINARY = yes
443 !endif
445 !if !defined(EXTSTATIC)
446 EXTSTATIC     =
447 !endif
449 OBJEXT = obj
450 ASMEXT = asm
452 INSTALLED_LIST= .installed.list
454 SRC_FILE = $(<:\=/)
455 OS_SRC_FILE = $(<:/=\)
456 DEST_FILE = $(@:\=/)
457 OS_DEST_FILE = $(@:/=\)
459 !if !defined(WINMAINOBJ)
460 WINMAINOBJ    = winmain.$(OBJEXT)
461 !endif
462 MAINSRC       = $(MAINOBJ:.obj=.c)
463 ARCHMINIOBJS  = dmydln.$(OBJEXT) miniruby.res
464 LIBOBJS       = $(MISSING) $(LIBOBJS)
466 !ifndef COMMON_LIBS
467 COMMON_LIBS  = m
468 !endif
469 !ifndef COMMON_MACROS
470 COMMON_MACROS = WIN32_LEAN_AND_MEAN WIN32
471 !endif
472 !ifndef COMMON_HEADERS
473 COMMON_HEADERS = winsock2.h ws2tcpip.h windows.h
474 !endif
476 !if "$(EXTSTATIC)" == "static"
477 ENCOBJS = enc/encinit.$(OBJEXT) enc/libenc.lib enc/libtrans.lib
478 EXTOBJS = ext/extinit.$(OBJEXT)
479 ! if !defined(ENCSTATIC)
480 ENCSTATIC = static
481 ! endif
482 !else
483 ENCOBJS = dmyenc.$(OBJEXT)
484 EXTOBJS = dmyext.$(OBJEXT)
485 !endif
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)
492 !ifndef GIT
493 GIT = git
494 !endif
495 !if "$(HAVE_GIT)" == "yes" || "$(HAVE_GIT)" == "no"
496 !else if "$(GIT)" == ""
497 HAVE_GIT = no
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]
500 HAVE_GIT = yes
501 ! else
502 HAVE_GIT = no
503 ! endif
504 !else
505 ! if [for %x in (%PATHEXT:;= %) do @for %I in ($(GIT)%x) do @if not "%~$$PATH:I" == "" exit 1]
506 HAVE_GIT = yes
507 ! else
508 HAVE_GIT = no
509 ! endif
510 !endif
512 !if defined(VCS)
513 !else if exist($(srcdir)/.git)
514 VCS = $(GIT)
515 VCSUP = $(VCS) pull --rebase $(GITPULLOPTIONS)
516 !else
517 VCSUP = rem
518 !endif
519 ruby_pc = $(RUBY_BASE_NAME)-$(MAJOR).$(MINOR).pc
521 MESSAGE_BEGIN = @(for %I in (
522 MESSAGE_END = ) do @echo.%~I)
523 ECHO_BEGIN = @echo.
524 ECHO_END =
526 all: $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub $(srcdir)/common.mk
527 prog: config
529 ruby: $(PROGRAM)
530 rubyw: $(WPROGRAM)
531 stub: $(STUBPROGRAM)
532 rubystub: $(STUBPROGRAM)
534 !if !exist(enc/trans/newline.c) && exist($(srcdir)/enc/trans/newline.c)
535 NEWLINE_C = $(srcdir)/enc/trans/newline.c
536 !else
537 NEWLINE_C = enc/trans/newline.c
538 !endif
539 !if !exist(miniprelude.c) && exist($(srcdir)/miniprelude.c)
540 MINIPRELUDE_C = $(srcdir)/miniprelude.c
541 !else
542 MINIPRELUDE_C = miniprelude.c
543 !endif
544 !if !exist(golf_prelude.c) && exist($(srcdir)/golf_prelude.c)
545 GOLF_PRELUDE_C = $(srcdir)/golf_prelude.c
546 !else
547 GOLF_PRELUDE_C = golf_prelude.c
548 !endif
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::
555 !else
556 ACTIONS_GROUP = @:: $(empty)
557 ACTIONS_ENDGROUP = @::
558 !endif
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]
569 !endif
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" \
577 "" \
578 ) do @echo.%~J>>scriptbin.mk]
579 !else
580 ! include scriptbin.mk
581 ! if [del scriptbin.mk > nul]
582 ! endif
583 !endif
585 scriptbin: $(SCRIPTPROGRAMS)
587 !if "$(SCRIPTPROGRAMS)" != ""
588 $(SCRIPTPROGRAMS): $(STUBPROGRAM)
589 !endif
591 update-src::
592         @cd "$(srcdir:/=\)" && set LC_TIME=C && $(VCSUP)
594 .PHONY: reconfig
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)
611 BANG = !
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 \
619     ) \
621 config.status: nul
622 !endif
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:/=\)
630 !endif
631 !if !exist("$(arch_hdrdir)/ruby")
632         @md $(arch_hdrdir:/=\)\ruby
633 !endif
634         @$(IFCHANGE) "--timestamp=$(@:/=\)" $(RUBY_CONFIG_H:/=\) <<
635 #ifndef $(guard)
636 #define $(guard) 1
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.
640 #endif
641 !else
642 #if _MSC_VER != $(MSC_VER)
643 #error MSC version unmatch: $(MSC_VER) is expected.
644 #endif
645 !endif
646 #define RUBY_MSVCRT_VERSION $(RT_VER)
647 !if defined(ABI_VERSION)
648 #define RUBY_ABI_VERSION $(ABI_VERSION)
649 !endif
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
655 !endif
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
662 !endif
663 !if $(MSC_VER) >= 1400
664 #define HAVE_LONG_LONG 1
665 !else
666 #define ULL_TO_DOUBLE(n) ((double)(unsigned long)((n)>>32) * (1I64 << 32) + (unsigned long)(n))
667 !endif
668 #define HAVE_OFF_T 1
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)
673 #define SIZEOF_INT 4
674 #define SIZEOF_SHORT 2
675 #define SIZEOF_LONG 4
676 !if $(MSC_VER) >= 1400
677 #define SIZEOF_LONG_LONG 8
678 !else
679 #define SIZEOF_LONG_LONG 0
680 !endif
681 #define SIZEOF___INT64 8
682 #ifndef _INTEGRAL_MAX_BITS
683 #define _INTEGRAL_MAX_BITS 64
684 #endif
685 #define SIZEOF_OFF_T 8
686 !if "$(TARGET_OS)" == "mswin64"
687 #define SIZEOF_VOIDP 8
688 !else
689 #define SIZEOF_VOIDP 4
690 !endif
691 #define SIZEOF_FLOAT 4
692 #define SIZEOF_DOUBLE 8
693 #define SIGNEDNESS_OF_TIME_T -1
694 #define NEGATIVE_TIME_T 1
695 !if $(RT_VER) >= 80
696 #define SIZEOF_TIME_T 8
697 #define TIMET2NUM(v) LL2NUM(v)
698 #define NUM2TIMET(v) NUM2LL(v)
699 !else
700 #define SIZEOF_TIME_T 4
701 #define TIMET2NUM(v) LONG2NUM(v)
702 #define NUM2TIMET(v) NUM2LONG(v)
703 !endif
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
713 !else
714 #define SIZEOF_SIZE_T 4
715 #define SIZEOF_PTRDIFF_T 4
716 #define SIZEOF_INTPTR_T 4
717 #define SIZEOF_UINTPTR_T 4
718 !endif
719 !if $(MSC_VER) < 1400
720 #define SIZE_MAX UINT_MAX
721 !endif
722 !if $(MSC_VER) >= 1800
723 #define HAVE_VA_COPY 1
724 !else
725 #define HAVE_VA_COPY_VIA_STRUCT_ASSIGNMENT 1
726 !endif
727 !if $(MSC_VER) > 1100
728 #define NORETURN(x) __declspec(noreturn) x
729 !endif
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
734 !endif
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))
746 !endif
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
756 #define rb_pid_t int
757 #define rb_gid_t int
758 #define rb_uid_t int
759 #define HAVE_STRUCT_STAT_ST_RDEV 1
760 #define HAVE_STRUCT_TIMEVAL 1
761 !if $(MSC_VER) >= 1900
762 #define HAVE_STRUCT_TIMESPEC
763 !endif
764 !if $(MSC_VER) >= 1600
765 #define HAVE_INTTYPES_H 1
766 #define HAVE_STDINT_H 1
767 !else
768 #define int8_t signed char
769 #define uint8_t unsigned char
770 #define int16_t short
771 #define uint16_t unsigned short
772 #define int32_t int
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
788 !endif
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"
811 !else
812 #define ssize_t int
813 #define PRI_PTR_PREFIX PRI_INT_PREFIX
814 !endif
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
819 !if $(RT_VER) >= 120
820 #define HAVE_ACOSH 1
821 #define HAVE_ASINH 1
822 #define HAVE_ATANH 1
823 #define HAVE_CBRT 1
824 #define HAVE_LOG2 1
825 #define log2(x) log2(x)
826 #define HAVE_ERF 1
827 #define HAVE_ERFC 1
828 #define HAVE_ROUND 1
829 #define HAVE_TGAMMA 1
830 #define HAVE_NEXTAFTER 1
831 !endif
832 #define HAVE_ALLOCA 1
833 #define HAVE_DUP2 1
834 #define HAVE_MEMCMP 1
835 #define HAVE_MEMMOVE 1
836 #define HAVE_MKDIR 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
847 #define HAVE_FLOCK 1
848 #define HAVE_ISNAN 1
849 #define HAVE_FINITE 1
850 !if $(RT_VER) >= 120
851 #define HAVE_NAN 1
852 !endif
853 #define HAVE_HYPOT 1
854 #define HAVE_FMOD 1
855 #define HAVE_FREXP 1
856 #define HAVE_MODF 1
857 #define HAVE_WAITPID 1
858 #define HAVE_FSYNC 1
859 #define HAVE_GETCWD 1
860 #define HAVE_TRUNCATE 1
861 #define HAVE_FTRUNCATE 1
862 #define HAVE_LSTAT 1
863 #define HAVE_TIMES 1
864 #define HAVE_FCNTL 1
865 #define HAVE_LINK 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
873 #define HAVE_COSH 1
874 #define HAVE_SINH 1
875 #define HAVE_TANH 1
876 #define HAVE_SIGNBIT 1
877 #define HAVE_TZNAME 1
878 #define HAVE_DAYLIGHT 1
879 #define HAVE_GMTIME_R 1
880 #define HAVE_CHMOD 1
881 #define HAVE_CHOWN 1
882 #define HAVE_DUP 1
883 #define HAVE_EXECL 1
884 #define HAVE_EXECLE 1
885 #define HAVE_EXECV 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
892 #define HAVE_PIPE 1
893 #define HAVE_POPEN 1
894 #define HAVE_SHUTDOWN 1
895 #define HAVE_SYSTEM 1
896 #define HAVE_TZSET 1
897 #define HAVE_UMASK 1
898 !if $(RT_VER) > 120
899 #define HAVE_QSORT_S
900 !endif
901 #define HAVE_TYPE_NET_LUID 1
902 !if $(MSC_VER) >= 1600
903 #define HAVE_NULLPTR 1
904 !endif
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
911 #ifndef __cplusplus
912 #define inline __inline
913 !if $(MSC_VER) >= 1800
914 #define restrict __restrict
915 !else
916 #define restrict /* not supported */
917 !endif
918 #endif
919 #define NEED_IO_SEEK_BETWEEN_RW 1
920 !if "$(MACHINE)" == "x86" || "$(ARCH)" == "x64"
921 #define STACK_GROW_DIRECTION -1
922 !endif
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
927 #define DLEXT ".so"
928 !if "$(libdir_basename)" != "lib"
929 #define LIBDIR_BASENAME "$(libdir_basename)"
930 !endif
931 !if "$(EXTSTATIC)" == "static"
932 #define EXTSTATIC 1
933 !endif
934 !if "$(USE_GMP)" != ""
935 #define USE_GMP 1
936 !endif
937 #define EXECUTABLE_EXTS $(EXECUTABLE_EXTS)
938 #define RUBY_COREDLL "$(RT)"
939 #define RUBY_PLATFORM "$(arch)"
940 #define RUBY_SITEARCH "$(sitearch)"
941 #define USE_RJIT 0
942 #endif /* $(guard) */
945 #!if exist($(RUBY_CONFIG_H))
946 #! if exist(config_h.bak)
947 #       @del $(RUBY_CONFIG_H:.h=_h).bak
948 #! endif
949 #       @copy $(RUBY_CONFIG_H) $(RUBY_CONFIG_H:.h=_h).bak
950 #!endif
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)
957 #!endif
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
963         @echo Creating <<$@
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
984 s,@sysconfdir@,,;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
1010 s,@CC@,$(CC),;t t
1011 s,@CPP@,$(CPP),;t t
1012 s,@CXX@,$$(CC),;t t
1013 s,@LD@,$$(CC),;t t
1014 s,@YACC@,$(YACC),;t t
1015 s,@RANLIB@,,;t t
1016 s,@AR@,$(AR),;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
1037 s,@CCDLFLAGS@,,;t t
1038 s,@LDSHARED@,$(LDSHARED),;t t
1039 s,@SOEXT@,dll,;t t
1040 s,@DLEXT@,so,;t t
1041 s,@LIBEXT@,lib,;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
1050 s,@ARCHFILE@,,;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
1077 s,@RPATHFLAG@,,;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
1084 !endif
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
1135 <<KEEP
1137 !if "$(HAVE_BASERUBY)" != "yes" || "$(CROSS_COMPILING)" == "yes"
1138 $(RBCONFIG): $(PREP)
1139 !endif
1141 miniruby: miniruby$(EXEEXT)
1143 miniruby$(EXEEXT):
1144                 @echo $(LIBS)
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
1149                 $(Q) $(LDSHARED_1)
1150                 $(Q) $(LDSHARED_2)
1152 miniruby.rc:
1153                 @exit > $@
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)
1161                 $(Q) $(LDSHARED_0)
1162                 $(Q) $(LDSHARED_1)
1163                 $(Q) $(LDSHARED_2)
1164 ! endif
1165 !endif
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)
1174                 $(Q) $(LDSHARED_0)
1175                 $(Q) $(LDSHARED_1)
1176                 $(Q) $(LDSHARED_2)
1177 ! endif
1178 !endif
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)
1186                 $(Q) $(LDSHARED_0)
1187                 $(Q) $(LDSHARED_1)
1188                 $(Q) $(LDSHARED_2)
1189 ! endif
1190 !endif
1192 !if "$(LIBRUBY_SO_UPDATE)" == ""
1193 PRE_LIBRUBY_UPDATE = $(RM) $(LIBRUBY_EXTS)
1194 !else
1195 PRE_LIBRUBY_UPDATE =
1196 !endif
1198 $(LIBRUBY_A):   $(OBJS) $(INITOBJS)
1199 !if "$(EXTSTATIC)" != ""
1200                 @-$(PRE_LIBRUBY_UPDATE)
1201 !endif
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
1210                 @echo $(DLDOBJS)
1211 !if "$(EXTSTATIC)" == ""
1212                 @-$(PRE_LIBRUBY_UPDATE)
1213 !endif
1214                 $(ECHO) linking shared-library $(@:\=/)
1215                 $(Q) $(LDSHARED) $(DLDOBJS) $(LIBRUBY_A) \
1216                         $(RUBY_SO_NAME).res $(SOLIBS) $(EXTSOLIBS) $(LIBS) -Fe$@ -link $(LDFLAGS) \
1217                         $(LIBRUBY_DLDFLAGS)
1218                 @$(RM) dummy.lib dummy.exp
1219 !if defined(LDSHARED_0)
1220                 $(Q) $(LDSHARED_0)
1221                 $(Q) $(LDSHARED_1)
1222                 $(Q) $(LDSHARED_2)
1223 # | findstr -v -c:LNK4049 -c:LNK4217
1224 !endif
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:$<
1234 clean-local::
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
1240 distclean-local::
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 ( \
1251                     cd %I && ( \
1252                     call set n=%I && \
1253                     call set n=%n:%CD%\$(@D)\=% && \
1254                     call set n=%n:\.=% && \
1255                     call echo $(@F)ing %n:\=/% & \
1256                     $(MAKE) $(MFLAGS) $(@F) & \
1257                     cd %CD% & \
1258                     $(RMDIRS) %I \
1259                 ))) || @
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=)
1270 !endif
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)$(<:\=/)
1319 .c.obj:
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)$(<:\=/)
1332 .c.asm:
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)$(<:\=/)
1342 {$(srcdir)}.c{}.i:
1343         $(ECHO) preprocessing $(<:\=/)
1344         $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Fi:$@ $(CSRCFLAG)$(<:\=/)
1345 .c.i:
1346         $(ECHO) preprocessing $(<:\=/)
1347         $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Fi:$@ $(CSRCFLAG)$(<:\=/)
1349 .rc.res:
1350         $(ECHO) compiling $(<:\=/)
1351         $(Q) $(RC) $(RCFLAGS) -I. -I$(<D) $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:\=/)
1353 lex.c: {$(srcdir)}lex.c.blt
1354         copy $(?:/=\) $@
1356 $(srcdir)/enc/jis/props.h: {$(srcdir)}enc/jis/props.h.blt
1357         @if not exist $(@D:/=\) md $(@D:/=\)
1358         $(ECHO) copying $@
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)
1369 !endif
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"
1378 <<KEEP
1380 INSNS   = optinsn.inc optunifs.inc insns.inc insns_info.inc \
1381           vmtc.inc vm.inc
1383 !if [exit > insns_rules.mk]
1384 !else if [for %I in ($(INSNS)) do \
1385         @for %J in (\
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" \
1391 "" \
1392 ) do @echo.%~J>>insns_rules.mk]
1393 !else
1394 ! include insns_rules.mk
1395 ! if [del insns_rules.mk > nul]
1396 ! endif
1397 !endif
1399 verconf.h: verconf.mk
1401 loadpath: verconf.h
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]
1414 !else
1415 ! include rubyspec-capiext.mk
1416 ! if [del rubyspec-capiext.mk > nul]
1417 ! endif
1418 !endif
1420 $(RUBYSPEC_CAPIEXT_EXTS): $(RUBYSPEC_CAPIEXT_DEPS)
1421 rubyspec-capiext: $(RUBYSPEC_CAPIEXT_EXTS)
1422         @ $(NULLCMD)
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)
1431         $(Q)$(LDSHARED_0)
1432         $(Q)$(LDSHARED_1)
1433         $(Q)$(LDSHARED_2)
1434 !endif
1436 exts: rubyspec-capiext