Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # Makefile for uClibc's math library
  2. #
  3. # Copyright (C) 2001 by Lineo, inc.
  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. # Derived in part from the Linux-8086 C library, the GNU C Library, and several
  20. # other sundry sources. Files within this library are copyright by their
  21. # respective copyright holders.
  22. TOPDIR=../../
  23. include $(TOPDIR)Rules.mak
  24. LIBM=../libm.a
  25. TARGET_CC= $(TOPDIR)/extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
  26. CSRC=acoshl.c asinhl.c asinl.c atanhl.c atanl.c bdtrl.c btdtrl.c cbrtl.c \
  27. chdtrl.c coshl.c ellpel.c ellpkl.c elliel.c ellikl.c ellpjl.c \
  28. exp10l.c exp2l.c expl.c fdtrl.c gammal.c gdtrl.c igamil.c igaml.c \
  29. incbetl.c incbil.c isnanl.c j0l.c j1l.c jnl.c ldrand.c log10l.c log2l.c \
  30. logl.c nbdtrl.c ndtril.c ndtrl.c pdtrl.c powl.c powil.c sinhl.c sinl.c \
  31. sqrtl.c stdtrl.c tanhl.c tanl.c unityl.c ynl.c \
  32. floorl.c polevll.c mtherr.c #cmplxl.c clogl.c
  33. COBJS=$(patsubst %.c,%.o, $(CSRC))
  34. OBJS=$(COBJS)
  35. all: $(OBJS) $(LIBM)
  36. $(LIBM): ar-target
  37. ar-target: $(OBJS)
  38. $(AR) $(ARFLAGS) $(LIBM) $(OBJS)
  39. $(COBJS): %.o : %.c
  40. $(TARGET_CC) $(CFLAGS) -c $< -o $@
  41. $(STRIPTOOL) -x -R .note -R .comment $*.o
  42. $(OBJ): Makefile
  43. clean:
  44. rm -f *.[oa] *~ core
  45. #-----------------------------------------
  46. #all: mtstl lparanoi lcalc fltestl nantst testvect monotl libml.a
  47. mtstl: libml.a mtstl.o $(OBJS)
  48. $(CC) $(CFLAGS) -o mtstl mtstl.o libml.a $(LIBS)
  49. mtstl.o: mtstl.c
  50. lparanoi: libml.a lparanoi.o setprec.o ieee.o econst.o $(OBJS)
  51. $(CC) $(CFLAGS) -o lparanoi lparanoi.o setprec.o ieee.o econst.o libml.a $(LIBS)
  52. lparanoi.o: lparanoi.c
  53. $(CC) $(CFLAGS) -Wno-implicit -c lparanoi.c
  54. econst.o: econst.c ehead.h
  55. lcalc: libml.a lcalc.o ieee.o econst.o $(OBJS)
  56. $(CC) $(CFLAGS) -o lcalc lcalc.o ieee.o econst.o libml.a $(LIBS)
  57. lcalc.o: lcalc.c lcalc.h ehead.h
  58. ieee.o: ieee.c ehead.h
  59. # Use $(OBJS) in ar command for libml.a if possible; else *.o
  60. libml.a: $(OBJS) mconf.h
  61. ar -rv libml.a $(OBJS)
  62. ranlib libml.a
  63. fltestl: fltestl.c libml.a
  64. $(CC) $(CFLAGS) -o fltestl fltestl.c libml.a
  65. fltestl.o: fltestl.c
  66. flrtstl: flrtstl.c libml.a
  67. $(CC) $(CFLAGS) -o flrtstl flrtstl.c libml.a
  68. flrtstl.o: flrtstl.c
  69. nantst: nantst.c libml.a
  70. $(CC) $(CFLAGS) -o nantst nantst.c libml.a
  71. nantst.o: nantst.c
  72. testvect: testvect.o libml.a
  73. $(CC) $(CFLAGS) -o testvect testvect.o libml.a
  74. testvect.o: testvect.c
  75. $(CC) -g -c -o testvect.o testvect.c
  76. monotl: monotl.o libml.a
  77. $(CC) $(CFLAGS) -o monotl monotl.o libml.a
  78. monotl.o: monotl.c
  79. $(CC) -g -c -o monotl.o monotl.c
  80. # Run test programs
  81. check: mtstl fltestl testvect monotl libml.a
  82. -mtstl
  83. -fltestl
  84. -testvect
  85. -monotl