Rules.mak 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Rules.make for uClibc test apps.
  2. #
  3. # Copyright (C) 2001 by Lineo, inc.
  4. #
  5. #
  6. #Note: This does not read the top level Rules.mak file
  7. #
  8. include $(TESTDIR)Config
  9. NATIVE_ARCH = $(shell uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \
  10. -e 's/arm.*/arm/g' -e 's/m68k.*/m68k/' -e 's/ppc/powerpc/')
  11. # If you are running a cross compiler, you may want to set this
  12. # to something more interesting...
  13. CC = ../$(TESTDIR)extra/gcc-uClibc/$(NATIVE_ARCH)-uclibc-gcc
  14. HOST_CC = gcc
  15. STRIPTOOL=strip
  16. LDD = ../$(TESTDIR)ldso/util/ldd
  17. # Check if 'ls -sh' works or not
  18. LSFLAGS = -l
  19. # turn all the warnings on
  20. WARNINGS=-Wall
  21. # use '-Os' optimization if available, else use -O2
  22. OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
  23. then echo "-Os"; else echo "-O2" ; fi)
  24. ifeq ($(DODEBUG),true)
  25. CFLAGS +=$(WARNINGS) $(OPTIMIZATION) -g
  26. GLIBC_CFLAGS +=$(WARNINGS) $(OPTIMIZATION) -g
  27. LDFLAGS =-Wl,-warn-common
  28. GLIBC_LDFLAGS =-Wl,-warn-common
  29. STRIPTOOL =/bin/true -Since_we_are_debugging
  30. else
  31. CFLAGS +=-fomit-frame-pointer
  32. GLIBC_CFLAGS +=-fomit-frame-pointer
  33. LDFLAGS =-s -Wl,-warn-common
  34. GLIBC_LDFLAGS =-s -Wl,-warn-common
  35. STRIP = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
  36. endif
  37. ifneq ($(DODYNAMIC),true)
  38. LDFLAGS +=--static
  39. endif
  40. CFLAGS+=--uclibc-use-build-dir
  41. LDFLAGS+=--uclibc-use-build-dir