Pass -lm at end of linker command line
[berkeley-testfloat-3.git] / build / Linux-386-SSE2-GCC / Makefile
1
2 #=============================================================================
3 #
4 # This Makefile is part of TestFloat, Release 3, a package of programs for
5 # testing the correctness of floating-point arithmetic complying with the IEEE
6 # Standard for Floating-Point, by John R. Hauser.
7 #
8 # Copyright 2011, 2012, 2013, 2014 The Regents of the University of California
9 # (Regents). All Rights Reserved. Redistribution and use in source and
10 # binary forms, with or without modification, are permitted provided that the
11 # following conditions are met:
12 #
13 # Redistributions of source code must retain the above copyright notice,
14 # this list of conditions, and the following two paragraphs of disclaimer.
15 # Redistributions in binary form must reproduce the above copyright notice,
16 # this list of conditions, and the following two paragraphs of disclaimer in
17 # the documentation and/or other materials provided with the distribution.
18 # Neither the name of the Regents nor the names of its contributors may be
19 # used to endorse or promote products derived from this software without
20 # specific prior written permission.
21 #
22 # IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
23 # SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
24 # ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
25 # REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #
27 # REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
28 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 # PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
30 # HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
31 # MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
32 #
33 #=============================================================================
34
35 SOURCE_DIR = ../../source
36 SUBJ_SOURCE_DIR = $(SOURCE_DIR)/subj-C
37 SOFTFLOAT_DIR = ../../../berkeley-softfloat-3
38 SOFTFLOAT_INCLUDE_DIR = $(SOFTFLOAT_DIR)/source/include
39 PLATFORM = Linux-386-SSE2-GCC
40
41 SOFTFLOAT_H = \
42 $(SOFTFLOAT_INCLUDE_DIR)/softfloat_types.h \
43 $(SOFTFLOAT_INCLUDE_DIR)/softfloat.h
44 SOFTFLOAT_LIB = $(SOFTFLOAT_DIR)/build/$(PLATFORM)/softfloat$(LIB)
45
46 TESTFLOAT_OPTS = -DEXTFLOAT80 -DFLOAT128 -DLONG_DOUBLE_IS_EXTFLOAT80
47
48 DELETE = rm -f
49 C_INCLUDES = \
50 -I. -I$(SUBJ_SOURCE_DIR) -I$(SOURCE_DIR) -I$(SOFTFLOAT_INCLUDE_DIR)
51 COMPILE_C = \
52 gcc -c -Werror-implicit-function-declaration -msse2 -mfpmath=sse \
53 $(TESTFLOAT_OPTS) $(C_INCLUDES) -O2 -o $@
54 COMPILE_SLOWFLOAT_C = \
55 gcc -c -Werror-implicit-function-declaration $(TESTFLOAT_OPTS) \
56 $(C_INCLUDES) -O3 -o $@
57 MAKELIB = ar crs $@
58 LINK = gcc -o $@
59 LIBS = -lm
60
61 OBJ = .o
62 LIB = .a
63 EXE =
64
65 .PHONY: all
66 all: \
67 testsoftfloat$(EXE) \
68 timesoftfloat$(EXE) \
69 testfloat_gen$(EXE) \
70 testfloat_ver$(EXE) \
71 testfloat$(EXE) \
72
73 OBJS_GENCASES = \
74 genCases_ui32$(OBJ) \
75 genCases_ui64$(OBJ) \
76 genCases_i32$(OBJ) \
77 genCases_i64$(OBJ) \
78 genCases_f32$(OBJ) \
79 genCases_f64$(OBJ) \
80 genCases_extF80$(OBJ) \
81 genCases_f128$(OBJ) \
82
83 OBJS_WRITECASE = \
84 writeCase_a_ui32$(OBJ) \
85 writeCase_a_ui64$(OBJ) \
86 writeCase_a_f32$(OBJ) \
87 writeCase_ab_f32$(OBJ) \
88 writeCase_abc_f32$(OBJ) \
89 writeCase_a_f64$(OBJ) \
90 writeCase_ab_f64$(OBJ) \
91 writeCase_abc_f64$(OBJ) \
92 writeCase_a_extF80M$(OBJ) \
93 writeCase_ab_extF80M$(OBJ) \
94 writeCase_abc_extF80M$(OBJ) \
95 writeCase_a_f128M$(OBJ) \
96 writeCase_ab_f128M$(OBJ) \
97 writeCase_abc_f128M$(OBJ) \
98 writeCase_z_bool$(OBJ) \
99 writeCase_z_ui32$(OBJ) \
100 writeCase_z_ui64$(OBJ) \
101 writeCase_z_f32$(OBJ) \
102 writeCase_z_f64$(OBJ) \
103 writeCase_z_extF80M$(OBJ) \
104 writeCase_z_f128M$(OBJ) \
105
106 OBJS_TEST = \
107 test_a_ui32_z_f32$(OBJ) \
108 test_a_ui32_z_f64$(OBJ) \
109 test_a_ui32_z_extF80$(OBJ) \
110 test_a_ui32_z_f128$(OBJ) \
111 test_a_ui64_z_f32$(OBJ) \
112 test_a_ui64_z_f64$(OBJ) \
113 test_a_ui64_z_extF80$(OBJ) \
114 test_a_ui64_z_f128$(OBJ) \
115 test_a_i32_z_f32$(OBJ) \
116 test_a_i32_z_f64$(OBJ) \
117 test_a_i32_z_extF80$(OBJ) \
118 test_a_i32_z_f128$(OBJ) \
119 test_a_i64_z_f32$(OBJ) \
120 test_a_i64_z_f64$(OBJ) \
121 test_a_i64_z_extF80$(OBJ) \
122 test_a_i64_z_f128$(OBJ) \
123 test_a_f32_z_ui32_rx$(OBJ) \
124 test_a_f32_z_ui64_rx$(OBJ) \
125 test_a_f32_z_i32_rx$(OBJ) \
126 test_a_f32_z_i64_rx$(OBJ) \
127 test_a_f32_z_ui32_x$(OBJ) \
128 test_a_f32_z_ui64_x$(OBJ) \
129 test_a_f32_z_i32_x$(OBJ) \
130 test_a_f32_z_i64_x$(OBJ) \
131 test_a_f32_z_f64$(OBJ) \
132 test_a_f32_z_extF80$(OBJ) \
133 test_a_f32_z_f128$(OBJ) \
134 test_az_f32$(OBJ) \
135 test_az_f32_rx$(OBJ) \
136 test_abz_f32$(OBJ) \
137 test_abcz_f32$(OBJ) \
138 test_ab_f32_z_bool$(OBJ) \
139 test_a_f64_z_ui32_rx$(OBJ) \
140 test_a_f64_z_ui64_rx$(OBJ) \
141 test_a_f64_z_i32_rx$(OBJ) \
142 test_a_f64_z_i64_rx$(OBJ) \
143 test_a_f64_z_ui32_x$(OBJ) \
144 test_a_f64_z_ui64_x$(OBJ) \
145 test_a_f64_z_i32_x$(OBJ) \
146 test_a_f64_z_i64_x$(OBJ) \
147 test_a_f64_z_f32$(OBJ) \
148 test_a_f64_z_extF80$(OBJ) \
149 test_a_f64_z_f128$(OBJ) \
150 test_az_f64$(OBJ) \
151 test_az_f64_rx$(OBJ) \
152 test_abz_f64$(OBJ) \
153 test_abcz_f64$(OBJ) \
154 test_ab_f64_z_bool$(OBJ) \
155 test_a_extF80_z_ui32_rx$(OBJ) \
156 test_a_extF80_z_ui64_rx$(OBJ) \
157 test_a_extF80_z_i32_rx$(OBJ) \
158 test_a_extF80_z_i64_rx$(OBJ) \
159 test_a_extF80_z_ui32_x$(OBJ) \
160 test_a_extF80_z_ui64_x$(OBJ) \
161 test_a_extF80_z_i32_x$(OBJ) \
162 test_a_extF80_z_i64_x$(OBJ) \
163 test_a_extF80_z_f32$(OBJ) \
164 test_a_extF80_z_f64$(OBJ) \
165 test_a_extF80_z_f128$(OBJ) \
166 test_az_extF80$(OBJ) \
167 test_az_extF80_rx$(OBJ) \
168 test_abz_extF80$(OBJ) \
169 test_ab_extF80_z_bool$(OBJ) \
170 test_a_f128_z_ui32_rx$(OBJ) \
171 test_a_f128_z_ui64_rx$(OBJ) \
172 test_a_f128_z_i32_rx$(OBJ) \
173 test_a_f128_z_i64_rx$(OBJ) \
174 test_a_f128_z_ui32_x$(OBJ) \
175 test_a_f128_z_ui64_x$(OBJ) \
176 test_a_f128_z_i32_x$(OBJ) \
177 test_a_f128_z_i64_x$(OBJ) \
178 test_a_f128_z_f32$(OBJ) \
179 test_a_f128_z_f64$(OBJ) \
180 test_a_f128_z_extF80$(OBJ) \
181 test_az_f128$(OBJ) \
182 test_az_f128_rx$(OBJ) \
183 test_abz_f128$(OBJ) \
184 test_abcz_f128$(OBJ) \
185 test_ab_f128_z_bool$(OBJ) \
186
187 OBJS_LIB = \
188 uint128$(OBJ) \
189 fail$(OBJ) \
190 functions_common$(OBJ) \
191 functionInfos$(OBJ) \
192 standardFunctionInfos$(OBJ) \
193 random$(OBJ) \
194 genCases_common$(OBJ) \
195 $(OBJS_GENCASES) \
196 genCases_writeTestsTotal$(OBJ) \
197 verCases_common$(OBJ) \
198 verCases_writeFunctionName$(OBJ) \
199 readHex$(OBJ) \
200 writeHex$(OBJ) \
201 $(OBJS_WRITECASE) \
202 testLoops_common$(OBJ) \
203 $(OBJS_TEST) \
204
205 uint128$(OBJ): $(SOURCE_DIR)/uint128.h
206 fail$(OBJ): $(SOURCE_DIR)/fail.h
207 functions_common$(OBJ): $(SOFTFLOAT_H) $(SOURCE_DIR)/functions.h
208 functionInfos$(OBJ): $(SOURCE_DIR)/functions.h
209 standardFunctionInfos$(OBJ): $(SOURCE_DIR)/functions.h
210 random$(OBJ): $(SOURCE_DIR)/random.h
211 genCases_common$(OBJ): $(SOURCE_DIR)/fail.h $(SOURCE_DIR)/genCases.h
212 $(OBJS_GENCASES): \
213 $(SOURCE_DIR)/random.h $(SOFTFLOAT_H) $(SOURCE_DIR)/genCases.h
214 genCases_f128$(OBJ): $(SOURCE_DIR)/uint128.h
215 genCases_writeTestsTotal$(OBJ): $(SOURCE_DIR)/genCases.h
216 verCases_common$(OBJ): $(SOURCE_DIR)/verCases.h
217 verCases_writeFunctionName$(OBJ): $(SOURCE_DIR)/verCases.h
218 readHex$(OBJ): $(SOURCE_DIR)/readHex.h
219 writeHex$(OBJ): $(SOURCE_DIR)/uint128.h $(SOFTFLOAT_H) $(SOURCE_DIR)/writeHex.h
220 $(OBJS_WRITECASE): \
221 $(SOFTFLOAT_H) $(SOURCE_DIR)/writeHex.h $(SOURCE_DIR)/writeCase.h
222 testLoops_common$(OBJ): $(SOURCE_DIR)/testLoops.h
223 $(OBJS_TEST): \
224 $(SOURCE_DIR)/uint128.h $(SOFTFLOAT_H) $(SOURCE_DIR)/genCases.h \
225 $(SOURCE_DIR)/verCases.h $(SOURCE_DIR)/writeCase.h $(SOURCE_DIR)/testLoops.h
226 $(OBJS_LIB): %$(OBJ): platform.h $(SOURCE_DIR)/%.c
227 $(COMPILE_C) $(SOURCE_DIR)/$*.c
228 testfloat$(LIB): $(OBJS_LIB)
229 $(MAKELIB) $^
230
231 OBJS_TESTSOFTFLOAT = slowfloat$(OBJ) testsoftfloat$(OBJ)
232
233 slowfloat$(OBJ): \
234 platform.h $(SOURCE_DIR)/uint128.h $(SOFTFLOAT_H) \
235 $(SOURCE_DIR)/slowfloat.h $(SOURCE_DIR)/slowfloat.c
236 $(COMPILE_SLOWFLOAT_C) $(SOURCE_DIR)/slowfloat.c
237 testsoftfloat$(OBJ): \
238 platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
239 $(SOURCE_DIR)/slowfloat.h $(SOURCE_DIR)/functions.h \
240 $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/verCases.h $(SOURCE_DIR)/writeCase.h \
241 $(SOURCE_DIR)/testLoops.h $(SOURCE_DIR)/testsoftfloat.c
242 $(COMPILE_C) $(SOURCE_DIR)/testsoftfloat.c
243
244 testsoftfloat$(EXE): $(OBJS_TESTSOFTFLOAT) testfloat$(LIB) $(SOFTFLOAT_LIB)
245 $(LINK) $^ $(LIBS)
246
247 OBJS_TIMESOFTFLOAT = timesoftfloat$(OBJ)
248
249 timesoftfloat$(OBJ): \
250 platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
251 $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/timesoftfloat.c
252 $(COMPILE_C) $(SOURCE_DIR)/timesoftfloat.c
253
254 timesoftfloat$(EXE): $(OBJS_TIMESOFTFLOAT) testfloat$(LIB) $(SOFTFLOAT_LIB)
255 $(LINK) $^ $(LIBS)
256
257 OBJS_TESTFLOAT_GEN = genLoops$(OBJ) testfloat_gen$(OBJ)
258
259 genLoops$(OBJ): \
260 platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
261 $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/writeHex.h $(SOURCE_DIR)/genLoops.h \
262 $(SOURCE_DIR)/genLoops.c
263 $(COMPILE_C) $(SOURCE_DIR)/genLoops.c
264 testfloat_gen$(OBJ): \
265 $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) $(SOURCE_DIR)/functions.h \
266 $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/genLoops.h \
267 $(SOURCE_DIR)/testfloat_gen.c
268 $(COMPILE_C) $(SOURCE_DIR)/testfloat_gen.c
269
270 testfloat_gen$(EXE): $(OBJS_TESTFLOAT_GEN) testfloat$(LIB) $(SOFTFLOAT_LIB)
271 $(LINK) $^ $(LIBS)
272
273 OBJS_TESTFLOAT_VER = verLoops$(OBJ) testfloat_ver$(OBJ)
274
275 verLoops$(OBJ): \
276 platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
277 $(SOURCE_DIR)/readHex.h $(SOURCE_DIR)/verCases.h $(SOURCE_DIR)/writeCase.h \
278 $(SOURCE_DIR)/verLoops.h $(SOURCE_DIR)/verLoops.c
279 $(COMPILE_C) $(SOURCE_DIR)/verLoops.c
280 testfloat_ver$(OBJ): \
281 platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
282 $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/verCases.h \
283 $(SOURCE_DIR)/writeCase.h $(SOURCE_DIR)/verLoops.h \
284 $(SOURCE_DIR)/testfloat_ver.c
285 $(COMPILE_C) $(SOURCE_DIR)/testfloat_ver.c
286
287 testfloat_ver$(EXE): $(OBJS_TESTFLOAT_VER) testfloat$(LIB) $(SOFTFLOAT_LIB)
288 $(LINK) $^ $(LIBS)
289
290 OBJS_TESTFLOAT = subjfloat$(OBJ) subjfloat_functions$(OBJ) testfloat$(OBJ)
291
292 subjfloat$(OBJ): \
293 platform.h $(SOFTFLOAT_H) $(SUBJ_SOURCE_DIR)/subjfloat_config.h \
294 $(SOURCE_DIR)/subjfloat.h $(SUBJ_SOURCE_DIR)/subjfloat.c
295 $(COMPILE_C) $(SUBJ_SOURCE_DIR)/subjfloat.c
296 subjfloat_functions$(OBJ): \
297 platform.h $(SUBJ_SOURCE_DIR)/subjfloat_config.h $(SOURCE_DIR)/subjfloat.h \
298 $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/subjfloat_functions.c
299 $(COMPILE_C) $(SOURCE_DIR)/subjfloat_functions.c
300 testfloat$(OBJ): \
301 platform.h $(SOURCE_DIR)/uint128.h $(SOURCE_DIR)/fail.h $(SOFTFLOAT_H) \
302 $(SUBJ_SOURCE_DIR)/subjfloat_config.h $(SOURCE_DIR)/subjfloat.h \
303 $(SOURCE_DIR)/functions.h $(SOURCE_DIR)/genCases.h $(SOURCE_DIR)/verCases.h \
304 $(SOURCE_DIR)/testLoops.h $(SOURCE_DIR)/testfloat.c
305 $(COMPILE_C) $(SOURCE_DIR)/testfloat.c
306
307 testfloat$(EXE): $(OBJS_TESTFLOAT) testfloat$(LIB) $(SOFTFLOAT_LIB)
308 $(LINK) $^ $(LIBS)
309
310 .PHONY: clean
311 clean:
312 $(DELETE) $(OBJS_LIB) testfloat$(LIB)
313 $(DELETE) $(OBJS_TESTSOFTFLOAT) testsoftfloat$(EXE)
314 $(DELETE) $(OBJS_TIMESOFTFLOAT) timesoftfloat$(EXE)
315 $(DELETE) $(OBJS_TESTFLOAT_GEN) testfloat_gen$(EXE)
316 $(DELETE) $(OBJS_TESTFLOAT_VER) testfloat_ver$(EXE)
317 $(DELETE) $(OBJS_TESTFLOAT) testfloat$(EXE)
318