1 ###########################################################################
2 #
3 # Makefile for testing DOM code
4 #
5 ###########################################################################
7 ####### Sense whether we are on a DOS box or cross-compiling
8 ifdef ComSpec
9 BUILD=native
10 DOSSHELL=CMD_EXE
11 else
12 ifdef COMSPEC
13 BUILD=native
14 DOSSHELL=COMMAND_COM
15 else
16 BUILD=cross
17 endif
18 endif
23 ##########################################################################
24 # FILE SEPARATORS
25 # $(S) will be set to one of these
26 ##########################################################################
27 BSLASH := \\#
28 FSLASH := /
32 ##########################################################################
33 # CROSS / NATIVE SWITCHES
34 ##########################################################################
35 ifeq ($(BUILD),cross)
39 ##########################################################################
40 # CROSS COMPILER SETTINGS
41 ##########################################################################
43 CC = i686-pc-mingw32-gcc
44 CXX = i686-pc-mingw32-g++
45 AS = i686-pc-mingw32-as
46 AR = i686-pc-mingw32-ar
47 RANLIB = i686-pc-mingw32-ranlib
48 WINDRES = i686-pc-mingw32-windres
49 LD = i686-pc-mingw32-ld
50 DLLWRAP = i686-pc-mingw32-dllwrap
51 DLLTOOL = i686-pc-mingw32-dlltool
53 ####### file separator
54 S = $(FSLASH)
56 ####### escape character for echo
57 E = /
59 ####### file manipulation programs
60 CP = cp
61 RMDIR = rm -rf
62 MKDIR = mkdir
63 CPDIR = cp -rf
64 MSGFMT = msgfmt
65 RMREC = find ./inkscape -type f -name
66 RMREC1 = |xargs $(RM)
67 RMDIRREC = find ./inkscape -type d -name
68 RMDIRREC1 = |xargs $(RMDIR)
70 ####### Where is your GTK directory?
71 GTK=/target
73 ####### Same thing, file system style
74 GTKDOS=$(GTK)
76 DTG := $(shell date +%y%m%d.%H%M)
78 else
80 ##########################################################################
81 # NATIVE COMPILER SETTINGS
82 ##########################################################################
84 CC = mingw32-gcc
85 CXX = mingw32-g++
86 AS = as
87 AR = mingw32-ar
88 RANLIB = ranlib
89 WINDRES = windres
90 DLLWRAP = dllwrap
91 DLLTOOL = dlltool
93 ####### file separator
94 S = $(BSLASH)
96 ####### escape character for echo
97 E =
99 ####### file manipulation programs
100 CP = copy
102 ####### are we on WinNt and beyond?
103 ifeq ($(DOSSHELL),CMD_EXE)
104 RMDIR = rmdir /s /q
105 RM = del
106 else
107 RMDIR = deltree /y
108 RM = del
109 endif
110 MKDIR = mkdir
111 CPDIR = xcopy /e /i
112 RMREC = cd inkscape & $(RM) /s /q
113 RMREC1 = & cd ..
114 RMDIRREC = cd inkscape & $(RMDIR) /s
115 RMDIRREC1 = & cd ..
117 ####### Where is your GTK directory?
118 GTK=c:/devlibs
120 ####### Same thing, DOS style
121 GTKDOS=c:\devlibs
123 ####### Command to process .po files --> .mo
124 MSGFMT = $(GTKDOS)$(S)bin$(S)msgfmt
126 ####### change me!!
127 DTG := 20080515
129 endif
130 ##########################################################################
131 # END CROSS / NATIVE SWITCHES
132 ##########################################################################
137 INC = -I. -I..
138 CFLAGS = -Wall -g -DDOM_STANDALONE
139 LIBS = -lws2_32
141 DOMOBJ = \
142 cssreader.o \
143 domimpl.o \
144 domptr.o \
145 domstring.o \
146 lsimpl.o \
147 smilimpl.o \
148 uri.o \
149 xmlreader.o \
150 xpathimpl.o \
151 xpathparser.o \
152 xpathtoken.o \
153 io/base64stream.o \
154 io/domstream.o \
155 io/bufferstream.o \
156 io/gzipstream.o \
157 io/httpclient.o \
158 io/stringstream.o \
159 io/uristream.o \
160 io/socket.o \
161 odf/odfdocument.o \
162 svgimpl.o \
163 svgreader.o \
164 ucd.o \
165 util/thread.o \
166 util/ziptool.o
170 TESTOBJ = \
171 work/testdom.o \
172 work/testodf.o \
173 work/testsvg.o \
174 work/testuri.o \
175 work/testxpath.o \
176 work/testzip.o
178 OBJ = $(DOMOBJ)
180 all: testsvg.exe
182 tests: testdom.exe testhttp.exe \
183 testsvg.exe testuri.exe testxpath.exe testzip.exe
185 testdom.exe: libdom.a work/testdom.o
186 $(CXX) -o $@ work/testdom.o libdom.a $(LIBS)
188 testhttp.exe: libdom.a work/testhttp.o
189 $(CXX) -o $@ work/testhttp.o libdom.a $(LIBS)
191 testodf.exe: libdom.a work/testodf.o
192 $(CXX) -o $@ work/testodf.o libdom.a $(LIBS)
194 testsvg.exe: libdom.a work/testsvg.o
195 $(CXX) -o $@ work/testsvg.o libdom.a $(LIBS)
197 testuri.exe: libdom.a work/testuri.o
198 $(CXX) -o $@ work/testuri.o libdom.a $(LIBS)
200 testxpath.exe: libdom.a work/testxpath.o
201 $(CXX) -o $@ work/testxpath.o libdom.a $(LIBS)
203 testzip.exe: libdom.a work/testzip.o
204 $(CXX) -o $@ work/testzip.o libdom.a $(LIBS)
207 libdom.a: $(OBJ)
208 ar crv $@ $(OBJ)
211 .cpp.o:
212 $(CXX) $(CFLAGS) $(INC) -c -o $@ $<
214 clean:
215 $(foreach a, $(OBJ), $(shell $(RM) $(subst /,$(S), $(a))))
216 $(foreach a, $(TESTOBJ), $(shell $(RM) $(subst /,$(S), $(a))))
217 -$(RM) *.a
218 -$(RM) *.gch
219 -$(RM) testdom
220 -$(RM) testdom.exe
221 -$(RM) testsvg
222 -$(RM) testsvg.exe
223 -$(RM) testuri
224 -$(RM) testuri.exe
225 -$(RM) testxpath
226 -$(RM) testxpath.exe
227 -$(RM) testzip
228 -$(RM) testzip.exe
229 -$(RM) core.*
231 ###########################################################################
232 # E N D O F F I L E
233 ###########################################################################