OSDN Git Service

Some more makefile fixes.
authorErik Andersen <andersen@codepoet.org>
Tue, 16 May 2000 22:55:15 +0000 (22:55 -0000)
committerErik Andersen <andersen@codepoet.org>
Tue, 16 May 2000 22:55:15 +0000 (22:55 -0000)
 -Erik

libc/stdio/Makefile
test/Makefile

index 020d33c..1aa8354 100644 (file)
@@ -37,12 +37,13 @@ $(LIBC)($(SOBJ)): $(SSRC)
        $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
        $(AR) $(ARFLAGS) $@ $*.o
 
-transfer:
-       -@rm -f ../include/stdio.h
-       cp -p stdio.h ../include/.
+#transfer:
+#      -@rm -f ../include/stdio.h
+#      cp -p stdio.h ../include/.
+#
+#$(LIBC)($(OBJ)): stdio.h
 
 clean:
        rm -f *.o libc.a
 
-$(LIBC)($(OBJ)): stdio.h
 
index ff1e9f4..6ff6d4c 100644 (file)
@@ -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)