OSDN Git Service

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