Skip to content

Commit be8e92f

Browse files
committed
Win32: Rewrite makefiles
* Use separate build directories for x86 and x64. (Issue #67) - MSVC: build_x86 and build_x64 - MinGW: build_i686, build_x86-64, etc. * Add "test", "utest" and "pytest" targets. * Change include directory. Now it is not needed to copy config.h and test.c.
1 parent 5010181 commit be8e92f

File tree

3 files changed

+311
-263
lines changed

3 files changed

+311
-263
lines changed

build_nmake.cmd

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
@setlocal enabledelayedexpansion
2-
copy /Y "%~dp0win32\config.h" "%~dp0config.h"
32
nmake -f "%~dp0win32\Makefile" %*

win32/Makefile

+162-133
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,18 @@ USE_LTCG = 1
99
#DEFFILE = onigmo.def
1010

1111

12+
# Set ARCH. "x64" or "x86".
13+
!ifndef ARCH
14+
!if ("$(CPU)"=="AMD64" && !DEFINED(386)) || "$(TARGET_CPU)"=="x64" || DEFINED(AMD64) || "$(PLATFORM)"=="x64" || "$(PLATFORM)"=="X64"
15+
ARCH = x64
16+
!else
17+
ARCH = x86
18+
!endif
19+
!endif
20+
21+
1222
CPPFLAGS =
13-
CFLAGS = -O2 -nologo /W3
23+
CFLAGS = -O2 -nologo -W3
1424
LDFLAGS =
1525
LOADLIBES =
1626
ARLIB = lib
@@ -21,14 +31,30 @@ LINKFLAGS = -link -incremental:no -pdb:none
2131

2232
INSTALL = install -c
2333
CP = copy
34+
RMDIR = rd /s/q
2435
CC = cl
2536
RC = rc
26-
DEFS = -DHAVE_CONFIG_H -DNOT_RUBY -DEXPORT
37+
DEFS = -DHAVE_CONFIG_H -DEXPORT
2738
RUBYDIR = ..
39+
40+
!if "$(ARCH)"=="x86"
41+
PYTHON = py -3.4-32
42+
!else
2843
PYTHON = py
44+
!endif
2945

30-
# Command string to get the version of cl.exe
31-
_MSC_VER = [for /f %i in ('cmd /c "(echo _MSC_VER>mscver.c) && ($(CC) /EP mscver.c 2>nul) && del mscver.c"') do @exit %i]
46+
WORKDIR = build_$(ARCH)
47+
48+
# Get the version of cl.exe.
49+
# 1. Write the version to a work file (mscver$(_NMAKE_VER).~).
50+
!if ![(echo _MSC_VER>mscver$(_NMAKE_VER).c) && \
51+
(for /f %I in ('"$(CC) /EP mscver$(_NMAKE_VER).c 2>nul"') do @echo _MSC_VER=%I> mscver$(_NMAKE_VER).~)]
52+
# 2. Include it.
53+
!include mscver$(_NMAKE_VER).~
54+
# 3. Clean up.
55+
!if [del mscver$(_NMAKE_VER).~ mscver$(_NMAKE_VER).c]
56+
!endif
57+
!endif
3258

3359
!if DEFINED(USE_LTCG) && $(USE_LTCG)
3460
# Use LTCG (Link Time Code Generation).
@@ -42,48 +68,53 @@ ARDLL_FLAGS = $(ARDLL_FLAGS) -LTCG
4268

4369
!ifdef DEFFILE
4470
# Use a .def file to export APIs.
45-
CFLAGS = $(CFLAGS) /DONIG_EXTERN=extern
71+
CFLAGS = $(CFLAGS) -DONIG_EXTERN=extern
4672
ARDLL_FLAGS = $(ARDLL_FLAGS) -def:$(DEFFILE)
4773
!endif
4874

4975
subdirs =
5076

5177
libbase = onigmo
52-
libname = $(libbase)_s.lib
53-
dllname = $(libbase).dll
54-
dlllib = $(libbase).lib
78+
libname = $(WORKDIR)\$(libbase)_s.lib
79+
dllname = $(WORKDIR)\$(libbase).dll
80+
dlllib = $(WORKDIR)\$(libbase).lib
5581

5682
onigheaders = onigmo.h regint.h regparse.h regenc.h st.h
5783
posixheaders = onigmoposix.h
5884
headers = $(posixheaders) $(onigheaders)
5985

60-
onigobjs = reggnu.obj regerror.obj regparse.obj regext.obj regcomp.obj \
61-
regexec.obj regenc.obj regsyntax.obj regtrav.obj \
62-
regversion.obj st.obj
63-
posixobjs = regposix.obj regposerr.obj
64-
libobjs = $(onigobjs) $(posixobjs)
65-
66-
jp_objs = $(encdir)\euc_jp.obj $(encdir)\shift_jis.obj $(encdir)\windows_31j.obj
67-
iso_8859_objs = $(encdir)\iso_8859_1.obj $(encdir)\iso_8859_2.obj \
68-
$(encdir)\iso_8859_3.obj $(encdir)\iso_8859_4.obj \
69-
$(encdir)\iso_8859_5.obj $(encdir)\iso_8859_6.obj \
70-
$(encdir)\iso_8859_7.obj $(encdir)\iso_8859_8.obj \
71-
$(encdir)\iso_8859_9.obj $(encdir)\iso_8859_10.obj \
72-
$(encdir)\iso_8859_11.obj $(encdir)\iso_8859_13.obj \
73-
$(encdir)\iso_8859_14.obj $(encdir)\iso_8859_15.obj \
74-
$(encdir)\iso_8859_16.obj
75-
76-
encobjs = $(encdir)\ascii.obj $(encdir)\utf_8.obj \
77-
$(encdir)\unicode.obj \
78-
$(encdir)\utf_16be.obj $(encdir)\utf_16le.obj \
79-
$(encdir)\utf_32be.obj $(encdir)\utf_32le.obj \
86+
onigobjs = $(WORKDIR)\reggnu.obj $(WORKDIR)\regerror.obj \
87+
$(WORKDIR)\regparse.obj $(WORKDIR)\regext.obj \
88+
$(WORKDIR)\regcomp.obj $(WORKDIR)\regexec.obj \
89+
$(WORKDIR)\regenc.obj $(WORKDIR)\regsyntax.obj \
90+
$(WORKDIR)\regtrav.obj $(WORKDIR)\regversion.obj \
91+
$(WORKDIR)\st.obj
92+
posixobjs = $(WORKDIR)\regposix.obj $(WORKDIR)\regposerr.obj
93+
libobjs = $(onigobjs) $(posixobjs)
94+
95+
jp_objs = $(WORKDIR)\euc_jp.obj $(WORKDIR)\shift_jis.obj \
96+
$(WORKDIR)\windows_31j.obj
97+
98+
iso_8859_objs = $(WORKDIR)\iso_8859_1.obj $(WORKDIR)\iso_8859_2.obj \
99+
$(WORKDIR)\iso_8859_3.obj $(WORKDIR)\iso_8859_4.obj \
100+
$(WORKDIR)\iso_8859_5.obj $(WORKDIR)\iso_8859_6.obj \
101+
$(WORKDIR)\iso_8859_7.obj $(WORKDIR)\iso_8859_8.obj \
102+
$(WORKDIR)\iso_8859_9.obj $(WORKDIR)\iso_8859_10.obj \
103+
$(WORKDIR)\iso_8859_11.obj $(WORKDIR)\iso_8859_13.obj \
104+
$(WORKDIR)\iso_8859_14.obj $(WORKDIR)\iso_8859_15.obj \
105+
$(WORKDIR)\iso_8859_16.obj
106+
107+
encobjs = $(WORKDIR)\ascii.obj $(WORKDIR)\utf_8.obj \
108+
$(WORKDIR)\unicode.obj \
109+
$(WORKDIR)\utf_16be.obj $(WORKDIR)\utf_16le.obj \
110+
$(WORKDIR)\utf_32be.obj $(WORKDIR)\utf_32le.obj \
80111
$(jp_objs) $(iso_8859_objs) \
81-
$(encdir)\euc_tw.obj $(encdir)\euc_kr.obj $(encdir)\big5.obj \
82-
$(encdir)\gb18030.obj \
83-
$(encdir)\koi8_r.obj \
84-
$(encdir)\windows_1251.obj # $(encdir)\koi8.obj
112+
$(WORKDIR)\euc_tw.obj $(WORKDIR)\euc_kr.obj $(WORKDIR)\big5.obj \
113+
$(WORKDIR)\gb18030.obj \
114+
$(WORKDIR)\koi8_r.obj \
115+
$(WORKDIR)\windows_1251.obj # $(WORKDIR)\koi8.obj
85116

86-
resobj = win32\onigmo.res
117+
resobj = $(WORKDIR)\onigmo.res
87118

88119
onigsources = regerror.c regparse.c regext.c regcomp.c regexec.c regenc.c \
89120
regsyntax.c regtrav.c regversion.c reggnu.c st.c
@@ -106,143 +137,141 @@ makeargs = $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CC='$(CC)'
106137
.SUFFIXES: .obj .c .h .ps .dvi .info .texinfo .res .rc
107138

108139
!ifdef NOBatch
109-
.c.obj:
110-
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) /I. /I.. /I$(encdir)\unicode /Fo$@ /c $<
140+
.c{$(WORKDIR)\}.obj:
141+
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) /Iwin32 /I. /I.. /I$(encdir)\unicode /Fo$@ /c $<
111142
!else
112143
# batch-mode inference rules
113-
.c.obj::
114-
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) /I. /Fo.\ /c $<
115-
{$(encdir)\}.c{$(encdir)\}.obj::
116-
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) /I. /I.. /I$(encdir)\unicode /Fo$(encdir)\ /c $<
144+
.c{$(WORKDIR)\}.obj::
145+
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) /Iwin32 /I. /Fo$(WORKDIR)\ /c $<
146+
{$(encdir)\}.c{$(WORKDIR)\}.obj::
147+
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) /Iwin32 /I. /I.. /I$(encdir)\unicode /Fo$(WORKDIR)\ /c $<
117148
!endif
118149

119-
.rc.res:
150+
{win32\}.rc{$(WORKDIR)}.res:
120151
$(RC) /Fo$@ $<
121152

122153
# targets
123154
default: all
124155

125156
setup:
126-
$(CP) win32\config.h config.h
127-
$(CP) win32\testc.c testc.c
128157

129158

130159
all: $(libname) $(dllname)
131160

132-
$(libname): $(libobjs) $(encobjs)
161+
$(libname): $(WORKDIR) $(libobjs) $(encobjs)
133162
$(ARLIB) $(ARLIB_FLAGS) -out:$@ $(libobjs) $(encobjs)
134163

135-
$(dllname): $(libobjs) $(encobjs) $(resobj) $(DEFFILE)
164+
$(dllname): $(WORKDIR) $(libobjs) $(encobjs) $(resobj) $(DEFFILE)
136165
$(ARDLL) $(libobjs) $(encobjs) $(resobj) -Fe$@ $(ARDLL_FLAGS)
137166

138-
regparse.obj: regparse.c $(onigheaders) config.h st.h
139-
regext.obj: regext.c $(onigheaders) config.h
140-
regtrav.obj: regtrav.c $(onigheaders) config.h
141-
regcomp.obj: regcomp.c $(onigheaders) config.h
142-
regexec.obj: regexec.c regint.h regenc.h onigmo.h config.h
143-
reggnu.obj: reggnu.c regint.h regenc.h onigmo.h config.h onigmognu.h
144-
regerror.obj: regerror.c regint.h regenc.h onigmo.h config.h
145-
regenc.obj: regenc.c regint.h regenc.h onigmo.h config.h
146-
regsyntax.obj: regsyntax.c regint.h regenc.h onigmo.h config.h
147-
regversion.obj: regversion.c onigmo.h config.h
148-
regposix.obj: regposix.c $(posixheaders) onigmo.h config.h
149-
regposerr.obj: regposerr.c $(posixheaders) config.h
150-
st.obj: st.c regint.h onigmo.h config.h st.h
151-
152-
$(encdir)\ascii.obj: $(encdir)\ascii.c regenc.h config.h
153-
$(encdir)\unicode.obj: $(encdir)\unicode.c regint.h regenc.h config.h $(encdir)\unicode\casefold.h $(encdir)\unicode\name2ctype.h
154-
$(encdir)\utf_8.obj: $(encdir)\utf_8.c regenc.h config.h
155-
$(encdir)\utf_16be.obj: $(encdir)\utf_16be.c regenc.h config.h
156-
$(encdir)\utf_16le.obj: $(encdir)\utf_16le.c regenc.h config.h
157-
$(encdir)\utf_32be.obj: $(encdir)\utf_32be.c regenc.h config.h
158-
$(encdir)\utf_32le.obj: $(encdir)\utf_32le.c regenc.h config.h
159-
$(encdir)\euc_jp.obj: $(encdir)\euc_jp.c regenc.h config.h $(encdir)\jis\props.h
160-
$(encdir)\euc_tw.obj: $(encdir)\euc_tw.c regenc.h config.h
161-
$(encdir)\euc_kr.obj: $(encdir)\euc_kr.c regenc.h config.h
162-
$(encdir)\shift_jis.obj: $(encdir)\shift_jis.c regenc.h config.h $(encdir)\jis\props.h
163-
$(encdir)\windows_31j.obj: $(encdir)\windows_31j.c $(encdir)\shift_jis.c regenc.h config.h $(encdir)\jis\props.h
164-
$(encdir)\iso_8859_1.obj: $(encdir)\iso_8859_1.c regenc.h config.h
165-
$(encdir)\iso_8859_2.obj: $(encdir)\iso_8859_2.c regenc.h config.h
166-
$(encdir)\iso_8859_3.obj: $(encdir)\iso_8859_3.c regenc.h config.h
167-
$(encdir)\iso_8859_4.obj: $(encdir)\iso_8859_4.c regenc.h config.h
168-
$(encdir)\iso_8859_5.obj: $(encdir)\iso_8859_5.c regenc.h config.h
169-
$(encdir)\iso_8859_6.obj: $(encdir)\iso_8859_6.c regenc.h config.h
170-
$(encdir)\iso_8859_7.obj: $(encdir)\iso_8859_7.c regenc.h config.h
171-
$(encdir)\iso_8859_8.obj: $(encdir)\iso_8859_8.c regenc.h config.h
172-
$(encdir)\iso_8859_9.obj: $(encdir)\iso_8859_9.c regenc.h config.h
173-
$(encdir)\iso_8859_10.obj: $(encdir)\iso_8859_10.c regenc.h config.h
174-
$(encdir)\iso_8859_11.obj: $(encdir)\iso_8859_11.c regenc.h config.h
175-
$(encdir)\iso_8859_13.obj: $(encdir)\iso_8859_13.c regenc.h config.h
176-
$(encdir)\iso_8859_14.obj: $(encdir)\iso_8859_14.c regenc.h config.h
177-
$(encdir)\iso_8859_15.obj: $(encdir)\iso_8859_15.c regenc.h config.h
178-
$(encdir)\iso_8859_16.obj: $(encdir)\iso_8859_16.c regenc.h config.h
179-
$(encdir)\koi8.obj: $(encdir)\koi8.c regenc.h config.h
180-
$(encdir)\koi8_r.obj: $(encdir)\koi8_r.c regenc.h config.h
181-
$(encdir)\windows_1251.obj: $(encdir)\windows_1251.c regenc.h config.h
182-
$(encdir)\big5.obj: $(encdir)\big5.c regenc.h config.h
183-
$(encdir)\gb18030.obj: $(encdir)\gb18030.c regenc.h config.h
184-
185-
win32\onigmo.res: win32\onigmo.rc onigmo.h
186-
167+
$(WORKDIR):
168+
-mkdir $(WORKDIR)
169+
170+
$(WORKDIR)\regparse.obj: regparse.c $(onigheaders) win32\config.h st.h
171+
$(WORKDIR)\regext.obj: regext.c $(onigheaders) win32\config.h
172+
$(WORKDIR)\regtrav.obj: regtrav.c $(onigheaders) win32\config.h
173+
$(WORKDIR)\regcomp.obj: regcomp.c $(onigheaders) win32\config.h
174+
$(WORKDIR)\regexec.obj: regexec.c regint.h regenc.h onigmo.h win32\config.h
175+
$(WORKDIR)\reggnu.obj: reggnu.c regint.h regenc.h onigmo.h win32\config.h onigmognu.h
176+
$(WORKDIR)\regerror.obj: regerror.c regint.h regenc.h onigmo.h win32\config.h
177+
$(WORKDIR)\regenc.obj: regenc.c regint.h regenc.h onigmo.h win32\config.h
178+
$(WORKDIR)\regsyntax.obj: regsyntax.c regint.h regenc.h onigmo.h win32\config.h
179+
$(WORKDIR)\regversion.obj: regversion.c onigmo.h win32\config.h
180+
$(WORKDIR)\regposix.obj: regposix.c $(posixheaders) onigmo.h win32\config.h
181+
$(WORKDIR)\regposerr.obj: regposerr.c $(posixheaders) win32\config.h
182+
$(WORKDIR)\st.obj: st.c regint.h onigmo.h win32\config.h st.h
183+
184+
$(WORKDIR)\ascii.obj: $(encdir)\ascii.c regenc.h win32\config.h
185+
$(WORKDIR)\unicode.obj: $(encdir)\unicode.c regint.h regenc.h win32\config.h $(encdir)\unicode\casefold.h $(encdir)\unicode\name2ctype.h
186+
$(WORKDIR)\utf_8.obj: $(encdir)\utf_8.c regenc.h win32\config.h
187+
$(WORKDIR)\utf_16be.obj: $(encdir)\utf_16be.c regenc.h win32\config.h
188+
$(WORKDIR)\utf_16le.obj: $(encdir)\utf_16le.c regenc.h win32\config.h
189+
$(WORKDIR)\utf_32be.obj: $(encdir)\utf_32be.c regenc.h win32\config.h
190+
$(WORKDIR)\utf_32le.obj: $(encdir)\utf_32le.c regenc.h win32\config.h
191+
$(WORKDIR)\euc_jp.obj: $(encdir)\euc_jp.c regenc.h win32\config.h $(encdir)\jis\props.h
192+
$(WORKDIR)\euc_tw.obj: $(encdir)\euc_tw.c regenc.h win32\config.h
193+
$(WORKDIR)\euc_kr.obj: $(encdir)\euc_kr.c regenc.h win32\config.h
194+
$(WORKDIR)\shift_jis.obj: $(encdir)\shift_jis.c regenc.h win32\config.h $(encdir)\jis\props.h
195+
$(WORKDIR)\windows_31j.obj: $(encdir)\windows_31j.c $(encdir)\shift_jis.c regenc.h win32\config.h $(encdir)\jis\props.h
196+
$(WORKDIR)\iso_8859_1.obj: $(encdir)\iso_8859_1.c regenc.h win32\config.h
197+
$(WORKDIR)\iso_8859_2.obj: $(encdir)\iso_8859_2.c regenc.h win32\config.h
198+
$(WORKDIR)\iso_8859_3.obj: $(encdir)\iso_8859_3.c regenc.h win32\config.h
199+
$(WORKDIR)\iso_8859_4.obj: $(encdir)\iso_8859_4.c regenc.h win32\config.h
200+
$(WORKDIR)\iso_8859_5.obj: $(encdir)\iso_8859_5.c regenc.h win32\config.h
201+
$(WORKDIR)\iso_8859_6.obj: $(encdir)\iso_8859_6.c regenc.h win32\config.h
202+
$(WORKDIR)\iso_8859_7.obj: $(encdir)\iso_8859_7.c regenc.h win32\config.h
203+
$(WORKDIR)\iso_8859_8.obj: $(encdir)\iso_8859_8.c regenc.h win32\config.h
204+
$(WORKDIR)\iso_8859_9.obj: $(encdir)\iso_8859_9.c regenc.h win32\config.h
205+
$(WORKDIR)\iso_8859_10.obj: $(encdir)\iso_8859_10.c regenc.h win32\config.h
206+
$(WORKDIR)\iso_8859_11.obj: $(encdir)\iso_8859_11.c regenc.h win32\config.h
207+
$(WORKDIR)\iso_8859_13.obj: $(encdir)\iso_8859_13.c regenc.h win32\config.h
208+
$(WORKDIR)\iso_8859_14.obj: $(encdir)\iso_8859_14.c regenc.h win32\config.h
209+
$(WORKDIR)\iso_8859_15.obj: $(encdir)\iso_8859_15.c regenc.h win32\config.h
210+
$(WORKDIR)\iso_8859_16.obj: $(encdir)\iso_8859_16.c regenc.h win32\config.h
211+
$(WORKDIR)\koi8.obj: $(encdir)\koi8.c regenc.h win32\config.h
212+
$(WORKDIR)\koi8_r.obj: $(encdir)\koi8_r.c regenc.h win32\config.h
213+
$(WORKDIR)\windows_1251.obj: $(encdir)\windows_1251.c regenc.h win32\config.h
214+
$(WORKDIR)\big5.obj: $(encdir)\big5.c regenc.h win32\config.h
215+
$(WORKDIR)\gb18030.obj: $(encdir)\gb18030.c regenc.h win32\config.h
216+
217+
$(WORKDIR)\onigmo.res: win32\onigmo.rc onigmo.h
218+
219+
220+
# Tests
221+
test: all ctest utest ptest pytest
187222

188223
# Ruby test
189224
rtest:
190225
$(RUBYDIR)\win32\ruby -w -Ke test.rb
191226

192227
# C library test
193-
ctest: $(testc)
194-
.\$(testc)
228+
ctest: $(WORKDIR)\$(testc).exe
229+
$(WORKDIR)\$(testc)
230+
231+
# C library test (Unicode)
232+
utest: $(WORKDIR)\$(testcu).exe
233+
$(WORKDIR)\$(testcu)
195234

196235
# POSIX C library test
197-
ptest: $(testp)
198-
.\$(testp)
236+
ptest: $(WORKDIR)\$(testp).exe
237+
$(WORKDIR)\$(testp)
238+
239+
# Python test
240+
pytest:
241+
cd $(WORKDIR) && $(PYTHON) ..\testpy.py EUC-JP
242+
cd $(WORKDIR) && $(PYTHON) ..\testpy.py SJIS
243+
cd $(WORKDIR) && $(PYTHON) ..\testpy.py UTF-8
244+
cd $(WORKDIR) && $(PYTHON) ..\testpy.py UTF-16LE
245+
cd $(WORKDIR) && $(PYTHON) ..\testpy.py UTF-16BE
246+
cd $(WORKDIR) && $(PYTHON) ..\testpy.py UTF-32LE
247+
cd $(WORKDIR) && $(PYTHON) ..\testpy.py UTF-32BE
248+
199249

200-
$(testc): $(testc).c $(libname)
201-
$(CC) -nologo -o $(testc) -DONIG_EXTERN=extern $(testc).c $(libname)
250+
$(WORKDIR)\$(testc).exe: win32\$(testc).c $(libname)
251+
$(CC) -nologo -Fe$(WORKDIR)\$(testc) -DONIG_EXTERN=extern win32\$(testc).c -I. $(libname)
202252

203-
$(testp): $(testc).c $(dlllib)
204-
$(CC) -nologo -DPOSIX_TEST -o $(testp) $(testc).c $(dlllib)
253+
$(WORKDIR)\$(testp).exe: win32\$(testc).c $(dlllib)
254+
$(CC) -nologo -DPOSIX_TEST -Fe$(WORKDIR)\$(testp) win32\$(testc).c -I. $(dlllib)
205255

206256
#$(testc)u.c: test.rb testconvu.rb
207257
# ruby -Ke testconvu.rb test.rb > $@
208258

209-
$(testcu): $(testcu).c $(libname)
210-
$(CC) -nologo -o $(testcu) -DONIG_EXTERN=extern $(testcu).c $(libname)
259+
$(WORKDIR)\$(testcu).exe: $(testcu).c $(libname)
260+
$(CC) -nologo -Fe$(WORKDIR)\$(testcu) -DONIG_EXTERN=extern $(testcu).c -I. $(libname)
211261

212262
$(libbase).def: win32\makedef.py onigmo.h regenc.h onigmognu.h onigmoposix.h
213263
$(PYTHON) win32\makedef.py > $@
214264

215265
clean:
216-
-del *.obj $(encdir)\*.obj *.lib *.exp *.dll $(testp).exe $(testc).exe $(testcu).exe win32\*.res
217-
218-
219-
# backup file suffix
220-
SORIG = ruby_orig
221-
222-
# ruby 1.9 source update
223-
19:
224-
$(CP) regerror.c $(RUBYDIR)
225-
$(CP) regparse.c $(RUBYDIR)
226-
$(CP) regcomp.c $(RUBYDIR)
227-
$(CP) regexec.c $(RUBYDIR)
228-
$(CP) regenc.c $(RUBYDIR)
229-
$(CP) regint.h $(RUBYDIR)
230-
$(CP) regparse.h $(RUBYDIR)
231-
$(CP) regenc.h $(RUBYDIR)
232-
$(CP) onigmo.h $(RUBYDIR)
233-
$(CP) enc\ascii.c $(RUBYDIR)
234-
$(CP) enc\utf_8.c $(RUBYDIR)
235-
$(CP) enc\euc_jp.c $(RUBYDIR)
236-
$(CP) enc\shift_jis.c $(RUBYDIR)
237-
$(CP) enc\unicode.c $(RUBYDIR)
266+
-$(RMDIR) $(WORKDIR)
238267

239268

240269
samples: all
241-
$(CC) $(CFLAGS) -I. -o simple sample\simple.c $(dlllib)
242-
$(CC) $(CFLAGS) -I. -o posix sample\posix.c $(dlllib)
243-
$(CC) $(CFLAGS) -I. -o names sample\names.c $(dlllib)
244-
$(CC) $(CFLAGS) -I. -o listcap sample\listcap.c $(dlllib)
245-
$(CC) $(CFLAGS) -I. -o sql sample\sql.c $(dlllib)
246-
$(CC) $(CFLAGS) -I. -o encode sample\encode.c $(dlllib)
247-
$(CC) $(CFLAGS) -I. -o syntax sample\syntax.c $(dlllib)
248-
$(CC) $(CFLAGS) -I. -o crnl sample\crnl.c $(dlllib)
270+
cd $(WORKDIR) && $(CC) $(CFLAGS) -I.. -Fesimple ..\sample\simple.c ..\$(dlllib)
271+
cd $(WORKDIR) && $(CC) $(CFLAGS) -I.. -Feposix ..\sample\posix.c ..\$(dlllib)
272+
cd $(WORKDIR) && $(CC) $(CFLAGS) -I.. -Fenames ..\sample\names.c ..\$(dlllib)
273+
cd $(WORKDIR) && $(CC) $(CFLAGS) -I.. -Felistcap ..\sample\listcap.c ..\$(dlllib)
274+
cd $(WORKDIR) && $(CC) $(CFLAGS) -I.. -Fesql ..\sample\sql.c ..\$(dlllib)
275+
cd $(WORKDIR) && $(CC) $(CFLAGS) -I.. -Feencode ..\sample\encode.c ..\$(dlllib)
276+
cd $(WORKDIR) && $(CC) $(CFLAGS) -I.. -Fesyntax ..\sample\syntax.c ..\$(dlllib)
277+
cd $(WORKDIR) && $(CC) $(CFLAGS) -I.. -Fecrnl ..\sample\crnl.c ..\$(dlllib)

0 commit comments

Comments
 (0)