mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 21:44:30 +02:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
53a2b14909
commit
a5c0e5a382
5 changed files with 146 additions and 79 deletions
|
@ -18,6 +18,13 @@ RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
|
|||
!ifndef RUBY_SO_NAME
|
||||
RUBY_SO_NAME = rubymw
|
||||
!endif
|
||||
!if !defined(icondirs) && defined(ICONDIRS)
|
||||
icondirs=$(ICONDIRS)
|
||||
!endif
|
||||
!if defined(icondirs)
|
||||
icondirs=$(icondirs:\=/)
|
||||
iconinc=-I$(icondirs)
|
||||
!endif
|
||||
###############
|
||||
|
||||
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)\"
|
||||
LDFLAGS = $(CFLAGS) -Fm
|
||||
XLDFLAGS =
|
||||
#EXTLIBS =
|
||||
|
@ -102,7 +109,7 @@ OBJS = array.obj \
|
|||
|
||||
all: miniruby$(EXEEXT) rbconfig.rb ext/extmk.rb \
|
||||
$(LIBRUBY) $(MISCLIBS)
|
||||
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/$$@.in
|
||||
@type $(srcdir:/=\)\win32\$@.in > $@
|
||||
|
||||
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$(<D) $(CPPFLAGS) -c $(<:/=\)
|
||||
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
{$(srcdir)/win32}.c.obj:
|
||||
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\)
|
||||
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
{$(srcdir)}.c.obj:
|
||||
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\)
|
||||
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
|
||||
$(CC) $(CFLAGS) -I. $(CPPFLAGS) -c -Tc$(<:\=/)
|
||||
|
||||
.rc.res:
|
||||
$(RC) -I. -I$(<D) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $<
|
||||
$(RC) -I. -I$(<D) $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:\=/)
|
||||
|
||||
{$(srcdir)}.y.c:
|
||||
$(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
|
||||
|
|
|
@ -22,6 +22,6 @@ Makefile:
|
|||
@echo !INCLUDE $$(srcdir)/win32/Makefile.sub>> $@
|
||||
|
||||
config.h config.status: $(srcdir)/win32/$$@.in
|
||||
@copy $(srcdir:/=\)\win32\$@.in $@ > nul
|
||||
@type $(srcdir:/=\)\win32\$@.in > $@
|
||||
|
||||
ext:; @if not exist $@\* mkdir $@
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue