summaryrefslogtreecommitdiff
path: root/bcc32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-21 14:03:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-21 14:03:46 +0000
commite7ce523bb172c36b61cd5fc8d141a4488323bd84 (patch)
tree9def4bcac6871845573108cd38c51ead73dfc2c0 /bcc32
parent76e8a9e82870393e5cef137526e811a878404096 (diff)
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries. * configure.in (LIBPATHFLAG): switch template to specify library path. * configure.in (LINK_SO): command to link shared objects. * configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent files. * configure.in (EXPORT_PREFIX): prefix to exported symbols on Windows. * configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS): libraries, macros and headers used in common. * configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode excutable name. * Makefile.in (CFLAGS): append XCFLAGS. * Makefile.in (PREP): miscellaneous system dependent files. * Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb. * Makefile.in (fake.rb): CROSS_COMPILING keeps building platform. * Makefile.in (MAKEFILES): depend on *.in and config.status. * Makefile.in (parse.c): replace "y.tab.c" with actual name for byacc. * ext/extmk.rb, lib/mkmf.rb: integrated. * ext/extmk.rb: propagate MFLAGS. * ext/extmk.rb (extmake): make dummy Makefile to clean even if no Makefile is made. * lib/mkmf.rb (older): accept multiple file names and Time objects. * lib/mkmf.rb (xsystem): split and qoute. * lib/mkmf.rb (cpp_include): make include directives. * lib/mkmf.rb (try_func): try wheather specified function is available. * lib/mkmf.rb (install_files): default to site-install. * lib/mkmf.rb (checking_for): added. * lib/mkmf.rb (find_executable0): just find executable file with no message. * lib/mkmf.rb (create_header): output header file is variable. * lib/mkmf.rb (create_makefile): separate sections. * lib/mkmf.rb (init_mkmf): initialize global variables. * win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added. * bcc32/Makefile.sub (ARCH): fixed to i386. * win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not link EXTOBJS. * ext/dl/extconf.rb: use try_cpp to cross compile. * ext/dl/extconf.rb: not modify files in source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bcc32')
-rw-r--r--bcc32/Makefile.sub149
-rw-r--r--bcc32/configure.bat25
-rw-r--r--bcc32/setup.mak109
3 files changed, 176 insertions, 107 deletions
diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub
index e13cfc5..d9fb077 100644
--- a/bcc32/Makefile.sub
+++ b/bcc32/Makefile.sub
@@ -1,6 +1,8 @@
SHELL = $(COMSPEC)
#### Start of system configuration section. ####
+OS = bccwin32
+RT = $(OS)
## variables may be overridden by $(compile_dir)/Makefile
!ifndef srcdir
@@ -18,7 +20,7 @@ RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw)
RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME)w
!endif
!ifndef RUBY_SO_NAME
-RUBY_SO_NAME = rubybcc
+RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)17
!endif
!ifndef icondirs
!ifdef ICONDIRS
@@ -37,16 +39,27 @@ VPATH = $(srcdir):$(srcdir)/missing
!ifndef CC
CC = bcc32
!endif
+!ifndef CPP
+CPP = cpp32
+!endif
!ifndef RC
RC = brcc32
!endif
!ifndef YACC
YACC = byacc
!endif
+!ifndef AR
+AR = tlib
+!endif
+
PURIFY =
AUTOCONF = autoconf
-!if !defined(PROCESSOR_ARCHITECTURE) || "$(PROCESSOR_ARCHITECTURE)" == "x86"
+!if !defined(PROCESSOR_ARCHITECTURE)
+PROCESSOR_ARCHITECTURE = x86
+!endif
+MACHINE = $(PROCESSOR_ARCHITECTURE)
+!if "$(PROCESSOR_ARCHITECTURE)" == "x86"
!ifndef PROCESSOR_LEVEL
PROCESSOR_LEVEL = 5
!endif
@@ -55,7 +68,7 @@ PROCESSOR_LEVEL = 6
!endif
PROCESSOR_FLAG = -$(PROCESSOR_LEVEL)
CPU = i$(PROCESSOR_LEVEL)86
-ARCH = i$(PROCESSOR_LEVEL)86
+ARCH = i386
!else
CPU = $(PROCESSOR_ARCHITECTURE)
ARCH = $(PROCESSOR_ARCHITECTURE)
@@ -66,7 +79,6 @@ DEBUGFLAGS =
!ifndef OPTFLAGS
OPTFLAGS = -O
!endif
-OS = bccwin32
!ifndef prefix
prefix = /usr
@@ -75,44 +87,46 @@ prefix = /usr
DESTDIR = $(prefix)
!endif
!ifndef CFLAGS
-CFLAGS = -DNT=1 $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w-aus -w-par -w-pro
+CFLAGS = -q -DNT=1 $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w-
!endif
!ifndef CPPFLAGS
CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)missing -DLIBRUBY_SO=\"$(LIBRUBY_SO)\"
!endif
!ifndef LDFLAGS
-LDFLAGS = $(CFLAGS)
-!endif
-!ifndef XLDFLAGS
-XLDFLAGS =
+LDFLAGS = -S:$(STACK)
!endif
!ifndef RFLAGS
-RFLAGS = -r
+RFLAGS = $(iconinc)
!endif
!ifndef EXTLIBS
-EXTLIBS = # cw32.lib
+EXTLIBS =
!endif
-LIBS = $(EXTLIBS)
+LIBS = cw32.lib import32.lib ws2_32.lib $(EXTLIBS)
MISSING = acosh.obj crypt.obj win32.obj
!ifndef STACK
STACK = 0x2000000
!endif
-LDSHARED = ilink32.exe -S:$(STACK)
-LINK = $(LDSHARED) -Tpe C0X32.OBJ
-LINK_W = $(LDSHARED) -Tpe C0W32.OBJ
-LINK_SO = $(LDSHARED) -Tpd C0D32.OBJ
-LDOBJECTS = CW32.LIB IMPORT32.LIB $(MAINOBJ)
+XCFLAGS = -DRUBY_EXPORT
+
+ARFLAGS = /a
+LD = ilink32 -q -Gn
+LDSHARED = $(LD)
+XLDFLAGS = -Tpe c0x32.obj
+WLDFLAGS = -Tpe c0w32.obj
+DLDFLAGS = -Tpd c0d32.obj
+LIBRUBY_LDSHARED = $(LDSHARED)
+LIBRUBY_DLDFLAGS = -Gi $(DLDFLAGS) $(EXTLDFLAGS)
+LDOBJECTS = $(MAINOBJ)
-DLDFLAGS =
SOLIBS =
EXEEXT = .exe
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
RUBYDEF = $(RUBY_SO_NAME).def
-MINIRUBY=miniruby$(EXEEXT)
+MINIRUBY = .\miniruby$(EXEEXT)
ORGLIBPATH = $(LIB)
@@ -168,7 +182,7 @@ OBJS = array.obj \
all: miniruby$(EXEEXT) rbconfig.rb \
$(LIBRUBY) $(MISCLIBS)
- @.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb
+ @.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb $(EXTSTATIC) $(MAKE) -$(MFLAGS)$(MAKEFLAGS)
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
@@ -178,8 +192,8 @@ dll: $(LIBRUBY_SO)
config: config.h config.status
config.h: Makefile $(srcdir)bcc32/Makefile.sub
- @echo Creating config.h
- type > $@ &&|
+ @echo Creating $(@:.\=)
+ @type > $@ &&|
\#define HAVE_PROTOTYPES 1
\#define HAVE_STDARG_PROTOTYPES 1
/* \#define HAVE_ATTR_NORETURN 1 */
@@ -198,7 +212,7 @@ config.h: Makefile $(srcdir)bcc32/Makefile.sub
/* \#define HAVE_SYS_PARAM_H 1 */
/* \#define HAVE_SYS_WAIT_H 1 */
\#define HAVE_STRING_H 1
-/* \#define HAVE_UTIME_H 1 */
+\#define HAVE_UTIME_H 1
\#define HAVE_MEMORY_H 1
/* \#define HAVE_ST_BLKSIZE 1 */
\#define HAVE_ST_RDEV 1
@@ -262,9 +276,9 @@ config.h: Makefile $(srcdir)bcc32/Makefile.sub
\#define HAVE_STRTOUL 1
|
-config.status: Makefile $(srcdir)bcc32/Makefile.sub $(MINIRUBY)
- @echo Creating config.status
- @$(MINIRUBY) -pe "~/@CFLAGS@/||$$_.sub!(/'$(CFLAGS)'/, '$$(CFLAGS)')" > $@ &&|
+config.status: Makefile $(srcdir)bcc32/Makefile.sub
+ @echo Creating $@
+ @type > $@ &&|
# Generated automatically by Makefile.sub.
s,@SHELL@,$$(COMSPEC),;t t
s,@CFLAGS@,$(CFLAGS),;t t
@@ -272,7 +286,7 @@ s,@CPPFLAGS@,$(CPPFLAGS),;t t
s,@CXXFLAGS@,$(CXXFLAGS),;t t
s,@FFLAGS@,$(FFLAGS),;t t
s,@LDFLAGS@,$(LDFLAGS),;t t
-s,@LIBS@,,;t t
+s,@LIBS@,$(LIBS),;t t
s,@exec_prefix@,$${prefix},;t t
s,@prefix@,,;t t
s,@program_transform_name@,s,,,,;t t
@@ -307,7 +321,8 @@ s,@CC@,$(CC),;t t
s,@CPP@,cpp32,;t t
s,@YACC@,$(YACC),;t t
s,@RANLIB@,rem,;t t
-s,@AR@,tlib -nologo,;t t
+s,@AR@,$(AR),;t t
+s,@ARFLAGS@,$(ARFLAGS),;t t
s,@LN_S@,$(LN_S),;t t
s,@SET_MAKE@,$(SET_MAKE),;t t
s,@LIBOBJS@, acosh.obj crypt.obj win32.obj,;t t
@@ -316,19 +331,22 @@ s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
s,@EXEEXT@,.exe,;t t
s,@OBJEXT@,obj,;t t
s,@XLDFLAGS@,$(XLDFLAGS),;t t
-s,@DLDFLAGS@,$$(CFLAGS),;t t
+s,@DLDFLAGS@,$(DLDFLAGS),;t t
s,@STATIC@,$(STATIC),;t t
-s,@CCDLFLAGS@,-DIMPORT,;t t
-s,@LDSHARED@,ilink32 -S:$(STACK) -Tpd,;t t
+s,@CCDLFLAGS@,,;t t
+s,@LDSHARED@,$(LDSHARED),;t t
s,@DLEXT@,so,;t t
s,@DLEXT2@,dll,;t t
+s,@LIBEXT@,lib,;t t
s,@STRIP@,$(STRIP),;t t
s,@EXTSTATIC@,$(EXTSTATIC),;t t
s,@setup@,Setup,;t t
s,@MINIRUBY@,$(MINIRUBY),;t t
-s,@LIBRUBY_LDSHARED@,$(LIBRUBY_LDSHARED),;t t
-s,@LIBRUBY_DLDFLAGS@,$(LIBRUBY_DLDFLAGS),;t t
+s,@LIBRUBY_LDSHARED@,$$(LDSHARED),;t t
+s,@LIBRUBY_DLDFLAGS@,-Gi $$(DLDFLAGS),;t t
s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
+s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t
+s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t
s,@RUBY_SO_NAME@,$(RUBY_SO_NAME),;t t
s,@LIBRUBY_A@,lib$$(RUBY_INSTALL_NAME).lib,;t t
s,@LIBRUBY_SO@,$$(RUBY_SO_NAME).dll,;t t
@@ -340,6 +358,16 @@ s,@DLDLIBS@,$(DLDLIBS),;t t
s,@ENABLE_SHARED@,yes,;t t
s,@OUTFLAG@,-o,;t t
s,@CPPOUTFILE@,,;t t
+s,@LIBPATHFLAG@, -L%s,;t t
+s,@LIBARG@,%s.lib,;t t
+s,@LINK_SO@,$$(LDSHARED) $$(DLDFLAGS) $$(LIBPATH) $$(OBJS), $$@, nul, $$(LIBS) $$(LOCAL_LIBS), $$(DEFFILE), $$(RESFILE),;t t
+s,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c $$(<:/=\),;t t
+s,@COMPILE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -P -c $$(<:/=\),;t t
+s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: .%s.%s:,;t t
+s,@COMMON_LIBS@,m,;t t
+s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t
+s,@COMMON_HEADERS@,winsock2.h windows.h,;t t
+s,@EXPORT_PREFIX@,_,;t t
s,@arch@,$(ARCH)-$(OS),;t t
s,@sitearch@,$(ARCH)-$(OS),;t t
s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t
@@ -349,43 +377,33 @@ s,@srcdir@,$(srcdir),;t t
s,@top_srcdir@,$(srcdir),;t t
|
-#ext/extmk.rb: $(srcdir)ext/extmk.rb.in config.status
-# @echo Creating ext/extmk.rb
-# @.\miniruby$(EXEEXT) $(srcdir)ext/configsub.rb \
-# -srcdir=$(srcdir) \
-# -install_name=$(RUBY_INSTALL_NAME) \
-# -so_name=$(RUBY_SO_NAME) \
-# -output=$@ $(srcdir)ext/extmk.rb.in
-
-miniruby$(EXEEXT): $(OBJS) $(MAINOBJ) $(EXTOBJS)
- @echo $(EXTOBJS)
+miniruby$(EXEEXT): $(LIBRUBY_A) $(MAINOBJ) dmyext.obj
@echo $(LIBS)
- $(LINK) $(LDOBJECTS) $(EXTOBJS) $(OBJS) $(LIBS),$@
+ $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) dmyext.obj,$@,nul,$(LIBRUBY_A) $(LIBS)
$(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
- $(LINK) $(LDOBJECTS),$@,,$(LIBRUBYARG),,$(RUBY_INSTALL_NAME).res
+ $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ),$@,nul,$(LIBRUBYARG) $(LIBS),,$(RUBY_INSTALL_NAME).res
$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res
- $(LINK_W) $(LDOBJECTS) $(WINMAINOBJ),$@,,$(LIBRUBYARG),,$(RUBYW_INSTALL_NAME).res
+ $(LD) $(LDFLAGS) $(WLDFLAGS) $(MAINOBJ) $(WINMAINOBJ),$@,nul,$(LIBRUBYARG) $(LIBS),,$(RUBYW_INSTALL_NAME).res
-$(LIBRUBY_A): $(OBJS) dmyext.obj
+$(LIBRUBY_A): $(OBJS)
@-if exist $@ del $@
- tlib $@ /a @&&|
-$(OBJS) dmyext.obj
-|
-
-$(LIBRUBY): $(LIBRUBY_SO)
- implib $@ $(LIBRUBY_SO)
+ $(AR) $(ARFLAGS)$@ $(OBJS)
-$(LIBRUBY_SO): $(LIBRUBY_A) $(EXTOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
- $(LINK_SO) $(LDOBJECTS) $(EXTOBJS) $(LIBS),$@,,$(LIBRUBY_A),$(RUBYDEF), $(RUBY_SO_NAME).res
+# $(LIBRUBY): $(LIBRUBY_SO)
+# implib $@ $(LIBRUBY_SO)
+$(LIBRUBY_SO) $(LIBRUBY): $(LIBRUBY_A) dmyext.obj $(EXTOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
+ @echo $(EXTOBJS)
+ $(LIBRUBY_LDSHARED) $(LIBRUBY_DLDFLAGS) dmyext.obj,$(LIBRUBY_SO),nul,$(LIBRUBY_A) $(LIBS),$(RUBYDEF),$(RUBY_SO_NAME).res
$(RUBYDEF): $(LIBRUBY_A) miniruby$(EXEEXT)
- .\miniruby$(EXEEXT) $(srcdir)bcc32/mkexports.rb -output=$@ $(LIBRUBY_A)
+ $(MINIRUBY) $(srcdir)bcc32/mkexports.rb -output=$@ $(LIBRUBY_A)
install: rbconfig.rb
- .\miniruby$(EXEEXT) $(srcdir)instruby.rb $(DESTDIR)
+ $(MINIRUBY) $(srcdir)instruby.rb $(DESTDIR)
+ $(MINIRUBY) $(srcdir)ext/extmk.rb $(MAKE) -$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR) install
clean: clean-ext clean-local
@@ -402,7 +420,7 @@ clean-local:
@if exist *.il? del *.il?
clean-ext:
- @-.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb clean
+ @-$(MINIRUBY) $(srcdir)ext/extmk.rb $(MAKE) -$(MFLAGS)$(MAKEFLAGS) clean
distclean: distclean-ext distclean-local
@@ -425,7 +443,6 @@ distclean-local: clean-local
@if exist *.ilk del *.ilk
@if exist *.exp del *.exp
@if exist $(RUBYDEF) del $(RUBYDEF)
- @if exist pub.def del pub.def
@if exist $(RUBY_INSTALL_NAME).rc del $(RUBY_INSTALL_NAME).rc
@if exist $(RUBYW_INSTALL_NAME).rc del $(RUBYW_INSTALL_NAME).rc
@if exist $(RUBY_SO_NAME).rc del $(RUBY_SO_NAME).rc
@@ -437,26 +454,26 @@ distclean-local: clean-local
@if exist miniruby$(EXEEXT) del miniruby$(EXEEXT)
distclean-ext:
- @-.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb distclean
+ @-$(MINIRUBY) $(srcdir)ext/extmk.rb $(MAKE) -$(MFLAGS)$(MAKEFLAGS) distclean
realclean: distclean
@if exist parse.c del parse.c
@if exist lex.c del lex.c
test: miniruby$(EXEEXT)
- @.\miniruby$(EXEEXT) $(srcdir)rubytest.rb
+ @$(MINIRUBY) $(srcdir)rubytest.rb
rbconfig.rb: miniruby$(EXEEXT) config.status
- @.\miniruby$(EXEEXT) $(srcdir)mkconfig.rb -srcdir=$(srcdir) \
+ @$(MINIRUBY) $(srcdir)mkconfig.rb -srcdir=$(srcdir) \
-install_name=$(RUBY_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) rbconfig.rb
$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
- @.\miniruby$(EXEEXT) $(srcdir)win32/resource.rb \
+ @$(MINIRUBY) $(srcdir)win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) \
-rubyw_name=$(RUBYW_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) \
- . $(icondirs) $(srcdir)/win32
+ . $(icondirs) $(srcdir)win32
#config.status: $(srcdir)configure
# $(SHELL) .config.status --recheck
@@ -466,10 +483,10 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
.path.y = $(srcdir)
.c.obj:
- $(CC) $(CFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
+ $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
.rc.res:
- $(RC) -I. -I$(<D) $(iconinc) -I$(srcdir)win32 $(RFLAGS) -fo$@ $(<:/=\)
+ $(RC) $(RFLAGS) -I. -I$(<D) $(iconinc) -I$(srcdir)win32 $(RFLAGS) -fo$@ $(<:/=\)
.y.c:
$(YACC) $(YFLAGS) $(<:\=/)
diff --git a/bcc32/configure.bat b/bcc32/configure.bat
index 65b53a2..deb18d3 100644
--- a/bcc32/configure.bat
+++ b/bcc32/configure.bat
@@ -6,6 +6,27 @@
echo> ~tmp~.mak ####
echo>> ~tmp~.mak conf = %0
echo>> ~tmp~.mak $(conf:\=/): nul
-echo>> ~tmp~.mak @del ~tmp~.mak
-echo>> ~tmp~.mak make -Dbcc32dir="$(@D)" -f$(@D)/setup.mak %1
+echo>> ~tmp~.mak @del ~tmp~.mak
+echo>> ~tmp~.mak @-$(MAKE) -l$(MAKEFLAGS) -f $(@D)setup.mak \
+:loop
+if "%1" == "" goto :end
+if "%1" == "--srcdir" goto :srcdir
+if "%1" == "srcdir" goto :srcdir
+if "%1" == "--target" goto :target
+if "%1" == "target" goto :target
+ echo>> ~tmp~.mak "%1" \
+ shift
+goto :loop
+:srcdir
+ echo>> ~tmp~.mak "srcdir=%2" \
+ shift
+ shift
+goto :loop
+:target
+ echo>> ~tmp~.mak "%2" \
+ shift
+ shift
+goto :loop
+:end
+echo>> ~tmp~.mak bcc32dir="$(@D)"
make -s -f ~tmp~.mak
diff --git a/bcc32/setup.mak b/bcc32/setup.mak
index 6017ecc..27cf911 100644
--- a/bcc32/setup.mak
+++ b/bcc32/setup.mak
@@ -1,50 +1,81 @@
# -*- makefile -*-
-!if "$(bcc32dir)" == "bcc32/"
+!if "$(srcdir)" != ""
+bcc32dir = $(srcdir)bcc32/
+!elseif "$(bcc32dir)" == "bcc32/"
srcdir = ./
-!elseif "$(bcc32dir)" == "../bcc32/"
-srcdir = ../
+!elseif "$(bcc32dir:/bcc32/=)/bcc32/" == "$(bcc32dir)"
+srcdir = $(bcc32dir:/bcc32/=/)
!else
srcdir = $(bcc32dir)../
!endif
OS = bccwin32
+RT = $(OS)
+INCLUDE = !include
+APPEND = echo>>$(MAKEFILE)
+!ifdef MAKEFILE
+MAKE = $(MAKE) -f $(MAKEFILE)
+!else
+MAKEFILE = Makefile
+!endif
-all: ext makefile
-
-makefile: make_s make_e
-
-make_s:
- @if exist makefile @del makefile
- @echo ### makefile for ruby $(OS) ###> makefile
- @echo srcdir = $(srcdir:\=/)>> makefile
- @echo RUBY_INSTALL_NAME = ruby>> makefile
- @echo RUBY_SO_NAME = $(OS)_$$(RUBY_INSTALL_NAME)17>> makefile
-
-make_e:
- @echo !INCLUDE $$(srcdir)bcc32/makefile.sub>> makefile
- @echo type `make' to make ruby for bccwin32.
-
-ext:
- @if not exist $@\* mkdir $@
-
-pl3:
- @echo PROCESSOR_LEVEL = 3 >> makefile
-
-pl4:
- @echo PROCESSOR_LEVEL = 4 >> makefile
-
-pl5:
- @echo PROCESSOR_LEVEL = 5 >> makefile
-
-pl6:
- @echo PROCESSOR_LEVEL = 6 >> makefile
-
-3: ext make_s pl3 make_e
-
-4: ext make_s pl4 make_e
-
-5: ext make_s pl5 make_e
+all: Makefile
+Makefile: -prologue- -generic- -epilogue-
+i386-$(OS): -prologue- -i386- -epilogue-
+i486-$(OS): -prologue- -i486- -epilogue-
+i586-$(OS): -prologue- -i586- -epilogue-
+i686-$(OS): -prologue- -i686- -epilogue-
+alpha-$(OS): -prologue- -alpha- -epilogue-
+
+-prologue-: nul
+ @echo Creating $(MAKEFILE)
+ @type > $(MAKEFILE) &&|
+\#\#\# Makefile for ruby $(OS) \#\#\#
+srcdir = $(srcdir:\=/)
+|
+
+-generic-: nul
+!if defined(PROCESSOR_ARCHITECTURE) || defined(PROCESSOR_LEVEL)
+ @type >> $(MAKEFILE) &&|
+!if defined(PROCESSOR_ARCHITECTURE)
+ @$(APPEND) PROCESSOR_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
+!endif
+!if defined(PROCESSOR_LEVEL)
+ @$(APPEND) PROCESSOR_LEVEL = $(PROCESSOR_LEVEL)
+!endif
-6: ext make_s pl6 make_e
+|
+!endif
+-alpha-: nul
+ @$(APPEND) PROCESSOR_ARCHITECTURE = alpha
+-ix86-: nul
+ @$(APPEND) PROCESSOR_ARCHITECTURE = x86
+
+-i386-: -ix86-
+ @$(APPEND) PROCESSOR_LEVEL = 3
+-i486-: -ix86-
+ @$(APPEND) PROCESSOR_LEVEL = 4
+-i586-: -ix86-
+ @$(APPEND) PROCESSOR_LEVEL = 5
+-i686-: -ix86-
+ @$(APPEND) PROCESSOR_LEVEL = 6
+
+-epilogue-: nul
+ @type >> $(MAKEFILE) &&|
+
+\# OS = $(OS)
+\# RT = $(RT)
+\# RUBY_INSTALL_NAME = ruby
+\# RUBY_SO_NAME = $$(RT)-$$(RUBY_INSTALL_NAME)17
+\# prefix = /usr
+\# CFLAGS = -q $$(DEBUGFLAGS) $$(OPTFLAGS) $$(PROCESSOR_FLAG) -w-
+\# CPPFLAGS = -I. -I$$(srcdir) -I$$(srcdir)missing -DLIBRUBY_SO=\"$$(LIBRUBY_SO)\"
+\# STACK = 0x2000000
+\# LDFLAGS = -S:$$(STACK)
+\# RFLAGS = $$(iconinc)
+\# EXTLIBS = cw32.lib import32.lib user32.lib kernel32.lib
+$(INCLUDE) $$(srcdir)bcc32/Makefile.sub
+|
+ @echo type "`$(MAKE)'" to make ruby for $(OS).