Rules.mak 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. include $(TESTDIR)Config
  10. NATIVE_ARCH = ${shell uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \
  11. -e 's/arm.*/arm/g' -e 's/m68k.*/m68k/' -e 's/ppc/powerpc/'}
  12. # If you are running a cross compiler, you may want to set this
  13. # to something more interesting...
  14. CC = ../$(TESTDIR)extra/gcc-uClibc/$(NATIVE_ARCH)-uclibc-gcc
  15. HOST_CC = gcc
  16. STRIPTOOL=strip
  17. LDD = ../$(TESTDIR)ldso/util/ldd
  18. # Check if 'ls -sh' works or not
  19. LSFLAGS = -l
  20. # turn all the warnings on
  21. WARNINGS=-Wall
  22. # use '-Os' optimization if available, else use -O2
  23. OPTIMIZATION = ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
  24. then echo "-Os"; else echo "-O2" ; fi}
  25. ifeq ($(DODEBUG),true)
  26. CFLAGS +=$(WARNINGS) $(OPTIMIZATION) -g
  27. GLIBC_CFLAGS +=$(WARNINGS) $(OPTIMIZATION) -g
  28. LDFLAGS =-Wl,-warn-common
  29. GLIBC_LDFLAGS =-Wl,-warn-common
  30. STRIPTOOL =/bin/true -Since_we_are_debugging
  31. else
  32. CFLAGS +=-fomit-frame-pointer
  33. GLIBC_CFLAGS +=-fomit-frame-pointer
  34. LDFLAGS =-s -Wl,-warn-common
  35. GLIBC_LDFLAGS =-s -Wl,-warn-common
  36. STRIP = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
  37. endif
  38. ifneq ($(DODYNAMIC),true)
  39. LDFLAGS +=--static
  40. endif
  41. ifeq ($(strip $(HAVE_SHARED)),true)
  42. ifeq ($(strip $(BUILD_UCLIBC_LDSO)),true)
  43. CFLAGS+=--uclibc-use-build-dir
  44. LDFLAGS+=--uclibc-use-build-dir
  45. endif
  46. endif