From 84866232d9644a02d613e11710d0f3abe8c7a66e Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 11 Aug 2000 01:23:29 +0000 Subject: Yet more updates. Getting closer.... -Erik --- libc/stdlib/Makefile | 57 ++++++++++++++-------------------------- libc/string/Makefile | 33 ++++++++++++----------- libc/sysdeps/linux/i386/Makefile | 34 ++++++++++++------------ 3 files changed, 54 insertions(+), 70 deletions(-) (limited to 'libc') diff --git a/libc/stdlib/Makefile b/libc/stdlib/Makefile index 6f33f8afc..a7cf3a844 100644 --- a/libc/stdlib/Makefile +++ b/libc/stdlib/Makefile @@ -4,56 +4,39 @@ TOPDIR=../ include $(TOPDIR)Rules.make +LIBC=$(TOPDIR)libc.a -LIBC=../libc.a MSRC=aliases.c -MOBJ=abs.o remove.o creat.o bcopy.o bzero.o -# raise.o bcmp.o index.o rindex.o +MOBJ=abs.o remove.o creat.o bcopy.o bzero.o + # raise.o bcmp.o index.o rindex.o +MSRC2=atexit.c +MOBJ2=on_exit.o atexit.o __do_exit.o exit.o -ESRC=atexit.c -EOBJ=on_exit.o atexit.o __do_exit.o exit.o +CFILES=atoi.c atol.c ltoa.c ltostr.c ctype.c qsort.c bsearch.c rand.c lsearch.c \ + getopt.c glob.c fnmatch.c itoa.c strtod.c strtol.c crypt.c sleep.c \ + mkstemp.c mktemp.c realpath.c getenv.c putenv.c popen.c system.c \ + getcwd.c setenv.c execl.c execv.c execlp.c execvp.c execvep.c +COBJS=$(patsubst %.c,%.o, $(CFILES)) -GOBJ=atoi.o atol.o ltoa.o ltostr.o \ - ctype.o qsort.o bsearch.o rand.o lsearch.o getopt.o \ - glob.o fnmatch.o itoa.o strtol.o crypt.o sleep.o mkstemp.o \ - mktemp.o realpath.o -UOBJ=getenv.o putenv.o popen.o system.o getcwd.o setenv.o \ - execl.o execv.o execlp.o execvp.o execvep.o +all: $(COBJS) $(MOBJ) $(MOBJ2) $(LIBC) -OBJ=$(MOBJ) $(EOBJ) $(GOBJ) $(UOBJ) +$(COBJS): $(CFILES) + $(CC) $(CFLAGS) -c $*.c -o $@ -## No ELKS strtod() until BCC does 16 bit FP... -#ifneq ($(LIB_CPU),i86) -#OBJ+=strtod.o -#endif +$(MOBJ): $(MSRC) + $(CC) $(CFLAGS) -DL_$* -c $(MSRC) -o $@ -all: $(LIBC) +$(MOBJ2): $(MSRC2) + $(CC) $(CFLAGS) -DL_$* -c $(MSRC2) -o $@ -$(LIBC): $(LIBC)($(OBJ)) - -$(LIBC)($(MOBJ)): $(MSRC) - $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(AR) $(ARFLAGS) $@ $*.o - -$(LIBC)($(EOBJ)): $(ESRC) - $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(AR) $(ARFLAGS) $@ $*.o +$(LIBC): $(COBJS) $(MOBJ) $(MOBJ2) + $(AR) $(ARFLAGS) $(LIBC) $(COBJS) $(MOBJ) $(MOBJ2) clean: - rm -f *.o libc.a - -$(LIBC)(strtol.o): strtol.c - $(CC) -c -ansi $(ARCH) $(CCFLAGS) $(DEFS) $*.c - $(AR) $(ARFLAGS) $@ $*.o + rm -f *.o -$(LIBC)(strtod.o): strtod.c - $(CC) -c -ansi $(ARCH) $(CCFLAGS) $(DEFS) $*.c - $(AR) $(ARFLAGS) $@ $*.o -$(LIBC)(crypt.o): crypt.c - $(CC) -c -ansi $(ARCH) $(CCFLAGS) $(DEFS) $*.c - $(AR) $(ARFLAGS) $@ $*.o diff --git a/libc/string/Makefile b/libc/string/Makefile index b190adb0f..35c09565c 100644 --- a/libc/string/Makefile +++ b/libc/string/Makefile @@ -4,28 +4,29 @@ TOPDIR=../ include $(TOPDIR)Rules.make +LIBC=$(TOPDIR)libc.a -LIBC=../libc.a +MSRC=string.c +MOBJ=strlen.o strcat.o strcpy.o strcmp.o strncat.o strncpy.o strncmp.o \ + strchr.o strrchr.o strdup.o memcpy.o memccpy.o memchr.o memset.o \ + memcmp.o memmove.o movedata.o +CFILES=strpbrk.c strsep.c strstr.c strtok.c strcspn.c \ + strspn.c strcasecmp.c strncasecmp.c config.c +COBJS=$(patsubst %.c,%.o, $(CFILES)) -SSRC=string.c -SOBJ=strlen.o strcat.o strcpy.o strcmp.o strncat.o strncpy.o strncmp.o \ - strchr.o strrchr.o strdup.o memcpy.o memccpy.o memchr.o memset.o \ - memcmp.o memmove.o movedata.o -OBJ=strpbrk.o strsep.o strstr.o strtok.o strcspn.o \ - strspn.o strcasecmp.o strncasecmp.o config.o +all: $(COBJS) $(MOBJ) $(LIBC) -all: $(LIBC) +$(COBJS): $(CFILES) + $(CC) $(CFLAGS) -c $*.c -o $@ -$(LIBC): $(LIBC)($(SOBJ)) $(OBJ) +$(MOBJ): $(MSRC) + $(CC) $(CFLAGS) -DL_$* -c $(MSRC) -o $@ -$(LIBC)($(SOBJ)): $(SSRC) - $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(AR) $(ARFLAGS) $@ $*.o - -transfer: - -@rm -f ../include/string.h - cp -p string.h ../include/. +$(LIBC): $(COBJS) $(MOBJ) + $(AR) $(ARFLAGS) $(LIBC) $(COBJS) $(MOBJ) clean: rm -f *.o + + diff --git a/libc/sysdeps/linux/i386/Makefile b/libc/sysdeps/linux/i386/Makefile index 57fed3bf4..165d16cbd 100644 --- a/libc/sysdeps/linux/i386/Makefile +++ b/libc/sysdeps/linux/i386/Makefile @@ -5,31 +5,31 @@ TOPDIR=../../../ include $(TOPDIR)Rules.make +LIBC=$(TOPDIR)libc.a CFLAGS+= -D_GCC_LIMITS_H_ -LIBC=$(TOPDIR)libc.a +MSRC=syscalls.S +include makefile.objs +SFILES=setjmp.S longjmp.S _start.S _exit.S #fork.o +SOBJS=$(patsubst %.S,%.o, $(SFILES)) +CFILES=readdir.c #select.c +COBJS=$(patsubst %.c,%.o, $(CFILES)) -.S.s: - $(CC) $(CFLAGS) -D__ASSEMBLY__ -traditional -E -o $*.s $< -.S.o: - $(CC) $(CFLAGS) -c -o $*.o $< -SSRC=syscalls.S -OBJ= setjmp.o longjmp.o readdir.o _start.o _exit.o fork.o #select.o -include makefile.objs +all: $(SOBJS) $(COBJS) $(MOBJ) $(LIBC) -all: $(LIBC) +$(SOBJS): $(SFILES) + $(CC) $(CFLAGS) -c $*.S -o $@ -$(LIBC): $(OBJ) $(LIBC)($(SOBJ)) - $(AR) $(ARFLAGS) $@ $(OBJ) +$(COBJS): $(CFILES) + $(CC) $(CFLAGS) -c $*.c -o $@ -$(LIBC)($(SOBJ)): $(SSRC) - $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(AR) $(ARFLAGS) $@ $*.o +$(MOBJ): $(MSRC) + $(CC) $(CFLAGS) -DL_$* -c $(MSRC) -o $@ -transfer: - -@rm -f ../include/stdio.h - cp -p stdio.h ../include/. +$(LIBC): $(SOBJS) $(COBJS) $(MOBJ) + $(AR) $(ARFLAGS) $(LIBC) $(SOBJS) $(COBJS) $(MOBJ) clean: rm -f *.o + -- cgit v1.2.3