1 # Rules.make for uClibc test apps.
3 # Copyright (C) 2001 by Lineo, inc.
6 #Note: This does not read the top level Rules.mak file
9 -include $(TESTDIR)../.config
10 include $(TESTDIR)Config
13 # Use NATIVE_ARCH here since running these test is not
14 # even possible when cross compiling...
15 NATIVE_ARCH:= ${shell uname -m | sed \
17 -e 's/sparc.*/sparc/' \
20 -e 's/ppc/powerpc/g' \
21 -e 's/v850.*/v850/g' \
22 -e 's/sh[234].*/sh/' \
25 ifeq ($(strip $(TARGET_ARCH)),)
26 TARGET_ARCH:=${shell $(CC) -dumpmachine | sed -e s'/-.*//' \
28 -e 's/sparc.*/sparc/' \
31 -e 's/ppc/powerpc/g' \
32 -e 's/v850.*/v850/g' \
39 # If you are running a cross compiler, you may want to set this
40 # to something more interesting...
41 CC = ../$(TESTDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
44 LDD = ../$(TESTDIR)ldso/util/ldd
47 # Check if 'ls -sh' works or not
50 # turn all the warnings on
53 # use '-Os' optimization if available, else use -O2
54 OPTIMIZATION = ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
55 then echo "-Os"; else echo "-O2" ; fi}
57 ifeq ($(DODEBUG),true)
58 CFLAGS +=$(WARNINGS) $(OPTIMIZATION) -g
59 GLIBC_CFLAGS +=$(WARNINGS) $(OPTIMIZATION) -g
60 LDFLAGS =-Wl,-warn-common
61 GLIBC_LDFLAGS =-Wl,-warn-common
62 STRIPTOOL =true -Since_we_are_debugging
64 CFLAGS +=$(WARNINGS) $(OPTIMIZATION) -fomit-frame-pointer
65 GLIBC_CFLAGS +=$(WARNINGS) $(OPTIMIZATION) -fomit-frame-pointer
66 LDFLAGS =-s -Wl,-warn-common
67 GLIBC_LDFLAGS =-s -Wl,-warn-common
68 STRIP = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
71 ifneq ($(DODYNAMIC),true)
73 GLIBC_LDFLAGS +=--static
75 CFLAGS+=--uclibc-use-build-dir
76 LDFLAGS+=--uclibc-use-build-dir