6809 libs: Use our str* and mem* functions
authorTormod Volden <debian.tormod@gmail.com>
Tue, 14 Apr 2015 21:23:13 +0000 (23:23 +0200)
committerAlan Cox <alan@linux.intel.com>
Wed, 15 Apr 2015 11:35:26 +0000 (12:35 +0100)
We will not be using the gcc stdlib when building
userland utilities.

And rename our own "libc" so that lwlink can find it.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Library/libs/Makefile.6809

index a571c97..efbb012 100644 (file)
@@ -1,14 +1,12 @@
 CC = m6809-unknown-gcc
 ASM = m6809-unknown-as
 AR = m6809-unknown-ar
-LINKER = m6809-unknown-ld
 PLATFORM = 6809
 export PLATFORM
 CC_OPT = -c -Os -I../include -I../include/6502
 # for stuff that gives sdcc nightmares
 CC_NOOPT = $(CC_OPT)
 ASM_OPT = -o
-LINKER_OPT =
 SRC_CRT0 = crt0_$(PLATFORM).s
 OBJ_CRT0 = $(SRC_CRT0:.s=.o)
 SRC_ASM =
@@ -52,10 +50,10 @@ SRC_HARD += regexp.c
 # Not supported yet
 #SRC_C += initgroups.c
 # Pieces we inherit in this case from the compiler library instead
-#SRC_C += strcpy.c strlen.c abs.c atof.c atoi.c atol.c labs.c
-#SRC_C += strcat.c strchr.c strcmp.c strcspn.c strncat.c strncmp.c
-#SRC_C += strncpy.c strpbrk.c strrchr.c strspn.c strstr.c strtok.c
-#SRC_C += memchr.c memcmp.c memcpy.c memset.c
+SRC_C += strcpy.c strlen.c abs.c atof.c atoi.c atol.c labs.c
+SRC_C += strcat.c strchr.c strcmp.c strcspn.c strncat.c strncmp.c
+SRC_C += strncpy.c strpbrk.c strrchr.c strspn.c strstr.c strtok.c
+SRC_C += memchr.c memcmp.c memcpy.c memset.c memmove.c
 
 OBJ_C = $(SRC_C:.c=.o)
 OBJ_HARD = $(SRC_HARD:.c=.o)
@@ -74,7 +72,7 @@ syscall.l: fuzix$(PLATFORM)/syslib.l
 syslib$(PLATFORM).lib: syscall.l libc.l
        cat libc.l syscall.l >syslib.l
        $(AR) -c syslib$(PLATFORM).lib $$(cat syslib.l)
-       ln -sf syslib$(PLATFORM).lib c$(PLATFORM).lib
+       ln -sf syslib$(PLATFORM).lib libc$(PLATFORM).a
 
 fuzix$(PLATFORM)/syslib.l:
        ../tools/syscall_$(PLATFORM)
@@ -93,6 +91,7 @@ $(OBJ_HARD):%.o: %.c
        $(CC) $(CC_NOOPT) $(@:.o=.c)
 
 clean:
-       rm -rf *.o *.asm *.sym *.lst *.lib *~ syscall.l  libc.l syslib.l
-       (cd fuzix$(PLATFORM); make clean)
+       rm -rf *.o *.asm *.sym *.lst *.lib *~ syscall.l libc.l syslib.l \
+       libc$(PLATFORM).a
+       -cd fuzix$(PLATFORM) && make clean
        rm -rf fuzix$(PLATFORM)/Makefile