Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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=libm-test.c
  25. libm-tests+= test-double test-idouble
  26. libm-tests+= diff
  27. #libm-tests+= test-float test-ifloat
  28. #libm-tests+= test-ldouble test-ildouble
  29. libm-tests.o = $(addsuffix .o,$(libm-tests))
  30. libm-tests-generated = libm-test-ulps.h libm-test.c
  31. generated += $(libm-tests-generated) libm-test.stmp
  32. TARGETS += $(libm-tests) #$(libm-tests-generated)
  33. all: $(TARGETS)
  34. test-double: test-double.o
  35. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  36. -./$@
  37. test-idouble: test-idouble.o
  38. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  39. -./$@
  40. test-float: test-float.o
  41. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  42. -./$@
  43. test-ifloat: test-ifloat.o
  44. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  45. -./$@
  46. test-ldouble: test-ldouble.o
  47. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  48. -./$@
  49. test-ildouble: test-ildoubl.o
  50. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  51. -./$@
  52. rint: rint.c Makefile $(TESTDIR)/Config $(TESTDIR)/Rules.mak
  53. -@ echo "-------"
  54. -@ echo " "
  55. -@ echo "Compiling vs uClibc: "
  56. -@ echo " "
  57. $(CC) $(CFLAGS) -c $< -o $@.o
  58. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  59. $(STRIPTOOL) -x -R .note -R .comment $@
  60. -./$@ > $@.out 2>&1
  61. -@ echo " "
  62. rint_glibc: rint.c Makefile $(TESTDIR)/Config $(TESTDIR)/Rules.mak
  63. -@ echo "-------"
  64. -@ echo " "
  65. -@ echo "Compiling vs glibc: "
  66. -@ echo " "
  67. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  68. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  69. $(STRIPTOOL) -x -R .note -R .comment $@
  70. -./$@ > $@.out 2>&1
  71. -@ echo " "
  72. diff: rint_glibc rint
  73. -@ echo "-------"
  74. -@ echo " "
  75. -@ echo "Diffing output: "
  76. -@ echo " "
  77. -diff -u rint_glibc.out rint.out
  78. -@ echo " "
  79. test-float.o: libm-test.c
  80. test-ifloat.o: libm-test.c
  81. test-double.o: libm-test.c
  82. test-idouble.o: libm-test.c
  83. test-ldouble.o: libm-test.c
  84. test-ildoubl.o: libm-test.c
  85. ulps-file = $(firstword $(wildcard $(config-sysdirs:%=$(..)%/libm-test-ulps)))
  86. libm-test.c: $(ulps-file) libm-test.inc gen-libm-test.pl
  87. $(PERL) ./gen-libm-test.pl -u $< ./libm-test.inc -o "." 2>&1 > /dev/null
  88. clean:
  89. $(RM) *.[oa] *~ core $(TARGETS) $(generated) rint_glibc.out rint.out