* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git] / bcc32 / setup.mak
blobe5b4ee8f4458da8c9dc412f86a309bebdb724b83
1 # -*- makefile -*-
3 !if "$(srcdir)" != ""
4 bcc32dir = $(srcdir)/bcc32
5 !elseif "$(bcc32dir)" == "bcc32/"
6 srcdir = .
7 !elseif "$(bcc32dir:/bcc32/=)/bcc32/" == "$(bcc32dir)"
8 srcdir = $(bcc32dir:/bcc32/=)
9 !else
10 srcdir = $(bcc32dir)/..
11 !endif
12 !ifndef prefix
13 prefix = /usr
14 !endif
15 OS = bccwin32
16 RT = $(OS)
17 BANG = !
18 APPEND = echo.>>$(MAKEFILE)
19 !ifdef MAKEFILE
20 MAKE = $(MAKE) -f $(MAKEFILE)
21 !else
22 MAKEFILE = Makefile
23 !endif
25 all: Makefile
26 Makefile: -prologue- -generic- -epilogue-
27 i386-$(OS): -prologue- -i386- -epilogue-
28 i486-$(OS): -prologue- -i486- -epilogue-
29 i586-$(OS): -prologue- -i586- -epilogue-
30 i686-$(OS): -prologue- -i686- -epilogue-
31 alpha-$(OS): -prologue- -alpha- -epilogue-
33 -prologue-: -basic-vars- -version- -system-vars-
35 -basic-vars-: nul
36 @echo Creating $(MAKEFILE)
37 @type > $(MAKEFILE) &&|
38 \#\#\# Makefile for ruby $(OS) \#\#\#
39 $(BANG)ifndef srcdir
40 srcdir = $(srcdir:\=/)
41 $(BANG)endif
42 $(BANG)ifndef prefix
43 prefix = $(prefix:\=/)
44 $(BANG)endif
45 $(BANG)if !defined(BASERUBY)
46 !if defined(BASERUBY)
47 BASERUBY = $(BASERUBY)
48 !endif
50 !if !defined(BASERUBY)
51 @for %I in (ruby.exe) do @echo BASERUBY = "%~$$PATH:I" >> $(MAKEFILE)
52 !endif
53 @type >> $(MAKEFILE) &&|
54 $(BANG)endif
56 !if exist(confargs.mk)
57 @type confargs.mk >> $(MAKEFILE)
58 @del confargs.mk
59 !endif
61 -system-vars-: -runtime- -bormm-
63 -bormm-: nul
64 @-ilink32 -q -Gn -x usebormm.lib > nul
65 @-if exist usebormm.tds $(APPEND) MEMLIB = usebormm.lib
66 @if exist usebormm.* del usebormm.*
68 -osname-: nul
69 @echo OS = >>$(MAKEFILE)
71 -runtime-: nul
72 type > conftest.c &&|
73 \#include <stdio.h>
74 int main(){printf("");return 0;}
76 bcc32 conftest.c cw32i.lib > nul
77 tdump conftest.exe < nul > conftest.i
78 grep "^Imports from CC" conftest.i > conftest.c
79 cpp32 -P- -DFile=\# -DImports=RTNAME -Dfrom== conftest.c > nul
80 $(MAKE) > nul -DBANG=$(BANG) -f &&|
81 -runtime-: nul
82 $(BANG)include conftest.i
83 RT = $$(RTNAME:.DLL=)
84 OS = $$(RT:CC32=)
85 -runtime-:
86 del conftest.*
87 $(BANG)if "$$(OS)" == "50"
88 echo OS = bccwin32 >> $(MAKEFILE)
89 $(BANG)else
90 echo OS = bccwin32_$$(OS) >> $(MAKEFILE)
91 $(BANG)endif
93 @echo RT = $$(OS) >> $(MAKEFILE)
95 -version-: nul
96 @cpp32 -I$(srcdir) -P- -o$(MAKEFILE) > nul &&|
97 \#define RUBY_REVISION 0
98 \#include "version.h"
99 MAJOR = RUBY_VERSION_MAJOR
100 MINOR = RUBY_VERSION_MINOR
101 TEENY = RUBY_VERSION_TEENY
103 BORLANDC = __BORLANDC__
105 @$(MAKE) > nul -DBANG=$(BANG) -f &&,
106 -version-: nul
107 $(BANG)include $(MAKEFILE)
108 $(BANG)include $(MAKEFILE).i
109 -version-:
110 @del $(MAKEFILE).i
111 @type >> $(MAKEFILE) &&|
112 MAJOR = $$(MAJOR)
113 MINOR = $$(MINOR)
114 TEENY = $$(TEENY)
115 BORLANDC = $$(BORLANDC)
119 -generic-: nul
120 !if defined(PROCESSOR_ARCHITECTURE) || defined(PROCESSOR_LEVEL)
121 @type >> $(MAKEFILE) &&|
122 !if defined(PROCESSOR_ARCHITECTURE)
123 $(BANG)ifndef PROCESSOR_ARCHITECTURE
124 PROCESSOR_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
125 $(BANG)endif
126 !endif
127 !if defined(PROCESSOR_LEVEL)
128 $(BANG)ifndef PROCESSOR_LEVEL
129 PROCESSOR_LEVEL = $(PROCESSOR_LEVEL)
130 $(BANG)endif
131 !endif
133 !endif
135 -alpha-: nul
136 @$(APPEND) !ifndef PROCESSOR_ARCHITECTURE
137 @$(APPEND) PROCESSOR_ARCHITECTURE = alpha
138 @$(APPEND) !endif
139 -ix86-: nul
140 @$(APPEND) !ifndef PROCESSOR_ARCHITECTURE
141 @$(APPEND) PROCESSOR_ARCHITECTURE = x86
142 @$(APPEND) !endif
144 -i386-: -ix86-
145 @$(APPEND) !ifndef PROCESSOR_LEVEL
146 @$(APPEND) PROCESSOR_LEVEL = 3
147 @$(APPEND) !endif
148 -i486-: -ix86-
149 @$(APPEND) !ifndef PROCESSOR_LEVEL
150 @$(APPEND) PROCESSOR_LEVEL = 4
151 @$(APPEND) !endif
152 -i586-: -ix86-
153 @$(APPEND) !ifndef PROCESSOR_LEVEL
154 @$(APPEND) PROCESSOR_LEVEL = 5
155 @$(APPEND) !endif
156 -i686-: -ix86-
157 @$(APPEND) !ifndef PROCESSOR_LEVEL
158 @$(APPEND) PROCESSOR_LEVEL = 6
159 @$(APPEND) !endif
161 -epilogue-: -encs-
163 -encs-: nul
164 @$(MAKE) -f $(srcdir)/win32/enc-setup.mak srcdir="$(srcdir)" MAKEFILE=$(MAKEFILE)
166 -epilogue-: nul
167 @type >> $(MAKEFILE) &&|
169 \# RUBY_INSTALL_NAME = ruby
170 \# RUBY_SO_NAME = $$(RT)-$$(RUBY_INSTALL_NAME)$$(MAJOR)$$(MINOR)
171 \# CFLAGS = -q $$(DEBUGFLAGS) $$(OPTFLAGS) $$(PROCESSOR_FLAG) -w- -wsus -wcpt -wdup -wext -wrng -wrpt -wzdi
172 \# CPPFLAGS = -I. -I$$(srcdir) -I$$(srcdir)/missing -DLIBRUBY_SO=\"$$(LIBRUBY_SO)\"
173 \# STACK = 0x2000000
174 \# LDFLAGS = -S:$$(STACK)
175 \# RFLAGS = $$(iconinc)
176 \# EXTLIBS = cw32.lib import32.lib user32.lib kernel32.lib
177 $(BANG)include $$(srcdir)/bcc32/Makefile.sub
179 @echo type "`$(MAKE)'" to make ruby for $(OS).