3 ENABLE_SHARED
=@ENABLE_SHARED@
4 DLLWRAP
= @DLLWRAP@
--target
=@target_os@
6 ifeq (@target_os@
,cygwin
)
7 DLL_BASE_NAME
:= $(subst .dll
,,$(LIBRUBY_SO
))
9 DLL_BASE_NAME
:= $(RUBY_SO_NAME
)
10 DLLWRAP
+= -mno-cygwin
11 VPATH
+= $(srcdir)/win32
14 ifneq ($(ENABLE_SHARED
),yes
)
15 RUBY_EXP
= $(RUBY_INSTALL_NAME
).exp
17 LIBRUBYARG
= $(LIBRUBY_A
)
21 ifeq ($(RUBY_INSTALL_NAME
),ruby
)
22 RUBYW_INSTALL_NAME
= $(RUBY_INSTALL_NAME
)w
24 RUBYW_INSTALL_NAME
= $(subst ruby
,rubyw
,$(RUBY_INSTALL_NAME
))
27 WPROGRAM
= $(RUBYW_INSTALL_NAME
)$(EXEEXT
)
28 SOLIBS
:= $(DLL_BASE_NAME
).res.@OBJEXT@
$(SOLIBS
)
29 EXTOBJS
+= $(if
$(filter-out $(RUBYW_INSTALL_NAME
),$(@
:$(EXEEXT
)=)),$(RUBY_INSTALL_NAME
),$(@
:$(EXEEXT
)=)).res.
$(OBJEXT
)
30 RCFILES
= $(RUBY_INSTALL_NAME
).rc
$(RUBYW_INSTALL_NAME
).rc
$(DLL_BASE_NAME
).rc
31 RUBYDEF
= $(RUBY_SO_NAME
).def
36 $(LIBRUBY
): $(RUBY_EXP
) $(LIBRUBY_SO
)
37 $(RUBY_EXP
) $(LIBRUBY_SO
): $(DLL_BASE_NAME
).res.@OBJEXT@
40 @WINDRES@
--include-dir .
--include-dir
$(<D
) --include-dir
$(srcdir)/win32
$< $@
42 $(RCFILES
): $(RBCONFIG
)
43 @
$(MINIRUBY
) $(srcdir)/win32
/resource.rb \
44 -ruby_name
=$(RUBY_INSTALL_NAME
) -rubyw_name
=$(RUBYW_INSTALL_NAME
) \
45 -so_name
=$(DLL_BASE_NAME
) \
46 .
$(icondirs
) $(srcdir)/win32
48 $(PROGRAM
): $(RUBY_INSTALL_NAME
).res.@OBJEXT@
49 $(WPROGRAM
): $(RUBYW_INSTALL_NAME
).res.@OBJEXT@
51 $(PURIFY
) $(CC
) -mwindows
-e _mainCRTStartup
$(LDFLAGS
) $(XLDFLAGS
) \
52 $(MAINOBJ
) $(EXTOBJS
) $(LIBRUBYARG
) $(LIBS
) -o
$@
54 $(RUBY_EXP
): $(LIBRUBY_A
)
56 --output-exp
=$(RUBY_EXP
) \
57 --export-all
$(LIBRUBY_A
) $(LIBS
) -o
$(PROGRAM
)
58 $(LDSHARED
) $(DLDFLAGS
) $(OBJS
) dmyext.o
$(SOLIBS
) -o
$(PROGRAM
)
61 GNUmakefile
: $(srcdir)/cygwin
/GNUmakefile.in
63 ifeq (@target_os@
,mingw32
)
64 $(OBJS
) $(MAINOBJ
): win32.h
66 $(LIBRUBY_SO
): $(RUBYDEF
)
68 $(RUBYDEF
): $(LIBRUBY_A
) $(PREP
) $(RBCONFIG
)
69 $(MINIRUBY
) $(srcdir)/win32
/mkexports.rb
-output
=$@
$(LIBRUBY_A
)
75 ifeq (@target_os@
,cygwin
)
76 cygwin-
$(RUBY_INSTALL_NAME
)$(MAJOR
)$(MINOR
)$(TEENY
).dll
: $(LIBRUBY_A
)
77 @NM@
--extern
--defined
$(LIBRUBY_A
) | \
78 $(MINIRUBY
) -ne
'BEGIN{puts "EXPORTS"}; puts $$1+"=$(@F)."+$$1 if / [CDT] _(.*)$$/' >rubydll.def
79 @DLLWRAP@
-s
--def
=rubydll.def
-o
$@
84 @
$(RM
) $(RUBY_EXP
) $(RCFILES
:.rc
=.res.@OBJEXT@
)