diff --git a/ChangeLog b/ChangeLog index be649733b7..1f603bfd9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Sat Jun 9 16:31:03 2001 Usaku Nakamura + + * ext/extmk.rb.in: 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. + Fri Jun 8 22:37:40 2001 Yukihiro Matsumoto * gc.c (Init_stack): avoid __builtin_frame_address(2) to retrieve diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in index 388edd0d66..a88a9ea7a3 100644 --- a/ext/extmk.rb.in +++ b/ext/extmk.rb.in @@ -68,7 +68,12 @@ if RUBY_PLATFORM == "m68k-human" else CFLAGS = "@CFLAGS@" end -LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@" +if /mswin32/ =~ RUBY_PLATFORM + OUTFLAG = '-Fe' +else + OUTFLAG = '-o ' +end +LINK = "@CC@ #{OUTFLAG}conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@" CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s %s conftest.c" $log = open('extmk.log', 'w') @@ -496,44 +501,49 @@ EOS install_rb(mfile, $srcdir) mfile.printf "\n" - unless /nmake/i =~ $make - unless /mswin32/ =~ RUBY_PLATFORM - src = '$<' + unless /mswin32/ =~ RUBY_PLATFORM + src = '$<' + copt = cxxopt = '' + else + if /nmake/i =~ $make + src = '$(<:\\=/)' else src = '$(subst /,\\\\,$<)' end + copt = '-Tc' + cxxopt = '-Tp' + end + unless /nmake/i =~ $make mfile.puts " .cc.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src} + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .cpp.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src} + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .cxx.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src} + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .C.@OBJEXT@: - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src} - + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src} .c.@OBJEXT@: - $(CC) $(CFLAGS) $(CPPFLAGS) -c #{src} + $(CC) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src} " else mfile.print " {$(srcdir)}.c{}.@OBJEXT@: - $(CC) -I. -I$( $@ + ext/extmk.rb: $(srcdir)/ext/extmk.rb.in config.status @echo Creating ext/extmk.rb @.\miniruby$(EXEEXT) $(srcdir)/ext/configsub.rb \ @@ -121,15 +131,15 @@ ext/extmk.rb: $(srcdir)/ext/extmk.rb.in config.status miniruby$(EXEEXT): $(OBJS) $(MAINOBJ) $(EXTOBJS) @echo $(EXTOBJS) @echo $(LIBS) - $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(OBJS) $(LIBS) -o $@ + $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(OBJS) $(LIBS) -Fe$@ $(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $*.res $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $*.res \ - -o $@ $(LIBRUBYARG) -link /STACK:$(STACK) + -Fe$@ $(LIBRUBYARG) -link -stack:$(STACK) -incremental:no $(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $*.res $(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(WINMAINOBJ) $*.res \ - -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) $(LIBRUBY_SO): $(LIBRUBY_A) $(EXTOBJS) $(RUBYDEF) $@.res - set LIB=./win32;$(ORGLIBPATH) + set LIB=.\win32;$(ORGLIBPATH) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBY_A) $@.res $(LIBS) \ - -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 +clean: + @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.tab.c y.output ruby.imp - @rm -f *.map *.pdb *.ilk *.exp $(RUBYDEF) - @rm -f $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(LIBRUBY_SO).rc - @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 y.tab.c del y.tab.c + @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 {$(srcdir)/missing}.c.obj: - $(CC) $(CFLAGS) -I. -I$(> $@ config.h config.status: $(srcdir)/win32/$$@.in - @copy $(srcdir:/=\)\win32\$@.in $@ > nul + @type $(srcdir:/=\)\win32\$@.in > $@ ext:; @if not exist $@\* mkdir $@