Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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=fork fork_glibc
  13. all: $(TARGETS)
  14. fork: fork.c ../testsuite.h Makefile $(TOPDIR)libc.a
  15. -@ echo "-------"
  16. -@ echo " "
  17. -@ echo "Compiling vs uClibc: "
  18. -@ echo " "
  19. $(CC) $(XCFLAGS) -c $< -o $@.o
  20. $(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  21. $(STRIPTOOL) -x -R .note -R .comment $@
  22. ./$@
  23. -@ echo " "
  24. fork_glibc: fork.c ../testsuite.h Makefile $(TOPDIR)libc.a
  25. -@ echo "-------"
  26. -@ echo " "
  27. -@ echo "Compiling vs GNU libc: "
  28. -@ echo " "
  29. $(CC) $(YCFLAGS) -c $< -o $@.o
  30. $(CC) $(YLDFLAGS) --static $@.o -o $@
  31. $(STRIPTOOL) -x -R .note -R .comment $@
  32. -./$@
  33. -@ echo " "
  34. clean:
  35. rm -f *.[oa] *~ core $(TARGETS)