OSDN Git Service

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