Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. TOPDIR=../../
  2. include $(TOPDIR)Rules.mak
  3. # Check if 'ls -sh' works or not
  4. LSFLAGS = $(shell if ls -sh >/dev/null 2>&1; \
  5. then echo "-sh"; else echo "-s" ; fi)
  6. XCFLAGS = -Wall -Os -fomit-frame-pointer -fno-builtin -nostdinc \
  7. -I$(TOPDIR)include -I/usr/include/linux
  8. XLDFLAGS = -nostdlib -s -gc-sections
  9. EXTRA_LIBS=$(TOPDIR)libc.a -lgcc
  10. YCFLAGS = -Wall -Os -fomit-frame-pointer
  11. YLDFLAGS = -s --static
  12. TARGETS=test_pwd test_pwd_glibc
  13. TARGETS+=test_grp test_grp_glibc
  14. TARGETS+=test_pwd_diff test_grp_diff
  15. all: $(TARGETS)
  16. test_pwd: test_pwd.c Makefile $(TOPDIR)libc.a
  17. -@ echo "-------"
  18. -@ echo " "
  19. -@ echo "Compiling vs uClibc: "
  20. -@ echo " "
  21. $(CC) $(XCFLAGS) -c $< -o $@.o
  22. $(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  23. $(STRIPTOOL) -x -R .note -R .comment $@
  24. -./$@ 2>&1 >test_pwd.out
  25. -@ echo " "
  26. test_pwd_glibc: test_pwd.c Makefile $(TOPDIR)libc.a
  27. -@ echo "-------"
  28. -@ echo " "
  29. -@ echo "Compiling vs GNU libc: "
  30. -@ echo " "
  31. $(CC) $(YCFLAGS) -c $< -o $@.o
  32. $(CC) $(YLDFLAGS) --static $@.o -o $@
  33. $(STRIPTOOL) -x -R .note -R .comment $@
  34. -./$@ 2>&1 >test_pwd_glibc.out
  35. -@ echo " "
  36. test_grp: test_grp.c Makefile $(TOPDIR)libc.a
  37. -@ echo "-------"
  38. -@ echo " "
  39. -@ echo "Compiling vs uClibc: "
  40. -@ echo " "
  41. $(CC) $(XCFLAGS) -c $< -o $@.o
  42. $(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  43. $(STRIPTOOL) -x -R .note -R .comment $@
  44. -./$@ 2>&1 >test_grp.out
  45. -@ echo " "
  46. test_grp_glibc: test_grp.c Makefile $(TOPDIR)libc.a
  47. -@ echo "-------"
  48. -@ echo " "
  49. -@ echo "Compiling vs GNU libc: "
  50. -@ echo " "
  51. $(CC) $(YCFLAGS) -c $< -o $@.o
  52. $(CC) $(YLDFLAGS) --static $@.o -o $@
  53. $(STRIPTOOL) -x -R .note -R .comment $@
  54. -./$@ 2>&1 >test_grp_glibc.out
  55. -@ echo " "
  56. test_pwd_diff: test_pwd_glibc test_pwd
  57. -@ echo "-------"
  58. -@ echo " "
  59. -@ echo "Diffing output: "
  60. -@ echo " "
  61. -diff -u test_pwd_glibc.out test_pwd.out
  62. -@ echo " "
  63. test_grp_diff: test_grp_glibc test_grp
  64. -@ echo "-------"
  65. -@ echo " "
  66. -@ echo "Diffing output: "
  67. -@ echo " "
  68. -diff -u test_grp_glibc.out test_grp.out
  69. -@ echo " "
  70. clean:
  71. rm -f *.[oa] *~ core $(TARGETS) *.out