Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. -./$@
  27. -@ echo "This was supposed to core dump on test #3"
  28. -@rm -f core
  29. -@ echo " "
  30. assert_glibc: assert.c Makefile $(TOPDIR)libc.a
  31. -@ echo "-------"
  32. -@ echo " "
  33. -@ echo "Compiling vs GNU libc: "
  34. -@ echo " "
  35. $(CC) $(YCFLAGS) -c $< -o $@.o
  36. $(CC) $(YLDFLAGS) --static $@.o -o $@
  37. -./$@
  38. -@ echo "This was supposed to core dump on test #3"
  39. -@rm -f core
  40. -@ echo " "
  41. clean:
  42. rm -f *.[oa] *~ core $(TARGETS)