Rules.mak 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. TESTCC = ../$(TESTDIR)extra/gcc-uClibc/$(NATIVE_ARCH)-uclibc-gcc
  14. CC = gcc
  15. STRIPTOOL=strip
  16. # Check if 'ls -sh' works or not
  17. LSFLAGS = -l
  18. # turn all the warnings on
  19. WARNINGS=-Wall
  20. # use '-Os' optimization if available, else use -O2
  21. OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
  22. then echo "-Os"; else echo "-O2" ; fi)
  23. TEST_CFLAGS=$(WARNINGS) $(OPTIMIZATION) --uclibc-use-build-dir
  24. CFLAGS=$(WARNINGS) $(OPTIMIZATION)
  25. ifeq ($(DODEBUG),true)
  26. CFLAGS +=-g
  27. LDFLAGS =-Wl,-warn-common
  28. STRIPTOOL =/bin/true -Since_we_are_debugging
  29. else
  30. CFLAGS +=-fomit-frame-pointer
  31. LDFLAGS =-s -Wl,-warn-common
  32. STRIP = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
  33. endif
  34. ifneq ($(DODYNAMIC),true)
  35. LDFLAGS +=--static
  36. endif