Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. # 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=signal signal_glibc
  18. all: $(TARGETS)
  19. signal: signal.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 " "
  28. signal_glibc: signal.c Makefile $(TOPDIR)libc.a
  29. -@ echo "-------"
  30. -@ echo " "
  31. -@ echo "Compiling vs GNU libc: "
  32. -@ echo " "
  33. $(CC) $(YCFLAGS) -c $< -o $@.o
  34. $(CC) $(YLDFLAGS) --static $@.o -o $@
  35. -./$@
  36. -@ echo " "
  37. clean:
  38. rm -f *.[oa] *~ core $(TARGETS)