path: root/win32/Makefile.sub
diff options
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-09 07:41:44 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-09 07:41:44 +0000
commita5c0e5a382d577b900c9a49fa09547dbf602e16c (patch)
tree30c1de7503dcad76dccfe713f2a7894277cf0150 /win32/Makefile.sub
parent53a2b14909a271e54c1e5d771075be608e37fb15 (diff)
* ext/ Use -F and -T for mswin32 because cl.exe doesn't support -o officially and cl.exe considers that *.cc and *.cxx are OBJs.
* lib/mkmf.rb: ditto. * win32/Makefile.sub: Use del instead of rm. All these changes are derived from Nobuyoshi Nakada's patch. Thanks. git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/Makefile.sub')
1 files changed, 62 insertions, 22 deletions
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 42100a5..44f7840 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
!ifndef RUBY_SO_NAME
RUBY_SO_NAME = rubymw
+!if !defined(icondirs) && defined(ICONDIRS)
+!if defined(icondirs)
VPATH = $(srcdir):$(srcdir)/missing
@@ -31,7 +38,7 @@ AUTOCONF = autoconf
prefix = /usr
CFLAGS = -nologo -DNT=1 -Zi -MD -O2b2xg- -G5
-CPPFLAGS = -I$(srcdir) -I$(srcdir)/missing
+CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/missing -DLIBRUBY_SO=\"$(LIBRUBY_SO)\"
@@ -102,7 +109,7 @@ OBJS = array.obj \
all: miniruby$(EXEEXT) rbconfig.rb ext/extmk.rb \
- set LIB=../..;$(ORGLIBPATH)
+ set LIB=..\..;$(ORGLIBPATH)
@.\miniruby$(EXEEXT) -Cext extmk.rb
ruby: $(PROGRAM)
@@ -110,6 +117,9 @@ rubyw: $(WPROGRAM)
lib: $(LIBRUBY)
dll: $(LIBRUBY_SO)
+config.h config.status: $(srcdir)/win32/$$
+ @type $(srcdir:/=\)\win32\$ > $@
ext/extmk.rb: $(srcdir)/ext/ config.status
@echo Creating ext/extmk.rb
@.\miniruby$(EXEEXT) $(srcdir)/ext/configsub.rb \
@@ -121,15 +131,15 @@ ext/extmk.rb: $(srcdir)/ext/ config.status
miniruby$(EXEEXT): $(OBJS) $(MAINOBJ) $(EXTOBJS)
@echo $(EXTOBJS)
@echo $(LIBS)
- -o $@ $(LIBRUBYARG) -link /STACK:$(STACK)
+ -Fe$@ $(LIBRUBYARG) -link -stack:$(STACK) -incremental:no
- -o $@ $(LIBRUBYARG) -link /STACK:$(STACK) /SUBSYSTEM:Windows
+ -Fe$@ $(LIBRUBYARG) -link -stack:$(STACK) -subsystem:Windows -incremental:no
$(LIBRUBY_A): $(OBJS) dmyext.obj
lib -nologo /OUT:$@ $(OBJS) dmyext.obj
@@ -138,9 +148,9 @@ $(LIBRUBY): $(RUBYDEF)
lib -nologo /OUT:$@ /DEF:$(RUBYDEF)
- set LIB=./win32;$(ORGLIBPATH)
+ set LIB=.\win32;$(ORGLIBPATH)
- -o $@ -link /DLL /DEF:$(RUBYDEF)
+ -Fe$@ -link -dll -def:$(RUBYDEF)
!if "$(LIBRUBY_SO)" != "rubymw.dll"
rubymw.dll: $(LIBRUBY)
@@ -153,21 +163,50 @@ $(RUBYDEF): $(LIBRUBY_A) miniruby$(EXEEXT)
install: rbconfig.rb
.\miniruby.exe $(srcdir)/instruby.rb $(DESTDIR)
-clean:; @rm -f $(OBJS) $(LIBRUBY_A) $(MAINOBJ) rbconfig.rb
- @rm -f ext/extinit.c ext/extinit.obj ext/vc*.pdb *.obj *.res
+ @if exist $(LIBRUBY_A) del $(LIBRUBY_A)
+ @if exist $(MAINOBJ) del $(MAINOBJ)
+ @if exist rbconfig.rb del rbconfig.rb
+ @if exist ext\extinit.c del ext\extinit.c
+ @if exist ext\extinit.obj del ext\extinit.obj
+ @if exist ext\vc*.pdb del ext\vc*.pdb
+ @if exist *.obj del *.obj
+ @if exist *.res del *.res
@-.\miniruby$(EXEEXT) -Cext extmk.rb clean
distclean: clean
- @rm -f Makefile ext/extmk.rb config.h
- @rm -f ext/config.cache config.cache config.log config.status
- @rm -f *~ core *.core gmon.out y.output ruby.imp
- @rm -f *.map *.pdb *.ilk *.exp $(RUBYDEF)
- @rm -f $(PROGRAM) $(WPROGRAM) $(LIBRUBY_SO) $(LIBRUBY) miniruby$(EXEEXT)
+ @if exist Makefile del Makefile
+ @if exist ext\extmk.rb del ext\extmk.rb
+ @if exist config.h del config.h
+ @if exist ext\config.cache del ext\config.cache
+ @if exist config.cache del config.cache
+ @if exist config.log del config.log
+ @if exist config.status del config.status
+ @if exist *~ del *~
+ @if exist *.bak del *.bak
+ @if exist *.stackdump del *.stackdump
+ @if exist *.core del *.core
+ @if exist gmon.out del gmon.out
+ @if exist del
+ @if exist y.output del y.output
+ @if exist *.map del *.map
+ @if exist *.pdb del *.pdb
+ @if exist *.ilk del *.ilk
+ @if exist *.exp del *.exp
+ @if exist $(RUBYDEF) del $(RUBYDEF)
+ @if exist $(RUBY_INSTALL_NAME).rc del $(RUBY_INSTALL_NAME).rc
+ @if exist $(RUBYW_INSTALL_NAME).rc del $(RUBYW_INSTALL_NAME).rc
+ @if exist $(LIBRUBY_SO).rc del $(LIBRUBY_SO).rc
+ @if exist $(PROGRAM) del $(PROGRAM)
+ @if exist $(WPROGRAM) del $(WPROGRAM)
+ @if exist $(LIBRUBY_SO) del $(LIBRUBY_SO)
+ @if exist $(LIBRUBY) del $(LIBRUBY)
+ @if exist ext\nul if not exist ext\* rmdir ext
+ @if exist miniruby$(EXEEXT) del miniruby$(EXEEXT)
realclean: distclean
- @rm -f parse.c
- @rm -f lex.c
+ @if exist parse.c del parse.c
+ @if exist lex.c del lex.c
test: miniruby$(EXEEXT)
@.\miniruby$(EXEEXT) $(srcdir)/rubytest.rb
@@ -188,16 +227,16 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(LIBRUBY_SO).rc: rbconfig.rb
# $(SHELL) ./config.status --recheck
- $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\)
+ $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
- $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\)
+ $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
- $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\)
+ $(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
- $(CC) $(CFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
+ $(CC) $(CFLAGS) -I. $(CPPFLAGS) -c -Tc$(<:\=/)
- $(RC) -I. -I$(<D) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $<
+ $(RC) -I. -I$(<D) $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:\=/)
$(YACC) $(YFLAGS) $(<:\=/)
@@ -278,3 +317,4 @@ time.obj: $(srcdir)/time.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdi
util.obj: $(srcdir)/util.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/util.h
variable.obj: $(srcdir)/variable.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/env.h $(srcdir)/node.h $(srcdir)/st.h
version.obj: $(srcdir)/version.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/version.h
+$(OBJS) $(MAINOBJ) $(WINMAINOBJ): $(srcdir)/win32/win32.h