OSDN Git Service

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