diff --git a/src/lib/libc/string/Makefile b/src/lib/libc/string/Makefile new file mode 100755 index 0000000..02a57d9 --- /dev/null +++ b/src/lib/libc/string/Makefile @@ -0,0 +1,41 @@ +# $Id$ +# The System Makefile (C) 2002 The UbixOS Project + + +#Compiler +GCC = gcc +G++ = gcc + +#Linker +LD = ld -Bshareable +AR = ar + +#Delete Program +REMOVE = rm -f + +#Objects +OBJS = memcpy.o +#Output +OUTPUT = libc.so + +$(OUTPUT): $(OBJS) + +# Compile the source files +.cc.o: + $(G++) -Wall -nostdinc -O -I../include -c -o $@ $< + +.cc.s: + $(G++) -Wall -nostdinc -O -I../include -S -o $@ $< + +.c.o: + $(GCC) -Wall -nostdinc -O -I../include -c $< + +.c.s: + $(GCC) -Wall -nostdinc -O -I../include -S -o $@ $< + +.S.o: + $(GCC) -Wall -nostdinc -c -o $@ $< + +# Clean up the junk +clean: + $(REMOVE) $(OBJS) $(OUTPUT) diff --git a/src/lib/libc/string/memcpy.c b/src/lib/libc/string/memcpy.c index bbc25a0..62e6ca0 100755 --- a/src/lib/libc/string/memcpy.c +++ b/src/lib/libc/string/memcpy.c @@ -1,3 +1,5 @@ +#include +#include void * memcpy(void * dst, const void * src, size_t length) { @@ -14,7 +16,7 @@ ((unsigned long *)dst)[i] = ((unsigned long *)src)[i]; for (i = 0; i < y; i++) - ((char *) dst)[length-y+i] = ((char *) dst)[lenght-y+i]; + ((char *) dst)[length-y+i] = ((char *) dst)[length-y+i]; return dst; }