Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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=assert assert_glibc
  13. all: $(TARGETS)
  14. assert: assert.c 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 "This was supposed to core dump on test #3"
  24. -@rm -f core
  25. -@ echo " "
  26. assert_glibc: assert.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. -./$@
  35. -@ echo "This was supposed to core dump on test #3"
  36. -@rm -f core
  37. -@ echo " "
  38. clean:
  39. rm -f *.[oa] *~ core $(TARGETS)