1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
|
# -*- makefile -*-
SHELL = $(COMSPEC)
MKFILES = Makefile
NULL = nul
!ifndef MFLAGS
MFLAGS=-l
!endif
!ifndef CROSS_COMPILING
CROSS_COMPILING = 0
!endif
!ifndef LARGEFILE_SUPPORT
LARGEFILE_SUPPORT = 1
!endif
!ifndef win_srcdir
win_srcdir = $(srcdir)/win32
!endif
#### Start of system configuration section. ####
## variables may be overridden by $(compile_dir)/Makefile
!ifndef srcdir
srcdir = ..
!endif
!ifndef RUBY_INSTALL_NAME
RUBY_INSTALL_NAME = ruby$(RUBY_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
!if !defined(icondirs) && defined(ICONDIRS)
icondirs=$(ICONDIRS)
!endif
!if defined(icondirs)
icondirs=$(icondirs:\=/)
iconinc=-I$(icondirs: = -I)
!endif
###############
VPATH = $(srcdir);$(srcdir)/missing;$(srcdir)/win32
.SUFFIXES: .y .def .lib
!if !defined(CC)
CC = cl
!endif
!if !defined(CPP) || "$(CPP)" == "cl"
CPP = $(CC) -E
!endif
!if !defined(YACC)
YACC = byacc
!endif
AR = lib -nologo
PURIFY =
AUTOCONF = autoconf
RM = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat
!if !defined(PROCESSOR_ARCHITECTURE)
PROCESSOR_ARCHITECTURE = x86
!endif
MACHINE = $(PROCESSOR_ARCHITECTURE)
!if "$(PROCESSOR_ARCHITECTURE)" == "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 = $(PROCESSOR_ARCHITECTURE)
ARCH = $(PROCESSOR_ARCHITECTURE)
!endif
!if !defined(DEBUGFLAGS) && $(MSC_VER) < 1400
DEBUGFLAGS = -Zi
!endif
!if !defined(OPTFLAGS)
!if $(MSC_VER) < 1400
OPTFLAGS = -O2b2xg-
!else
OPTFLAGS = -O2b2xty-
!endif
!endif
!if !defined(OS)
OS = mswin32
!endif
!if !defined(RT)
!error RT not defined. Retry from configure pass.
!endif
arch = $(ARCH)-$(OS)
!ifndef RUBY_SO_NAME
RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)
!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)
libdir = $(exec_prefix)/lib
!endif
!if !defined(datadir)
datadir = /share
!endif
!ifndef EXTOUT
EXTOUT = .ext
!endif
!ifndef RIDATADIR
RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
!endif
!ifndef TESTUI
TESTUI = console
!endif
!ifndef TESTS
TESTS =
!endif
!ifndef RDOCTARGET
RDOCTARGET = install-nodoc
!endif
OUTFLAG = -Fe
!if !defined(RUNTIMEFLAG)
RUNTIMEFLAG = -MD
!endif
!if !defined(CFLAGS)
CFLAGS = $(RUNTIMEFLAG) $(DEBUGFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG)
!endif
!if !defined(LDFLAGS)
LDFLAGS = -link -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(LIBS)
LIBS = oldnames.lib user32.lib advapi32.lib shell32.lib
!if !defined(USE_WINSOCK2)
LIBS = $(LIBS) wsock32.lib
!else
LIBS = $(LIBS) ws2_32.lib
!endif
LIBS = $(LIBS) $(EXTLIBS)
!endif
!if !defined(MISSING)
MISSING = acosh.obj crypt.obj erf.obj win32.obj
!endif
ARFLAGS = -machine:$(MACHINE) -out:
CC = $(CC) -nologo
LD = $(CC)
LDSHARED = $(LD) -LD
XCFLAGS = -DRUBY_EXPORT -I. -I$(srcdir) -I$(srcdir)/missing $(XCFLAGS)
!if $(MSC_VER) >= 1400
# Prevents VC++ 2005 (cl ver 14) warnings
DEFS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
MANIFESTTOOL = mt -nologo
LDSHARED_1 = $(MANIFESTTOOL) -manifest $(@).manifest -outputresource:$(@);2
LDSHARED_2 = @$(RM) $(@:/=\).manifest
!endif
CPPFLAGS = $(DEFS) $(ARCHDEFS) $(CPPFLAGS)
DLDFLAGS = $(LDFLAGS) -dll
SOLIBS =
LIBRUBY_LDSHARED = $(LDSHARED)
LIBRUBY_DLDFLAGS = $(EXTLDFLAGS) -def:$(RUBYDEF)
EXEEXT = .exe
!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)
MINIRUBY = $(RUBY) -I$(MAKEDIR) -rfake
RUNRUBY = $(MINIRUBY)
!else
MINIRUBY = .\miniruby$(EXEEXT) -I$(srcdir)/lib
RUNRUBY = .\$(PROGRAM)
!endif
MINIRUBY = $(MINIRUBY) $(MINIRUBYOPT)
RUNRUBY = $(RUNRUBY) "$(srcdir)/runruby.rb" --extout="$(EXTOUT)" --
!if !defined(STACK)
STACK = 0x2000000
!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 = $(RUBY_SO_NAME).lib
LIBRUBYARG = $(LIBRUBY)
!if $(CROSS_COMPILING)
PREP = fake.rb
!else
PREP = miniruby$(EXEEXT)
!endif
!if !defined(EXTSTATIC)
EXTSTATIC =
!endif
OBJEXT = obj
ASMEXT = asm
INSTALLED_LIST= .installed.list
!if !defined(WINMAINOBJ)
WINMAINOBJ = winmain.$(OBJEXT)
!endif
MINIOBJS = dmydln.$(OBJEXT)
LIBOBJS = acosh.obj crypt.obj erf.obj strlcpy.obj strlcat.obj win32.obj $(LIBOBJS)
!ifndef COMMON_LIBS
COMMON_LIBS = m
!endif
!ifndef COMMON_MACROS
COMMON_MACROS = WIN32_LEAN_AND_MEAN WIN32
!endif
!ifndef COMMON_HEADERS
!if !defined(USE_WINSOCK2)
COMMON_HEADERS = winsock.h
!else
COMMON_HEADERS = winsock2.h ws2tcpip.h
!endif
COMMON_HEADERS = $(COMMON_HEADERS) windows.h
!endif
all: $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub $(srcdir)/common.mk
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
!include $(srcdir)/common.mk
$(MKFILES): $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub $(win_srcdir)/configure.bat $(win_srcdir)/setup.mak
$(COMSPEC) /C $(win_srcdir:/=\)\configure.bat $(configure_args)
@echo $(MKFILES) should be updated, re-run $(MAKE).
@exit 1
CONFIG_H = ./.config.h.time
config: config.status
config.status: $(CONFIG_H)
BANG = !
!if exist(config.h)
!include config.h
!endif
$(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
@echo Creating config.h
@$(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat config.h <<
#if _MSC_VER != $(MSC_VER)
#error MSC version unmatch: _MSC_VER: $(MSC_VER) is expected.
#endif
!if defined(USE_WINSOCK2)
#define USE_WINSOCK2 $(USE_WINSOCK2)
!endif
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
!if $(MSC_VER) >= 1400
#define HAVE_LONG_LONG 1
!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
#define SIZEOF_OFF_T 4
#define SIZEOF_VOIDP 4
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
!if $(MSC_VER) >= 1400
#define SIZEOF_TIME_T 8
!else
#define SIZEOF_TIME_T 4
!endif
#define HAVE_PROTOTYPES 1
#define TOKEN_PASTE(x,y) x##y
#define HAVE_STDARG_PROTOTYPES 1
!if $(MSC_VER) > 1100
#define NORETURN(x) __declspec(noreturn) x
!endif
#define RUBY_EXTERN extern __declspec(dllimport)
#define HAVE_DECL_SYS_NERR 1
!if !defined(WIN32_WCE)
#define HAVE_LIMITS_H 1
!endif
#define HAVE_FCNTL_H 1
#define HAVE_SYS_UTIME_H 1
#define HAVE_FLOAT_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_ST_RDEV 1
#define GETGROUPS_T int
#define RETSIGTYPE void
!if !defined(WIN32_WCE)
#define HAVE_ALLOCA 1
!endif
#define HAVE_DUP2 1
#define HAVE_MEMCMP 1
#define HAVE_MEMMOVE 1
#define HAVE_MKDIR 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_STRTOD 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_FLOCK 1
#define HAVE_VSNPRINTF 1
#define HAVE_ISNAN 1
#define HAVE_FINITE 1
#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_CHSIZE 1
#define HAVE_TIMES 1
#define HAVE_FCNTL 1
#define HAVE_LINK 1
!if !defined(WIN32_WCE)
#define HAVE__SETJMP 1
!endif
#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_TZNAME 1
#define HAVE_DAYLIGHT 1
#define SETPGRP_VOID 1
#define RSHIFT(x,y) ((x)>>(int)y)
#define FILE_COUNT _cnt
#define FILE_READPTR _ptr
#define RUBY_SETJMP(env) _setjmp(env)
#define RUBY_LONGJMP(env,val) longjmp(env,val)
#define RUBY_JMP_BUF jmp_buf
#define inline __inline
#define NEED_IO_SEEK_BETWEEN_RW 1
!if "$(PROCESSOR_ARCHITECTURE)" == "x86" || "$(ARCH)" == "x64" || "$(ARCH)" == "ia64"
#define STACK_GROW_DIRECTION -1
!endif
#define DEFAULT_KCODE KCODE_NONE
#define DLEXT ".so"
#define DLEXT2 ".dll"
#define RUBY_LIB "/lib/ruby/$(MAJOR).$(MINOR)"
#define RUBY_SITE_LIB "/lib/ruby/site_ruby"
#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)"
#define RUBY_VENDOR_LIB "/lib/ruby/vendor_ruby"
#define RUBY_VENDOR_LIB2 "/lib/ruby/vendor_ruby/$(MAJOR).$(MINOR)"
#define RUBY_PLATFORM "$(arch)"
#define RUBY_ARCHLIB "/lib/ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(RT)"
#define RUBY_VENDOR_ARCHLIB "/lib/ruby/vendor_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(RT)"
#define LIBRUBY_SO "$(LIBRUBY_SO)"
#if 0
$(BANG)if "$(RUBY_SO_NAME)"!="$$(RUBY_SO_NAME)" || "$(ARCH)-$(OS)"!="$$(ARCH)-$$(OS)"
config.h: nul
$(BANG)endif
#endif
!if defined(WIN32_WCE)
#define GC_MALLOC_LIMIT 4000000
#define stricmp _stricmp
#define fopen wce_fopen
#define open _open
#define read _read
#define write _write
#define lseek _lseek
#if _WIN32_WCE < 300
#define isascii(c) ( (c>=0x00&&c<=0x7f)?1:0 )
#define isspace(c) ( ((c>=0x09&&c<=0x0d)||c==0x20)?1:0 )
#define isdigit(c) ( (c>=0x30&&c<=0x39)?1:0 )
#define isupper(c) ( (c>='A'&&c<='Z')?1:0 )
#define isalpha(c) ( ((c>='A'&&c<='Z')||(c>='a'&&c<='z'))?1:0 )
#define isprint(c) ( (c>=0x20&&c<=0x7e)?1:0 )
#define isalnum(c) ( (isalpha(c)||isdigit(c))?1:0 )
#define iscntrl(c) ( ((c>=0x00&&c<=0x1f)||c==0x7f)?1:0 )
#define islower(c) ( (c>='a'&&c<='z')?1:0 )
#define ispunct(c) ( !(isalnum(c)||isspace(c))?1:0 )
#define isxdigit(c) ( ((c>=0&&c<=9)||(c>='A'&&c<='F')||(c>='a'&&c<='f'))?1:0 )
#endif
!endif
<<
@exit > $(@:/=\)
config.status: $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub $(srcdir)/common.mk
@echo Creating $@
@exit <<$@
# 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,@CPPFLAGS@,$(CPPFLAGS),;t t
s,@CXXFLAGS@,$(CXXFLAGS),;t t
s,@FFLAGS@,$(FFLAGS),;t t
s,@LDFLAGS@,,;t t
s,@LIBS@,$(LIBS),;t t
s,@exec_prefix@,$${prefix},;t t
s,@prefix@,,;t t
s,@program_transform_name@,s,$$,$(RUBY_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@,$${prefix}/etc,;t t
s,@sharedstatedir@,/etc,;t t
s,@localstatedir@,/var,;t t
s,@libdir@,$${exec_prefix}/lib,;t t
s,@includedir@,$${prefix}/include,;t t
s,@oldincludedir@,/usr/include,;t t
s,@infodir@,$${prefix}/info,;t t
s,@mandir@,$${prefix}/man,;t t
s,@build@,$(CPU)-pc-$(OS),;t t
s,@build_alias@,$(CPU)-$(OS),;t t
s,@build_cpu@,$(CPU),;t t
s,@build_vendor@,pc,;t t
s,@build_os@,$(OS),;t t
s,@host@,$(CPU)-pc-$(OS),;t t
s,@host_alias@,$(CPU)-$(OS),;t t
s,@host_cpu@,$(CPU),;t t
s,@host_vendor@,pc,;t t
s,@host_os@,$(OS),;t t
s,@target@,$(ARCH)-pc-$(OS),;t t
s,@target_alias@,$(ARCH)-$(OS),;t t
s,@target_cpu@,$(ARCH),;t t
s,@target_vendor@,pc,;t t
s,@target_os@,$(OS),;t t
s,@CC@,$(CC),;t t
s,@CPP@,$(CPP),;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,@CP@,copy > nul,;t t
s,@LIBOBJS@,$(LIBOBJS),;t t
s,@ALLOCA@,$(ALLOCA),;t t
s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
s,@EXEEXT@,.exe,;t t
s,@OBJEXT@,$(OBJEXT),;t t
s,@XCFLAGS@,$(XCFLAGS),;t t
s,@XLDFLAGS@,$(XLDFLAGS),;t t
s,@DLDFLAGS@,$(DLDFLAGS) $$(LIBPATH),;t t
s,@ARCH_FLAG@,$(ARCH_FLAG),;t t
s,@STATIC@,$(STATIC),;t t
s,@CCDLFLAGS@,,;t t
s,@LDSHARED@,$(LDSHARED),;t t
s,@DLEXT@,so,;t t
s,@DLEXT2@,dll,;t t
s,@LIBEXT@,lib,;t t
s,@STRIP@,$(STRIP),;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@,$(RDOCTARGET),;t t
s,@LIBRUBY_LDSHARED@,$(LIBRUBY_LDSHARED),;t t
s,@LIBRUBY_DLDFLAGS@,$(LIBRUBY_DLDFLAGS),;t t
s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
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),;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,@OUTFLAG@,$(OUTFLAG),;t t
s,@CPPOUTFILE@,-P,;t t
s,@LIBPATHFLAG@, -libpath:"%s",;t t
s,@RPATHFLAG@,,;t t
s,@LIBARG@,%s.lib,;t t
s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) $$(DLDFLAGS) -implib:$$(*F:.so=)-$$(arch).lib -pdb:$$(*F:.so=)-$$(arch).pdb -def:$$(DEFFILE),;t t
!if $(MSC_VER) >= 1400
s,@LINK_SO@,$(MANIFESTTOOL) -manifest $$(@).manifest -outputresource:$$(@);2,;t t
s,@LINK_SO@,@$$(RM) $$(@:/=\).manifest,;t t
!endif
s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;t t
s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) -c -Tp$$(<:\=/),;t t
s,@COMPILE_RULES@,{$$(hdrdir)}.%s{}.%s: {$$(topdir)}.%s{}.%s: {$$(srcdir)}.%s{}.%s: .%s.%s:,;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,@DISTCLEANFILES@,vc*.pdb,;t t
s,@EXPORT_PREFIX@, ,;t t
s,@arch@,$(ARCH)-$(OS),;t t
s,@sitearch@,$(ARCH)-$(RT),;t t
s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t
s,@vendordir@,$${prefix}/lib/ruby/vendor_ruby,;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
<<KEEP
miniruby$(EXEEXT):
@echo. $(LIBS)
@$(RM) $@
$(PURIFY) $(CC) $(MAINOBJ) $(MINIOBJS) $(LIBRUBY_A) $(LIBS) -Fe$@ $(LDFLAGS)
$(LDSHARED_1)
$(LDSHARED_2)
!if "$(PROGRAM)" != ""
$(PROGRAM): $(RUBY_INSTALL_NAME).res
$(PURIFY) $(CC) $(MAINOBJ) $(RUBY_INSTALL_NAME).res \
$(OUTFLAG)$@ $(LIBRUBYARG) $(LDFLAGS) $(XLDFLAGS)
$(LDSHARED_1)
$(LDSHARED_2)
!endif
!if "$(WPROGRAM)" != ""
$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res
$(PURIFY) $(CC) $(MAINOBJ) $(WINMAINOBJ) \
$(RUBYW_INSTALL_NAME).res $(OUTFLAG)$@ $(LIBRUBYARG) \
$(LDFLAGS) $(XLDFLAGS) -subsystem:Windows
$(LDSHARED_1)
$(LDSHARED_2)
!endif
$(LIBRUBY_A): $(OBJS) $(DMYEXT)
$(AR) $(ARFLAGS)$@ $(OBJS) $(DMYEXT)
$(LIBRUBY): $(RUBYDEF)
$(AR) $(ARFLAGS)$@ -def:$(RUBYDEF)
$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
@echo. $(DLDOBJS)
@-$(PRE_LIBRUBY_UPDATE)
$(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) \
$(RUBY_SO_NAME).res $(LIBS) -Fe$@ $(LDFLAGS) \
$(LIBRUBY_DLDFLAGS)
$(LDSHARED_1)
$(LDSHARED_2)
$(RUBYDEF): $(LIBRUBY_A) $(PREP)
$(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
{$(win_srcdir)}.def.lib:
$(AR) $(ARFLAGS)$@ -def:$<
clean-local::
@$(RM) $(WINMAINOBJ) ext\extinit.c ext\extinit.$(OBJEXT) ext\vc*.pdb miniruby.lib
@$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
@$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF)
distclean-local::
@$(RM) ext\config.cache $(RBCONFIG:/=\) $(CONFIG_H:/=\)
@$(RM) $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: $(RBCONFIG)
@$(MINIRUBY) $(srcdir)/win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) \
-rubyw_name=$(RUBYW_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) \
!if defined(WIN32_WCE)
-wce_ver=$(SUBSYSVERSION) \
!endif
. $(icondirs) $(win_srcdir)
fake.rb: $(MKFILES)
@echo Creating <<$@
class Object
CROSS_COMPILING = RUBY_PLATFORM
remove_const :RUBY_PLATFORM
remove_const :RUBY_VERSION
RUBY_PLATFORM = "$(ARCH)"
RUBY_VERSION = "$(MAJOR).$(MINOR).$(TEENY)"
end
class File
remove_const :ALT_SEPARATOR
ALT_SEPARATOR = "\\"
end
<<KEEP
update-rubyspec:
!if exist($(srcdir:/=\)\rubyspec)
cd $(srcdir:/=\)\rubyspec\mspec
git pull
cd ..\spec\rubyspec
git pull
!else
git clone $(MSPEC_GIT_URL) $(srcdir)/rubyspec/mspec
git clone $(RUBYSPEC_GIT_URL) $(srcdir)/rubyspec/spec/rubyspec
!endif
test-rubyspec:
!if exist($(srcdir:/=\)\rubyspec)
$(RUNRUBY) $(srcdir)/rubyspec/mspec/bin/mspec -r$(srcdir)/ext/purelib.rb $(srcdir)/rubyspec/spec/rubyspec/$(MAJOR).$(MINOR)
!else
@echo No rubyspec here. put rubyspec to srcdir first.
@cd $(srcdir:/=\)\rubyspec
!endif
{$(srcdir)/missing}.c.obj:
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
{$(srcdir)/win32}.c.obj:
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
{$(win_srcdir)}.c.obj:
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
{$(win_srcdir)/sys}.c.obj:
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
{$(srcdir)}.c.obj:
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
.c.obj:
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
.rc.res:
$(RC) -I. -I$(<D) $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:\=/)
{$(srcdir)}.y.c:
$(YACC) $(YFLAGS) $(<:\=/)
sed -e "s!^ *extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $@
@del y.tab.c
$(OBJS): {$(srcdir)}win32/win32.h
dir.$(OBJEXT) win32.$(OBJEXT): {$(srcdir)}win32/dir.h
ext/extinit.obj: ext/extinit.c $(SETUP)
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fo$@ -c ext/extinit.c
|