Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. TOPDIR=../../
  2. include $(TOPDIR)Rules.make
  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=string string_glibc
  18. all: $(TARGETS)
  19. string: string.c Makefile $(TOPDIR)libc.a
  20. -@ echo "-------"
  21. -@ echo " "
  22. -@ echo "Testing ctype functions: "
  23. -@ echo " "
  24. $(CC) $(XCFLAGS) -c $< -o $@.o
  25. $(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
  26. -./$@
  27. -@ echo " "
  28. string_glibc: string.c Makefile $(TOPDIR)libc.a
  29. -@ echo "-------"
  30. -@ echo " "
  31. -@ echo "Testing string functions: "
  32. -@ echo " "
  33. $(CC) $(YCFLAGS) -c $< -o $@.o
  34. $(CC) $(YLDFLAGS) --static $@.o -o $@
  35. -./$@
  36. -./$@
  37. -@ echo " "
  38. clean:
  39. rm -f *.[oa] *~ core $(TARGETS)