OSDN Git Service

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