Makefile 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. U_TARGETS := test_pwd test_grp pwcat grcat getgroups
  20. G_TARGETS := $(patsubst %,%_glibc,$(U_TARGETS))
  21. TARGETS :=
  22. ifeq ($(GLIBC_ONLY),)
  23. TARGETS += $(U_TARGETS)
  24. endif
  25. ifeq ($(UCLIBC_ONLY),)
  26. TARGETS += $(G_TARGETS)
  27. endif
  28. ifeq ($(GLIBC_ONLY),$(UCLIBC_ONLY))
  29. TARGETS+=test_pwd_diff test_grp_diff pwcat_diff grcat_diff getgroups_diff
  30. endif
  31. all: $(TARGETS)
  32. test_pwd: test_pwd.c Makefile $(TESTDIR)/Rules.mak
  33. -@ echo "-------"
  34. -@ echo " "
  35. -@ echo "Compiling $@ vs uClibc: "
  36. -@ echo " "
  37. $(CC) $(CFLAGS) -c $< -o $@.o
  38. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  39. $(STRIPTOOL) -x -R .note -R .comment $@
  40. ./$@ 2>&1 >test_pwd.out
  41. -@ echo " "
  42. test_pwd_glibc: test_pwd.c Makefile
  43. -@ echo "-------"
  44. -@ echo " "
  45. -@ echo "Compiling $@ vs glibc: "
  46. -@ echo " "
  47. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  48. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@
  49. $(STRIPTOOL) -x -R .note -R .comment $@
  50. ./$@ 2>&1 >test_pwd_glibc.out
  51. -@ echo " "
  52. test_grp: test_grp.c Makefile $(TESTDIR)/Rules.mak
  53. -@ echo "-------"
  54. -@ echo " "
  55. -@ echo "Compiling $@ vs uClibc: "
  56. -@ echo " "
  57. $(CC) $(CFLAGS) -c $< -o $@.o
  58. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  59. $(STRIPTOOL) -x -R .note -R .comment $@
  60. ./$@ 2>&1 >test_grp.out
  61. -@ echo " "
  62. test_grp_glibc: test_grp.c Makefile
  63. -@ echo "-------"
  64. -@ echo " "
  65. -@ echo "Compiling $@ vs glibc: "
  66. -@ echo " "
  67. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  68. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@
  69. $(STRIPTOOL) -x -R .note -R .comment $@
  70. ./$@ 2>&1 >test_grp_glibc.out
  71. -@ echo " "
  72. pwcat: pwcat.c Makefile $(TESTDIR)/Rules.mak
  73. -@ echo "-------"
  74. -@ echo " "
  75. -@ echo "Compiling $@ vs uClibc: "
  76. -@ echo " "
  77. $(CC) $(CFLAGS) -c $< -o $@.o
  78. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  79. $(STRIPTOOL) -x -R .note -R .comment $@
  80. ./$@ 2>&1 >pwcat.out
  81. -@ echo " "
  82. pwcat_glibc: pwcat.c Makefile
  83. -@ echo "-------"
  84. -@ echo " "
  85. -@ echo "Compiling $@ vs glibc: "
  86. -@ echo " "
  87. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  88. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@
  89. $(STRIPTOOL) -x -R .note -R .comment $@
  90. ./$@ 2>&1 >pwcat_glibc.out
  91. -@ echo " "
  92. grcat: grcat.c Makefile $(TESTDIR)/Rules.mak
  93. -@ echo "-------"
  94. -@ echo " "
  95. -@ echo "Compiling $@ vs uClibc: "
  96. -@ echo " "
  97. $(CC) $(CFLAGS) -c $< -o $@.o
  98. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  99. $(STRIPTOOL) -x -R .note -R .comment $@
  100. ./$@ 2>&1 >grcat.out
  101. -@ echo " "
  102. grcat_glibc: grcat.c Makefile
  103. -@ echo "-------"
  104. -@ echo " "
  105. -@ echo "Compiling $@ vs glibc: "
  106. -@ echo " "
  107. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  108. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@
  109. $(STRIPTOOL) -x -R .note -R .comment $@
  110. ./$@ 2>&1 >grcat_glibc.out
  111. -@ echo " "
  112. getgroups: getgroups.c Makefile $(TESTDIR)/Rules.mak
  113. -@ echo "-------"
  114. -@ echo " "
  115. -@ echo "Compiling $@ vs uClibc: "
  116. -@ echo " "
  117. $(CC) $(CFLAGS) -c $< -o $@.o
  118. $(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  119. $(STRIPTOOL) -x -R .note -R .comment $@
  120. ./$@ 2>&1 >getgroups.out
  121. -@ echo " "
  122. getgroups_glibc: getgroups.c Makefile
  123. -@ echo "-------"
  124. -@ echo " "
  125. -@ echo "Compiling $@ vs glibc: "
  126. -@ echo " "
  127. $(HOSTCC) $(GLIBC_CFLAGS) -c $< -o $@.o
  128. $(HOSTCC) $(GLIBC_LDFLAGS) $@.o -o $@
  129. $(STRIPTOOL) -x -R .note -R .comment $@
  130. ./$@ 2>&1 >getgroups_glibc.out
  131. -@ echo " "
  132. test_pwd_diff: test_pwd_glibc test_pwd
  133. -@ echo "-------"
  134. -@ echo " "
  135. -@ echo "Diffing output: "
  136. -@ echo " "
  137. -diff -u test_pwd_glibc.out test_pwd.out
  138. -@ echo " "
  139. test_grp_diff: test_grp_glibc test_grp
  140. -@ echo "-------"
  141. -@ echo " "
  142. -@ echo "Diffing output: "
  143. -@ echo " "
  144. -diff -u test_grp_glibc.out test_grp.out
  145. -@ echo " "
  146. pwcat_diff: pwcat_glibc pwcat
  147. -@ echo "-------"
  148. -@ echo " "
  149. -@ echo "Diffing output: "
  150. -@ echo " "
  151. -diff -u pwcat_glibc.out pwcat.out
  152. -@ echo " "
  153. grcat_diff: grcat_glibc grcat
  154. -@ echo "-------"
  155. -@ echo " "
  156. -@ echo "Diffing output: "
  157. -@ echo " "
  158. -diff -u grcat_glibc.out grcat.out
  159. -@ echo " "
  160. getgroups_diff: getgroups_glibc getgroups
  161. -@ echo "-------"
  162. -@ echo " "
  163. -@ echo "Diffing output: "
  164. -@ echo " "
  165. -diff -u getgroups_glibc.out getgroups.out
  166. -@ echo " "
  167. clean:
  168. $(RM) *.[oa] *~ core $(TARGETS) *.out