Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. TESTDIR=../
  19. include $(TESTDIR)/Rules.mak
  20. CFLAGS+=-D_GNU_SOURCE -DNO_LONG_DOUBLE
  21. EXTRA_LIBS=-lm
  22. PERL=/usr/bin/perl
  23. TARGETS:=
  24. libm-tests:=
  25. libm-tests+= test-double test-idouble
  26. #libm-tests+= test-float test-ifloat
  27. #libm-tests+= test-ldouble test-ildouble
  28. libm-tests.o = $(addsuffix .o,$(libm-tests))
  29. libm-tests-generated = libm-test-ulps.h libm-test.c
  30. generated += $(libm-tests-generated) libm-test.stmp
  31. TARGETS += $(libm-tests) #$(libm-tests-generated)
  32. all: libm-test.c $(TARGETS)
  33. test-double: test-double.o
  34. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  35. -./$@
  36. test-idouble: test-idouble.o
  37. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  38. -./$@
  39. test-float: test-float.o
  40. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  41. -./$@
  42. test-ifloat: test-ifloat.o
  43. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  44. -./$@
  45. test-ldouble: test-ldouble.o
  46. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  47. -./$@
  48. test-ildouble: test-ildoubl.o
  49. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  50. -./$@
  51. test-float.o: libm-test.c
  52. test-ifloat.o: libm-test.c
  53. test-double.o: libm-test.c
  54. test-idouble.o: libm-test.c
  55. test-ldouble.o: libm-test.c
  56. test-ildoubl.o: libm-test.c
  57. ulps-file = $(firstword $(wildcard $(config-sysdirs:%=$(..)%/libm-test-ulps)))
  58. libm-test.c: $(ulps-file) libm-test.inc gen-libm-test.pl
  59. $(PERL) ./gen-libm-test.pl -u $< ./libm-test.inc -o "." 2>&1 > /dev/null
  60. clean:
  61. rm -f *.[oa] *~ core $(TARGETS) $(generated)