summaryrefslogtreecommitdiff
path: root/src/Makefile.windows
blob: 046345a0f86160107bd3145d7896e86b86a59cd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Oniguruma Makefile for Windows

product_name = oniguruma

CPPFLAGS = 
CFLAGS = -O2 -nologo /W3
LDFLAGS =
LOADLIBES =
ARLIB = lib
ARLIB_FLAGS = -nologo
ARDLL = cl
ARDLL_FLAGS = -nologo -LD $(LINKFLAGS) -dll
LINKFLAGS = -link -incremental:no -pdb:none

INSTALL = install -c
CP      = copy
CC = cl
DEFS = -DHAVE_CONFIG_H -DNOT_RUBY -DEXPORT
RUBYDIR = ..

subdirs = 

libbase   = onig
libname   = $(libbase)_s.lib
dllname   = $(libbase).dll
dlllib    = $(libbase).lib

onigheaders  = oniguruma.h regint.h regparse.h regenc.h st.h
posixheaders = onigposix.h
headers      = $(posixheaders) $(onigheaders)

onigobjs     = reggnu.obj regerror.obj regparse.obj regext.obj regcomp.obj \
	       regexec.obj regenc.obj regsyntax.obj regtrav.obj \
	       regversion.obj st.obj onig_init.obj
posixobjs    = regposix.obj regposerr.obj
libobjs      = $(onigobjs) $(posixobjs)

jp_objs      =  euc_jp.obj sjis.obj
iso8859_objs =  iso8859_1.obj  iso8859_2.obj \
		iso8859_3.obj  iso8859_4.obj \
		iso8859_5.obj  iso8859_6.obj \
		iso8859_7.obj  iso8859_8.obj \
		iso8859_9.obj  iso8859_10.obj \
		iso8859_11.obj iso8859_13.obj \
		iso8859_14.obj iso8859_15.obj \
		iso8859_16.obj

encobjs = ascii.obj utf8.obj \
		unicode.obj \
		utf16_be.obj utf16_le.obj \
		utf32_be.obj utf32_le.obj \
		$(jp_objs) $(iso8859_objs) \
		euc_tw.obj euc_kr.obj big5.obj \
		gb18030.obj \
		koi8_r.obj  \
		cp1251.obj \
		euc_jp_prop.obj sjis_prop.obj \
		unicode_unfold_key.obj unicode_fold1_key.obj \
		unicode_fold2_key.obj unicode_fold3_key.obj	# koi8.obj

onigsources  = regerror.c regparse.c regext.c regcomp.c regexec.c regenc.c \
	       regsyntax.c regtrav.c regversion.c reggnu.c st.c
posixsources = regposix.c regposerr.c
libsources   = $(posixsources) $(onigsources)
rubysources  = $(onigsources)

patchfiles   = re.c.168.patch re.c.181.patch
distfiles    = README COPYING HISTORY \
		Makefile.in configure.in config.h.in configure \
		$(headers) $(libsources) $(patchfiles) \
		test.rb testconv.rb
testc        = testc
testp        = testp

makeargs = $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CC='$(CC)'

.SUFFIXES:
.SUFFIXES: .obj .c .h .ps .dvi .info .texinfo

.c.obj:
	$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) /I. /I.. /Fo$@ /c $<

# targets
default: all

setup:
	$(CP) ..\win32\config.h config.h
	$(CP) ..\win32\testc.c  testc.c


all: $(libname) $(dllname) 

$(libname): $(libobjs) $(encobjs)
	$(ARLIB) $(ARLIB_FLAGS) -out:$@ $(libobjs) $(encobjs)

$(dllname): $(libobjs) $(encobjs)
	$(ARDLL) $(libobjs) $(encobjs) -Fe$@ $(ARDLL_FLAGS)

regparse.obj:  regparse.c $(onigheaders) config.h st.h
regext.obj:    regext.c   $(onigheaders) config.h
regtrav.obj:   regtrav.c  $(onigheaders) config.h
regcomp.obj:   regcomp.c  $(onigheaders) config.h
regexec.obj:   regexec.c  regint.h regenc.h oniguruma.h config.h
reggnu.obj:    reggnu.c   regint.h regenc.h oniguruma.h config.h oniggnu.h
regerror.obj:  regerror.c regint.h regenc.h oniguruma.h config.h
regenc.obj:    regenc.c   regenc.h oniguruma.h config.h
regsyntax.obj: regsyntax.c regint.h regenc.h oniguruma.h config.h
regversion.obj: regversion.c oniguruma.h config.h
regposix.obj:  regposix.c $(posixheaders) oniguruma.h config.h
regposerr.obj: regposerr.c $(posixheaders) config.h
st.obj:        st.c regint.h oniguruma.h config.h st.h
onig_init.obj: onig_init.c oniguruma.h

ascii.obj:      ascii.c regenc.h config.h
unicode.obj:    unicode.c unicode_fold_data.c unicode_property_data.c regenc.h config.h
utf8.obj:       utf8.c regenc.h config.h
utf16_be.obj:   utf16_be.c regenc.h config.h
utf16_le.obj:   utf16_le.c regenc.h config.h
utf32_be.obj:   utf32_be.c regenc.h config.h
utf32_le.obj:   utf32_le.c regenc.h config.h
euc_jp.obj:     euc_jp.c regenc.h config.h
euc_tw.obj:     euc_tw.c regenc.h config.h
euc_kr.obj:     euc_kr.c regenc.h config.h
sjis.obj:       sjis.c regenc.h config.h
iso8859_1.obj:  iso8859_1.c regenc.h config.h
iso8859_2.obj:  iso8859_2.c regenc.h config.h
iso8859_3.obj:  iso8859_3.c regenc.h config.h
iso8859_4.obj:  iso8859_4.c regenc.h config.h
iso8859_5.obj:  iso8859_5.c regenc.h config.h
iso8859_6.obj:  iso8859_6.c regenc.h config.h
iso8859_7.obj:  iso8859_7.c regenc.h config.h
iso8859_8.obj:  iso8859_8.c regenc.h config.h
iso8859_9.obj:  iso8859_9.c regenc.h config.h
iso8859_10.obj: iso8859_10.c regenc.h config.h
iso8859_11.obj: iso8859_11.c regenc.h config.h
iso8859_13.obj: iso8859_13.c regenc.h config.h
iso8859_14.obj: iso8859_14.c regenc.h config.h
iso8859_15.obj: iso8859_15.c regenc.h config.h
iso8859_16.obj: iso8859_16.c regenc.h config.h
koi8.obj:       koi8.c   regenc.h config.h
koi8_r.obj:     koi8_r.c regenc.h config.h
cp1251.obj:     cp1251.c regenc.h config.h
big5.obj:       big5.c   regenc.h config.h
gb18030.obj:    gb18030.c regenc.h config.h
euc_jp_prop.obj:  euc_jp_prop.c regenc.h
sjis_prop.obj:    sjis_prop.c regenc.h
unicode_unfold_key.obj: unicode_unfold_key.c regenc.h config.h
unicode_fold1_key.obj: unicode_fold1_key.c regenc.h config.h
unicode_fold2_key.obj: unicode_fold2_key.c regenc.h config.h
unicode_fold3_key.obj: unicode_fold3_key.c regenc.h config.h

# C library test
ctest: $(testc)
	.\$(testc)

# POSIX C library test
ptest: $(testp)
	.\$(testp)

$(testc): $(testc).c $(libname)
	$(CC) -nologo /Fe:$(testc) -DONIG_EXTERN=extern $(testc).c $(libname)

$(testp): $(testc).c $(dlllib)
	$(CC) -nologo -DPOSIX_TEST /Fe:$(testp) $(testc).c $(dlllib)

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

$(testc)u: $(testc)u.c $(libname)
	$(CC) -nologo /Fe:$(testc)u -DONIG_EXTERN=extern $(testc)u.c $(libname)

clean:
	del *.obj *.lib *.exp *.dll $(testp).exe $(testc).exe $(testc).obj


samples: all
	$(CC) $(CFLAGS) -I. /Fe:simple  sample\simple.c  $(dlllib)
	$(CC) $(CFLAGS) -I. /Fe:posix   sample\posix.c   $(dlllib)
	$(CC) $(CFLAGS) -I. /Fe:names   sample\names.c   $(dlllib)
	$(CC) $(CFLAGS) -I. /Fe:listcap sample\listcap.c $(dlllib)
	$(CC) $(CFLAGS) -I. /Fe:sql     sample\sql.c     $(dlllib)
	$(CC) $(CFLAGS) -I. /Fe:encode  sample\encode.c  $(dlllib)
	$(CC) $(CFLAGS) -I. /Fe:syntax  sample\syntax.c  $(dlllib)