cygwin/GNUmakefile.in
DEFINITIONS
This source file includes following functions.
1 include Makefile
2
3 ENABLE_SHARED=@ENABLE_SHARED@
4
5 ifeq ($(ENABLE_SHARED),yes)
6 CPPFLAGS += -DLIBRUBY_SO=\"$(LIBRUBY_SO)\"
7 else
8 RUBY_EXP = $(RUBY_INSTALL_NAME).exp
9 EXTOBJS = $(RUBY_EXP)
10 LIBRUBYARG = $(LIBRUBY_A)
11 endif
12
13 ifeq ($(RUBY_INSTALL_NAME),ruby)
14 RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
15 else
16 RUBYW_INSTALL_NAME = $(subst ruby,rubyw,$(RUBY_INSTALL_NAME))
17 endif
18 WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
19 RUBYDEF = $(RUBY_INSTALL_NAME).def
20 SOLIBS := $(RUBY_SO_NAME).res.@OBJEXT@ $(SOLIBS)
21 EXTOBJS += $(@:$(EXEEXT)=.res.@OBJEXT@)
22
23 $(LIBRUBY_SO): $(RUBYDEF) $(RUBY_SO_NAME).res.@OBJEXT@ $(RUBY_EXP)
24 $(LIBRUBY): $(LIBRUBY_SO)
25
26 %.res.@OBJEXT@: %.rc
27 @WINDRES@ --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
28
29 $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
30 @@MINIRUBY@ $(srcdir)/win32/resource.rb \
31 -ruby_name=$(RUBY_INSTALL_NAME) -rubyw_name=$(RUBYW_INSTALL_NAME) \
32 -so_name=$(RUBY_SO_NAME) \
33 . $(icondirs) $(srcdir)/win32
34
35 $(PROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@
36 $(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@
37 @rm -f $@
38 $(PURIFY) $(CC) -mwindows -e _mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
39 $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
40
41 $(RUBYDEF): $(LIBRUBY_A)
42 echo EXPORTS > $(RUBYDEF)
43 @NM@ --extern-only --defined-only $(LIBRUBY_A) | \
44 @MINIRUBY@ -ne 'puts $$1 if / [CDT] _(.*)$$/' >> $(RUBYDEF)
45 $(RUBY_EXP): $(RUBYDEF)
46 @DLLWRAP@ --output-exp=$(RUBY_EXP) --output-lib=$(LIBRUBY) \
47 --def=$(RUBYDEF) $(LIBRUBY_A) $(LIBS) -o $(PROGRAM)
48 rm $(PROGRAM)