]> git.saurik.com Git - wxWidgets.git/blame - src/expat/watcom/watmake.mif
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / src / expat / watcom / watmake.mif
CommitLineData
11a3e7b6
VZ
1######################################################################
2#
3# Open Watcom 1.5 multiplatform target makefile. This file is called
4# by main makefile.
5#
6# Author : Michael Greene, July 2006
7#
8# User selectable project options are set in buildopts.inc
9#
10######################################################################
11
12# include options set by main makefile
13!include watopts.tmp
14
15# include user selectable option
16!include buildopts.inc
17
18# project directories
19PROJ = $+ $(%cwd) $-
20RELDIR = $(PROJ)\release
21DEBDIR = $(PROJ)\debug
22SRCDIR = $(PROJ)\..\lib
23TSTDIR = $(PROJ)\..\tests
24XMLDIR = $(PROJ)\..\xmlwf
25
26CC = wcl386
27LD = wlink
28LB = wlib
29
30
31########################################
32#
33# ***** platform specific options *****
34#
35!ifeqi SYSPLATFORM os2
36SYSCOMP = os2
37SYSLINK = os2v2
38LINKFILE = expat.lnk
39COMINC = $(%watcom)\h;$(%watcom)\h\os2
40EXPATDLL = $(DLLNAME)
41EXT = .exe
42!else ifeqi SYSPLATFORM nt
43SYSCOMP = nt
44SYSLINK = nt
45LINKFILE = wexpat.lnk
46COMINC = $(%watcom)\h;$(%watcom)\h\nt
47EXPATDLL = $(DLLNAME)
48EXT = .exe
49NTLIB = LIB $(%watcom)\lib386\nt\kernel32.lib
50!else ifeqi SYSPLATFORM linux
51SYSCOMP = linux
52SYSLINK = linux
53COMINC = $(%watcom)\lh
54LINUXEXT = op noext
55#EXT = .elf
56!endif
57# ***** END platform specific options *****
58
59
60########################################
61#
62# ***** Release/Debug options *****
63#
64!ifndef DEBUG
65LD_OPTS = op el
66# -wcd to quiet warning 201 - might need to check
67C_COMMON = -d0 -wcd=201
68OPT = $(OPTIMIZATION)
69TARGDIR = $(RELDIR)
70!else
71LD_OPTS = d all op map,symf
72C_COMMON = $(DEBUGOPTS) -of
73# overrides optimization options set in buildopts.inc
74OPT = -od
75TARGDIR = $(DEBDIR)
76!endif
77# ***** END Release/Debug options *****
78
79
80# MULTITHREAD set in buildopts.inc
81!ifdef MULTITHREAD
82MT = -bm
83!endif
84
85# CLIBLNK set in buildopts.inc
86!ifdef CLIBLNK
87CLIBOPT = -br
88!endif
89
90INCLUDE = $(SRCDIR);$(TSTDIR);$(COMINC)
91
92EXTRA_C = $(C_COMMON) $(OPT) $(MT) $(CLIBOPT) $(MACHINE)
93COMMONC = -w4 -e25 -zq -bt=$(SYSCOMP) -mf
94
95CFLAGS = -i=$(INCLUDE) $(DEFS) $(COMMONC) $(EXTRA_C)
96LDFLAGS = $(LD_OPTS) op maxe=25
97LIBFLAGS = -b -c -n -p=512
98
99SRCS = $(SRCDIR)\xmlparse.c $(SRCDIR)\xmlrole.c $(SRCDIR)\xmltok.c
100OBJS = xmlparse.obj xmlrole.obj xmltok.obj
101
102XMLWFS = $(XMLDIR)\xmlwf.c $(XMLDIR)\xmlfile.c $(XMLDIR)\codepage.c &
103 $(XMLDIR)\readfilemap.c
104XMLWFO = xmlwf.obj xmlfile.obj codepage.obj readfilemap.obj
105
106TESTSRC = ..\tests\chardata.c ..\tests\minicheck.c ..\tests\runtests.c
107TESTOBJ = chardata.obj minicheck.obj runtests.obj
108
109
110#############################################################
111#
112# ***** Project target build procedures *****
113#
114#############################################################
115
116all: clean $(EXPATDLL) $(TARGLIB) xmlwf$(EXT) tests release .SYMBOLIC
117
118# dll is built only for OS/2-ECS and LINUX platforms
119#expat.dll: .ALWAYS
120$(DLLNAME): .ALWAYS
121 $(CC) -c $(CFLAGS) -bd $(SRCS)
122!ifeqi SYSPLATFORM os2
123 $(LD) NAME $* @expat.lnk $(LDFLAGS) FILE {$(OBJS)}
124!else
125 $(LD) NAME $* @wexpat.lnk $(LDFLAGS) FILE {$(OBJS)}
126!endif
127 $(LB) $(IMPORTLIB) +$*.dll
128
129# build static lib for platform
130$(TARGLIB): .ALWAYS
131 $(CC) -c $(CFLAGS) $(CLIBOPT) $(SRCS)
132 $(LB) $(LIBFLAGS) $*.lib $(OBJS)
133
134# build standalone XML parser
135xmlwf$(EXT):
136 $(CC) -c $(CFLAGS) $(CLIBOPT) $(XMLWFS)
137 $(LD) NAME $* SYS $(SYSLINK) $(LDFLAGS) $(LINUXEXT) LIB $(TARGLIB) $(NTLIB) FILE {$(XMLWFO)}
138
139# The following builds EXPAT test and example programs
140tests: runtests$(EXT) elements$(EXT) outline$(EXT) benchmark$(EXT) .SYMBOLIC
141
142runtests$(EXT): $(LINKLIB)
143 $(CC) -c $(CFLAGS) $(CLIBOPT) $(TESTSRC)
144 $(LD) NAME $* SYS $(SYSLINK) $(LDFLAGS) $(LINUXEXT) LIB $(TARGLIB) FILE {$(TESTOBJ)}
145
146elements$(EXT): $(LINKLIB)
147 $(CC) -c $(CFLAGS) $(CLIBOPT) ..\examples\elements.c
148 $(LD) NAME $* SYS $(SYSLINK) $(LDFLAGS) $(LINUXEXT) LIB $(TARGLIB) FILE $*.obj
149
150outline$(EXT): $(LINKLIB)
151 $(CC) -c $(CFLAGS) $(CLIBOPT) ..\examples\outline.c
152 $(LD) NAME $* SYS $(SYSLINK) $(LDFLAGS) $(LINUXEXT) LIB $(TARGLIB) FILE $*.obj
153
154benchmark$(EXT): $(LINKLIB)
155 $(CC) -c $(CFLAGS) $(CLIBOPT) ..\tests\benchmark\benchmark.c
156 $(LD) NAME $* SYS $(SYSLINK) $(LDFLAGS) $(LINUXEXT) LIB $(TARGLIB) FILE $*.obj
157
158# requires wget to download and unzip XML_TEST_SUITE
159xmlts.zip: .SYMBOLIC
160 $(WGET)wget --output-document=..\tests\xmlts.zip &
161 http://www.w3.org/XML/Test/xmlts20020606.zip
162 unzip -q ..\tests\xmlts.zip -d ..\tests
163
164
165#############################################################
166#
167# ***** Project make release directories procedures *****
168#
169#############################################################
170
171release: .SYMBOLIC
172TARGEXE = xmlwf$(EXT) runtests$(EXT) elements$(EXT) outline$(EXT) benchmark$(EXT)
173 @if not EXIST $(TARGDIR) -@mkdir $(TARGDIR)
174 @if not EXIST $(TARGDIR)\$(SYSPLATFORM) @%make mktargdir
175!ifneqi SYSPLATFORM linux
176 -@copy .\$(EXPATDLL) $(TARGDIR)\$(SYSPLATFORM)\dll
177!endif
178 @for %a in ($(TARGEXE)) do -@copy .\%a $(TARGDIR)\$(SYSPLATFORM)\bin
179 -@copy .\*.lib $(TARGDIR)\$(SYSPLATFORM)\lib
180 -@copy ..\lib\expat.h $(TARGDIR)\$(SYSPLATFORM)\include
181 -@copy ..\lib\expat_external.h $(TARGDIR)\$(SYSPLATFORM)\include
182
183mktargdir: .PROCEDURE
184 -@mkdir $(TARGDIR)\$(SYSPLATFORM)
185 -@mkdir $(TARGDIR)\$(SYSPLATFORM)\bin
186 -@mkdir $(TARGDIR)\$(SYSPLATFORM)\lib
187 -@mkdir $(TARGDIR)\$(SYSPLATFORM)\include
188!ifneqi SYSPLATFORM linux
189 -@mkdir $(TARGDIR)\$(SYSPLATFORM)\dll
190!endif
191
192#############################################################
193#
194# ***** Project clean procedures *****
195#
196#############################################################
197
198# cleanup build files
199clean: .SYMBOLIC
200CLEANEXTS = obj exe err lst map sym lib dll
201CLEANLINUX = xmlwf runtests elements outline benchmark
202 @for %a in ($(CLEANEXTS)) do -@rm *.%a
203 @for %a in ($(CLEANLINUX)) do -@rm %a*
204
205cleanall: clean .SYMBOLIC
206 @%write watclean.tmp RELDIR=$(RELDIR)
207 @%append watclean.tmp DEBDIR=$(DEBDIR)
208 @if EXIST $(RELDIR)\os2 @wmake -h -f watclean.mif os2
209 @if EXIST $(DEBDIR)\os2 @wmake -h -f watclean.mif os2d
210 @if EXIST $(RELDIR)\nt @wmake -h -f watclean.mif nt
211 @if EXIST $(DEBDIR)\nt @wmake -h -f watclean.mif ntd
212 @if EXIST $(RELDIR)\linux @wmake -h -f watclean.mif linux
213 @if EXIST $(DEBDIR)\linux @wmake -h -f watclean.mif linuxd
214 @if EXIST $(RELDIR) -@rd $(RELDIR)
215 @if EXIST $(DEBDIR) -@rd $(DEBDIR)
216 @if EXIST watclean.tmp -@rm watclean.tmp
217 @if EXIST watopts.tmp -@rm watopts.tmp
218 @cd ..\tests
219 @if EXIST xmlts.zip -@rm xmlts.zip
220 @echo Clean complete.
221
222
223