summaryrefslogtreecommitdiff
path: root/test/Rules.mak
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-01-20 00:45:14 +0000
committerEric Andersen <andersen@codepoet.org>2001-01-20 00:45:14 +0000
commit844b89dbfdd41ced4666d2bb99ce0bf99503524b (patch)
tree170a400307e11f2a310e290f782b279bbe45e7be /test/Rules.mak
parent66ebed3e54ec469f719a48750df08fd642b2abfe (diff)
Reworked all test suite makefiles (man did they need it).
Refactored testsuite.h so it behaves the way I want it to. As policy now, all test apps are _supposed_ to use testsuite.h (not all have been converted to do this yet). It is simple, clean, and works. -Erik
Diffstat (limited to 'test/Rules.mak')
-rw-r--r--test/Rules.mak45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/Rules.mak b/test/Rules.mak
new file mode 100644
index 000000000..fd537f337
--- /dev/null
+++ b/test/Rules.mak
@@ -0,0 +1,45 @@
+# Rules.make for uClibc test apps.
+#
+# Copyright (C) 2001 by Lineo, inc.
+#
+#
+#Note: This does not read the top level Rules.mak file
+#
+
+include $(TESTDIR)Config
+
+
+NATIVE_ARCH = $(shell uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \
+ -e 's/arm.*/arm/g' -e 's/m68k.*/m68k/')
+
+# If you are running a cross compiler, you may want to set this
+# to something more interesting...
+TESTCC = ../$(TESTDIR)extra/gcc-uClibc/gcc-uClibc-$(NATIVE_ARCH)
+CC = gcc
+STRIPTOOL=strip
+
+
+# Check if 'ls -sh' works or not
+LSFLAGS = $(shell if ls -sh >/dev/null 2>&1; \
+ then echo "-sh"; else echo "-s" ; fi)
+
+# use '-Os' optimization if available, else use -O2
+OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
+ then echo "-Os"; else echo "-O2" ; fi)
+
+CFLAGS=$(WARNINGS) $(OPTIMIZATION)
+
+ifeq ($(DODEBUG),true)
+ CFLAGS +=-g
+ LDFLAGS =-Wl,-warn-common
+ STRIPTOOL =/bin/true -Since_we_are_debugging
+else
+ CFLAGS +=-fomit-frame-pointer
+ LDFLAGS =-s -Wl,-warn-common
+ STRIP = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
+endif
+
+ifneq ($(DODYNAMIC),true)
+ LDFLAGS +=--static
+endif
+