Rules.mak 1.7 KB

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