* test/ruby/envutil.rb (assert_normal_exit): show pid when fail.
[ruby-svn.git] / cygwin / GNUmakefile.in
blob7995f31cd3d7c2536fb26625bb131b2cf3f42e86
1 include Makefile
3 ENABLE_SHARED=@ENABLE_SHARED@
4 DLLWRAP = @DLLWRAP@ --target=@target_os@
6 ifeq (@target_os@,cygwin)
7 DLL_BASE_NAME := $(subst .dll,,$(LIBRUBY_SO))
8 else
9 DLL_BASE_NAME := $(RUBY_SO_NAME)
10 DLLWRAP += -mno-cygwin
11 VPATH += $(srcdir)/win32
12 endif
14 ifneq ($(ENABLE_SHARED),yes)
15 RUBY_EXP = $(RUBY_INSTALL_NAME).exp
16 EXTOBJS = $(RUBY_EXP)
17 LIBRUBYARG = $(LIBRUBY_A)
18 LIBRUBY_SO =
19 endif
21 ifeq ($(RUBY_INSTALL_NAME),ruby)
22 RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
23 else
24 RUBYW_INSTALL_NAME = $(subst ruby,rubyw,$(RUBY_INSTALL_NAME))
25 endif
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
33 ruby: $(PROGRAM)
34 rubyw: $(WPROGRAM)
36 $(LIBRUBY): $(RUBY_EXP) $(LIBRUBY_SO)
37 $(RUBY_EXP) $(LIBRUBY_SO): $(DLL_BASE_NAME).res.@OBJEXT@
39 %.res.@OBJEXT@: %.rc
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@
50 @rm -f $@
51 $(PURIFY) $(CC) -mwindows -e _mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
52 $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
54 $(RUBY_EXP): $(LIBRUBY_A)
55 $(DLLWRAP) \
56 --output-exp=$(RUBY_EXP) \
57 --export-all $(LIBRUBY_A) $(LIBS) -o $(PROGRAM)
58 $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)
59 @rm -f $(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)
71 clean-local::
72 @$(RM) $(RUBYDEF)
73 endif
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 $@
80 @rm -f rubydll.def
81 endif
83 clean-local::
84 @$(RM) $(RUBY_EXP) $(RCFILES:.rc=.res.@OBJEXT@)
86 distclean-local::
87 @$(RM) $(RCFILES)