OSDN Git Service

Rework the math library tests per the glibc math test code, with
[uclinux-h8/uClibc.git] / test / math / Makefile
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2000,2001 Erik Andersen <andersen@uclibc.org>
4 #
5 # This program is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Library General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option) any
8 # later version.
9 #
10 # This program is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
13 # details.
14 #
15 # You should have received a copy of the GNU Library General Public License
16 # along with this program; if not, write to the Free Software Foundation, Inc.,
17 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19
20
21 TESTDIR=../
22 include $(TESTDIR)/Rules.mak
23 CFLAGS+=-D_GNU_SOURCE -DNO_LONG_DOUBLE
24 EXTRA_LIBS=-lm
25 PERL=/usr/bin/perl
26
27 TARGETS:=
28 libm-tests:=
29 libm-tests+= test-double test-idouble
30 #libm-tests+= test-float test-ifloat
31 #libm-tests+= test-ldouble test-ildouble
32 libm-tests.o = $(addsuffix .o,$(libm-tests))
33
34 libm-tests-generated = libm-test-ulps.h libm-test.c
35 generated += $(libm-tests-generated) libm-test.stmp
36 TARGETS += $(libm-tests) #$(libm-tests-generated)
37
38 all: libm-test.c $(TARGETS)
39         
40 test-double: test-double.o
41         $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
42         -./$@
43 test-idouble: test-idouble.o
44         $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
45         -./$@
46 test-float: test-float.o
47         $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
48         -./$@
49 test-ifloat: test-ifloat.o
50         $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
51         -./$@
52 test-ldouble: test-ldouble.o
53         $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
54         -./$@
55 test-ildouble: test-ildoubl.o
56         $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
57         -./$@
58
59 test-float.o: libm-test.c
60 test-ifloat.o: libm-test.c 
61 test-double.o: libm-test.c
62 test-idouble.o: libm-test.c
63 test-ldouble.o: libm-test.c
64 test-ildoubl.o: libm-test.c
65
66 ulps-file = $(firstword $(wildcard $(config-sysdirs:%=$(..)%/libm-test-ulps)))
67
68 libm-test.c: $(ulps-file) libm-test.inc gen-libm-test.pl
69         $(PERL) ./gen-libm-test.pl -u $< ./libm-test.inc -o "." 2>&1 > /dev/null
70
71 clean:
72         rm -f *.[oa] *~ core $(TARGETS) $(generated)
73
74