Makefile 2.6 KB

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