Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. TARGETS=malloc
  20. TARGETS+=testmalloc testmalloc_glibc
  21. TARGETS+=mallocbug mallocbug_glibc
  22. TARGETS+=realloc0 realloc0_glibc
  23. all: $(TARGETS)
  24. malloc: malloc.c Makefile $(TESTDIR)/Rules.mak
  25. -@ echo "-------"
  26. -@ echo " "
  27. -@ echo "Compiling $@ vs uClibc: "
  28. -@ echo " "
  29. $(CC) $(CFLAGS) -c $< -o $@.o
  30. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  31. $(STRIPTOOL) -x -R .note -R .comment $@
  32. ./$@
  33. -@ echo " "
  34. testmalloc_source:
  35. -@ echo "-------"
  36. -@ echo "testmalloc.c source: "
  37. -@ echo " "
  38. -@ cat testmalloc.c
  39. -@ echo " "
  40. testmalloc: testmalloc.c Makefile $(TESTDIR)/Rules.mak
  41. -@ echo "-------"
  42. -@ echo " "
  43. -@ echo "Compiling $@ vs uClibc: "
  44. -@ echo " "
  45. $(CC) $(CFLAGS) -c $< -o $@.o
  46. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  47. $(STRIPTOOL) -x -R .note -R .comment $@
  48. -$(LDD) $@
  49. ls -l $@
  50. ./$@
  51. -@ echo " "
  52. testmalloc_glibc: testmalloc.c Makefile
  53. -@ echo "-------"
  54. -@ echo " "
  55. -@ echo "Compiling $@ vs GNU libc: "
  56. -@ echo " "
  57. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  58. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@
  59. $(STRIPTOOL) -x -R .note -R .comment $@
  60. -$(LDD) $@
  61. ls -l $@
  62. ./$@
  63. -@ echo " "
  64. mallocbug: mallocbug.c Makefile $(TESTDIR)/Rules.mak
  65. -@ echo "-------"
  66. -@ echo " "
  67. -@ echo "Compiling $@ vs uClibc: "
  68. -@ echo " "
  69. $(CC) $(CFLAGS) -c $< -o $@.o
  70. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  71. $(STRIPTOOL) -x -R .note -R .comment $@
  72. -$(LDD) $@
  73. ls -l $@
  74. ./$@
  75. -@ echo " "
  76. mallocbug_glibc: mallocbug.c Makefile
  77. -@ echo "-------"
  78. -@ echo " "
  79. -@ echo "Compiling $@ vs GNU libc: "
  80. -@ echo " "
  81. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  82. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@
  83. $(STRIPTOOL) -x -R .note -R .comment $@
  84. -$(LDD) $@
  85. ls -l $@
  86. ./$@
  87. -@ echo " "
  88. realloc0: realloc0.c Makefile $(TESTDIR)/Rules.mak
  89. -@ echo "-------"
  90. -@ echo " "
  91. -@ echo "Compiling $@ vs uClibc: "
  92. -@ echo " "
  93. $(CC) $(CFLAGS) -c $< -o $@.o
  94. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  95. $(STRIPTOOL) -x -R .note -R .comment $@
  96. -$(LDD) $@
  97. ls -l $@
  98. ./$@
  99. -@ echo " "
  100. realloc0_glibc: realloc0.c Makefile
  101. -@ echo "-------"
  102. -@ echo " "
  103. -@ echo "Compiling $@ vs GNU libc: "
  104. -@ echo " "
  105. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  106. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@
  107. $(STRIPTOOL) -x -R .note -R .comment $@
  108. -$(LDD) $@
  109. ls -l $@
  110. ./$@
  111. -@ echo " "
  112. clean:
  113. $(RM) *.[oa] *~ core $(TARGETS)