Makefile 2.6 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. TESTDIR=../
  19. include $(TESTDIR)/Rules.mak
  20. CFLAGS64=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
  21. TARGETS=stat_diff stat64_diff
  22. all: $(TARGETS)
  23. stat_source:
  24. -@ rm -f $(TARGETS)
  25. -@ echo "-------"
  26. -@ echo "stat.c source: "
  27. -@ echo " "
  28. -@ cat stat.c
  29. -@ echo " "
  30. stat: stat.c Makefile $(TESTDIR)/Config $(TESTDIR)/Rules.mak $(CC)
  31. -@ echo "-------"
  32. -@ echo " "
  33. -@ echo "Compiling vs uClibc: "
  34. -@ echo " "
  35. $(CC) $(CFLAGS) -c $< -o $@.o
  36. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  37. $(STRIPTOOL) -x -R .note -R .comment $@
  38. -./$@ stat.c > $@.out
  39. -@ echo " "
  40. stat_glibc: stat.c Makefile
  41. -@ echo "-------"
  42. -@ echo " "
  43. -@ echo "Compiling vs GNU libc: "
  44. -@ echo " "
  45. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  46. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@
  47. $(STRIPTOOL) -x -R .note -R .comment $@
  48. -./$@ stat.c > $@.out
  49. -@ echo " "
  50. stat_diff: stat stat_glibc
  51. -@ echo "-------"
  52. -@ echo " "
  53. -@ echo "Diffing stat output: "
  54. -@ echo " "
  55. -diff -u stat_glibc.out stat.out
  56. -@ echo " "
  57. stat64: stat.c Makefile $(TESTDIR)/Config $(TESTDIR)/Rules.mak $(CC)
  58. -@ echo "-------"
  59. -@ echo " "
  60. -@ echo "Compiling vs uClibc: "
  61. -@ echo " "
  62. $(CC) $(CFLAGS) $(CFLAGS64) -c $< -o $@.o
  63. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  64. $(STRIPTOOL) -x -R .note -R .comment $@
  65. -./$@ stat.c > $@.out
  66. -@ echo " "
  67. stat64_glibc: stat.c Makefile
  68. -@ echo "-------"
  69. -@ echo " "
  70. -@ echo "Compiling vs GNU libc: "
  71. -@ echo " "
  72. $(HOSTCC) $(GLIBC_CFLAGS) $(CFLAGS64) -c $< -o $@.o
  73. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@
  74. $(STRIPTOOL) -x -R .note -R .comment $@
  75. -./$@ stat.c > $@.out
  76. -@ echo " "
  77. stat64_diff: stat64 stat64_glibc
  78. -@ echo "-------"
  79. -@ echo " "
  80. -@ echo "Diffing stat64 output: "
  81. -@ echo " "
  82. -diff -u stat64_glibc.out stat64.out
  83. -@ echo " "
  84. clean:
  85. rm -f *.[oa] *~ core stat stat_glibc stat_glibc.out stat.out \
  86. stat64 stat64_glibc stat64_glibc.out stat64.out