Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. include ../Rules.mak
  19. CFLAGS+=-D_GNU_SOURCE -DNO_LONG_DOUBLE
  20. EXTRA_LIBS=-lm
  21. PERL=/usr/bin/perl
  22. TARGETS:=
  23. libm-tests=libm-test.c
  24. libm-tests+= test-double test-idouble
  25. libm-tests+= diff
  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: $(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. rint: rint.c Makefile $(TESTDIR)/Rules.mak
  52. -@ echo "-------"
  53. -@ echo " "
  54. -@ echo "Compiling $@ vs uClibc: "
  55. -@ echo " "
  56. $(CC) $(CFLAGS) -c $< -o $@.o
  57. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  58. $(STRIPTOOL) -x -R .note -R .comment $@
  59. ./$@ > $@.out 2>&1
  60. -@ echo " "
  61. rint_glibc: rint.c Makefile $(TESTDIR)/Rules.mak
  62. -@ echo "-------"
  63. -@ echo " "
  64. -@ echo "Compiling $@ vs glibc: "
  65. -@ echo " "
  66. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  67. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  68. $(STRIPTOOL) -x -R .note -R .comment $@
  69. ./$@ > $@.out 2>&1
  70. -@ echo " "
  71. diff: rint_glibc rint
  72. -@ echo "-------"
  73. -@ echo " "
  74. -@ echo "Diffing output: "
  75. -@ echo " "
  76. -diff -u rint_glibc.out rint.out
  77. -@ echo " "
  78. test-float.o: libm-test.c
  79. test-ifloat.o: libm-test.c
  80. test-double.o: libm-test.c
  81. test-idouble.o: libm-test.c
  82. test-ldouble.o: libm-test.c
  83. test-ildoubl.o: libm-test.c
  84. ulps-file = $(firstword $(wildcard $(config-sysdirs:%=$(..)%/libm-test-ulps)))
  85. libm-test.c: $(ulps-file) libm-test.inc gen-libm-test.pl
  86. $(PERL) ./gen-libm-test.pl -u $< ./libm-test.inc -o "." 2>&1 > /dev/null
  87. clean:
  88. $(RM) *.[oa] *~ core $(TARGETS) $(generated) rint_glibc.out rint.out