summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-05-16 22:55:15 +0000
committerErik Andersen <andersen@codepoet.org>2000-05-16 22:55:15 +0000
commit34074d24da57f821430c6f9d1b2cb58e06794ed1 (patch)
tree65ce3f71da6dd4b249cfe8a170275d50180050e3 /test
parente029f68bffea72f64ca87d87dcd488269fb25240 (diff)
Some more makefile fixes.
-Erik
Diffstat (limited to 'test')
-rw-r--r--test/Makefile47
1 files changed, 41 insertions, 6 deletions
diff --git a/test/Makefile b/test/Makefile
index ff1e9f4f3..6ff6d4cbf 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -2,21 +2,56 @@ TOPDIR=../
include $(TOPDIR)Rules.make
-CFLAGS = -Wall -Os -fomit-frame-pointer -fno-builtin -nostdinc -I$(TOPDIR)include -I/usr/include/linux
-LDFLAGS = -nostdlib -s
+XCFLAGS = -Wall -Os -fomit-frame-pointer -fno-builtin -nostdinc \
+ -I$(TOPDIR)include -I/usr/include/linux
+XLDFLAGS = -nostdlib -s -gc-sections
EXTRA_LIBS=/home/andersen/CVS/uC-libc/libc.a
+YCFLAGS = -Wall -Os -fomit-frame-pointer
+YLDFLAGS = -s --static
+
# Allow alternative stripping tools to be used...
ifndef $(STRIPTOOL)
STRIPTOOL = strip
endif
STRIP = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $@
-hello: hello.c Makefile
- $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ $(EXTRA_LIBS)
- $(STRIP)
+TARGETS=hello_source hello_glibc hello
+
+all: $(TARGETS)
+
+hello_source:
+ -@ echo "-------"
+ -@ echo "hello.c source: "
+ -@ echo " "
+ -@ cat hello.c
+ -@ echo " "
+
+hello: hello.c Makefile $(TOPDIR)libc.a
+ -@ echo "-------"
+ -@ echo " "
+ -@ echo -n "Compiling vs uC-Libc: "
+ -@ $(CC) $(XCFLAGS) -c $< -o $@.o
+ -@ $(CC) $(XLDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
+ -@ $(STRIP)
+ -@ echo "done."
+ -@ ldd $@
+ -@ ls -sh $@
+ -@ echo " "
+
+hello_glibc: hello.c Makefile $(TOPDIR)libc.a
+ -@ echo "-------"
+ -@ echo " "
+ -@ echo -n "Compiling vs GNU libc: "
+ -@ $(CC) $(YCFLAGS) -c $< -o $@.o
+ -@ $(CC) $(YLDFLAGS) --static $@.o -o $@
+ -@ $(STRIP)
+ -@ echo "done."
+ -@ ldd $@
+ -@ ls -sh $@
+ -@ echo " "
clean:
- rm -f *.[oa] *~ core hello
+ rm -f *.[oa] *~ core $(TARGETS)