Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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
  10. YCFLAGS = -Wall -Os -fomit-frame-pointer
  11. YLDFLAGS = -s --static
  12. # Allow alternative stripping tools to be used...
  13. ifndef $(STRIPTOOL)
  14. STRIPTOOL = strip
  15. endif
  16. STRIP = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
  17. TARGETS=assert assert_glibc
  18. all: $(TARGETS)
  19. assert: assert.c Makefile $(TOPDIR)libc.a
  20. -@ echo "-------"
  21. -@ echo " "
  22. -@ echo "Compiling vs uCLibc: "
  23. -@ echo " "
  24. $(CC) $(XCFLAGS) -c $< -o $@.o
  25. $(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  26. -@ echo "This is supposed to core dump on test #3"
  27. -./$@
  28. -@ echo " "
  29. assert_glibc: assert.c Makefile $(TOPDIR)libc.a
  30. -@ echo "-------"
  31. -@ echo " "
  32. -@ echo "Compiling vs GNU libc: "
  33. -@ echo " "
  34. $(CC) $(YCFLAGS) -c $< -o $@.o
  35. $(CC) $(YLDFLAGS) --static $@.o -o $@
  36. -@ echo "This is supposed to core dump on test #3"
  37. -./$@
  38. -@ echo " "
  39. clean:
  40. rm -f *.[oa] *~ core $(TARGETS)