diff options
Diffstat (limited to 'libc')
39 files changed, 158 insertions, 89 deletions
diff --git a/libc/Makefile b/libc/Makefile new file mode 100644 index 000000000..695e8ebe1 --- /dev/null +++ b/libc/Makefile @@ -0,0 +1,112 @@ +# Makefile for uClibc +# +# Copyright (C) 2000, 2001 by Lineo, inc. +# Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU Library General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more +# details. +# +# You should have received a copy of the GNU Library General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Derived in part from the Linux-8086 C library, the GNU C Library, and several +# other sundry sources. Files within this library are copyright by their +# respective copyright holders. + +#-------------------------------------------------------- +# +#There are a number of configurable options in "Config" +# +#-------------------------------------------------------- + +TOPDIR=../ +include $(TOPDIR)Rules.mak + +DIRS = misc pwd_grp stdio string termios inet signal stdlib sysdeps unistd + +all: halfclean subdirs $(LIBNAME) $(DO_SHARED) done + +$(LIBNAME): subdirs + $(CROSS)ranlib $(LIBNAME) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBNAME) + install -m 644 crt0.o $(LIBNAME) $(TOPDIR)lib + +shared: $(TOPDIR)lib/$(LIBNAME) + @rm -rf tmp + @mkdir tmp + @(cd tmp; CC=$(CC) /bin/sh ../../extra/scripts/get-needed-libgcc-objects.sh) + if [ -s ./tmp/libgcc-need.a ] ; then \ + $(CC) -g $(LDFLAGS) -shared -o $(SHARED_FULLNAME) \ + -Wl,-soname,$(SHARED_MAJORNAME) -Wl,--whole-archive \ + ./$(LIBNAME) ./tmp/libgcc-need.a \ + $(LDSO) ; \ + else \ + $(CC) -g $(LDFLAGS) -shared -o $(SHARED_FULLNAME) \ + -Wl,-soname,$(SHARED_MAJORNAME) -Wl,--whole-archive \ + ./$(LIBNAME) $(LDSO) ; \ + fi + @rm -rf tmp + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(SHARED_FULLNAME) + install -m 644 $(SHARED_FULLNAME) $(TOPDIR)lib + (cd ../lib; ln -sf $(SHARED_FULLNAME) $(SHARED_MAJORNAME)); + + +done: $(LIBNAME) $(DO_SHARED) + @echo + @echo Finally finished compiling... + @echo + +halfclean: + @rm -f $(LIBNAME) crt0.o uClibc_config.h + @rm -f $(SHARED_FULLNAME) $(SHARED_MAJORNAME) uClibc-0.* libc.so* + +headers: dummy + @rm -f include/asm include/linux include/bits + @ln -s $(KERNEL_SOURCE)/include/asm include/asm + @if [ ! -f include/asm/unistd.h ] ; then \ + echo " "; \ + echo "The path '$(KERNEL_SOURCE)/include/asm' doesn't exist."; \ + echo "I bet you didn't set KERNEL_SOURCE, TARGET_ARCH or HAS_MMU in \`Config'"; \ + echo "correctly. Please edit \`Config' and fix these settings."; \ + echo " "; \ + /bin/false; \ + fi; + @if [ $(HAS_MMU) != "true" ] && [ $(TARGET_ARCH) = "i386" ] ; then \ + echo "WARNING: I bet your x86 system really has an MMU, right?"; \ + echo " malloc and friends won't work unless you fix \`Config'"; \ + echo " "; \ + sleep 10; \ + fi; + @ln -s $(KERNEL_SOURCE)/include/linux include/linux + @ln -s ../sysdeps/linux/$(TARGET_ARCH)/bits include/bits + @ln -sf ../../../../uClibc_config.h sysdeps/linux/$(TARGET_ARCH)/bits/uClibc_config.h + + +tags: + ctags -R + +clean: subdirs_clean halfclean + @rm -rf tmp + rm -f include/asm include/linux include/bits + +subdirs: $(patsubst %, _dir_%, $(DIRS)) +subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS)) + +$(patsubst %, _dir_%, $(DIRS)) : dummy + $(MAKE) -C $(patsubst _dir_%, %, $@) + +$(patsubst %, _dirclean_%, $(DIRS)) : dummy + $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean + +.PHONY: dummy subdirs + diff --git a/libc/inet/Makefile b/libc/inet/Makefile index fe5134558..e6ffff694 100644 --- a/libc/inet/Makefile +++ b/libc/inet/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../ +TOPDIR=../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a ifeq ($(strip $(INCLUDE_RPC)),true) DIRS=rpc diff --git a/libc/inet/rpc/Makefile b/libc/inet/rpc/Makefile index b3acc3b08..f2c63bb88 100644 --- a/libc/inet/rpc/Makefile +++ b/libc/inet/rpc/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CFLAGS+=-I$(TOPDIR)include/linux CSRC = auth_none.c auth_unix.c authunix_prot.c \ diff --git a/libc/misc/Makefile b/libc/misc/Makefile index de8b9b3f5..7733c5b80 100644 --- a/libc/misc/Makefile +++ b/libc/misc/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../ +TOPDIR=../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a DIRS = assert ctype dirent fnmatch glob internals lsearch mntent syslog \ diff --git a/libc/misc/assert/Makefile b/libc/misc/assert/Makefile index d6023490f..ad08d3dc9 100644 --- a/libc/misc/assert/Makefile +++ b/libc/misc/assert/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=__assert.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/misc/ctype/Makefile b/libc/misc/ctype/Makefile index a9d5837e5..e0343ba00 100644 --- a/libc/misc/ctype/Makefile +++ b/libc/misc/ctype/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a MSRC=ctype.c MOBJ= isalnum.o isalpha.o isascii.o iscntrl.o isdigit.o isgraph.o \ diff --git a/libc/misc/dirent/Makefile b/libc/misc/dirent/Makefile index 8de2054b6..23b024b63 100644 --- a/libc/misc/dirent/Makefile +++ b/libc/misc/dirent/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=alphasort.c closedir.c dirfd.c opendir.c readdir.c rewinddir.c scandir.c seekdir.c telldir.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/misc/fnmatch/Makefile b/libc/misc/fnmatch/Makefile index ce2ac2a47..d5484f864 100644 --- a/libc/misc/fnmatch/Makefile +++ b/libc/misc/fnmatch/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=fnmatch.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/misc/glob/Makefile b/libc/misc/glob/Makefile index 8254381ea..d6ea09b7e 100644 --- a/libc/misc/glob/Makefile +++ b/libc/misc/glob/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=glob.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/misc/internals/Makefile b/libc/misc/internals/Makefile index b5d23f734..2d0be502c 100644 --- a/libc/misc/internals/Makefile +++ b/libc/misc/internals/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=ultostr.c ltostr.c __uClibc_main.c tempname.c ifeq ($(HAS_FLOATS),true) diff --git a/libc/misc/locale/Makefile b/libc/misc/locale/Makefile index a54a0e38a..e90ada064 100644 --- a/libc/misc/locale/Makefile +++ b/libc/misc/locale/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=locale.c localeconv.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/misc/lock/Makefile b/libc/misc/lock/Makefile index 041ca5404..e197bbb52 100644 --- a/libc/misc/lock/Makefile +++ b/libc/misc/lock/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=flock.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/misc/lsearch/Makefile b/libc/misc/lsearch/Makefile index 5ea47e14d..6506c8c49 100644 --- a/libc/misc/lsearch/Makefile +++ b/libc/misc/lsearch/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=lsearch.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/misc/mntent/Makefile b/libc/misc/mntent/Makefile index ee163c182..297e19f1f 100644 --- a/libc/misc/mntent/Makefile +++ b/libc/misc/mntent/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=mntent.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/misc/regex/Makefile b/libc/misc/regex/Makefile index 89912aa74..30d9d4da0 100644 --- a/libc/misc/regex/Makefile +++ b/libc/misc/regex/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=regex.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/misc/syslog/Makefile b/libc/misc/syslog/Makefile index a52d413ed..deca334f2 100644 --- a/libc/misc/syslog/Makefile +++ b/libc/misc/syslog/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=syslog.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/misc/sysvipc/Makefile b/libc/misc/sysvipc/Makefile index 326535576..d94531788 100644 --- a/libc/misc/sysvipc/Makefile +++ b/libc/misc/sysvipc/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a DIRS= diff --git a/libc/misc/time/Makefile b/libc/misc/time/Makefile index 25dbab14e..4ac8976a1 100644 --- a/libc/misc/time/Makefile +++ b/libc/misc/time/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=localtime.c gmtime.c asctime.c ctime.c asc_conv.c tm_conv.c mktime.c \ localtime_r.c gmtime_r.c asctime_r.c ctime_r.c utimes.c adjtime.c \ diff --git a/libc/misc/tsearch/Makefile b/libc/misc/tsearch/Makefile index c897d2781..3055f6458 100644 --- a/libc/misc/tsearch/Makefile +++ b/libc/misc/tsearch/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a MSRC=tsearch.c MOBJ=tsearch.o tfind.o tdelete.o twalk.o diff --git a/libc/misc/utmp/Makefile b/libc/misc/utmp/Makefile index 01b070f3e..438b5bd78 100644 --- a/libc/misc/utmp/Makefile +++ b/libc/misc/utmp/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=utent.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/pwd_grp/Makefile b/libc/pwd_grp/Makefile index d37efbdf3..d4dd97f01 100644 --- a/libc/pwd_grp/Makefile +++ b/libc/pwd_grp/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../ +TOPDIR=../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC= pwent.c getpwnam.c getpwuid.c putpwent.c getpw.c fgetpwent.c \ __getgrent.c grent.c getgrnam.c getgrgid.c fgetgrent.c \ diff --git a/libc/signal/Makefile b/libc/signal/Makefile index bab67594d..4e588c780 100644 --- a/libc/signal/Makefile +++ b/libc/signal/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../ +TOPDIR=../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=bsd_sig.c raise.c sigblock.c siggtmsk.c sigjmp.c signal.c sigintr.c\ sigpause.c sigstmsk.c sigaddset.c sigdelset.c sigismem.c \ diff --git a/libc/stdio/Makefile b/libc/stdio/Makefile index 3aec83dd1..c9130c0d7 100644 --- a/libc/stdio/Makefile +++ b/libc/stdio/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../ +TOPDIR=../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a MSRC=stdio.c MOBJ=_stdio_init.o \ diff --git a/libc/stdlib/Makefile b/libc/stdlib/Makefile index 7bf0d5331..c8fde662b 100644 --- a/libc/stdlib/Makefile +++ b/libc/stdlib/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../ +TOPDIR=../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a DIRS = $(MALLOC) ALL_SUBDIRS = malloc malloc-930716 malloc-simple diff --git a/libc/stdlib/malloc-930716/Makefile b/libc/stdlib/malloc-930716/Makefile index a4ae21798..208c1a68d 100644 --- a/libc/stdlib/malloc-930716/Makefile +++ b/libc/stdlib/malloc-930716/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC=calloc.c free.c malloc.c memalign.c morecore.c realloc.c valloc.c COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/stdlib/malloc-simple/Makefile b/libc/stdlib/malloc-simple/Makefile index cc2c132b2..a84578a0a 100644 --- a/libc/stdlib/malloc-simple/Makefile +++ b/libc/stdlib/malloc-simple/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a MSRC=alloc.c MOBJ=malloc.o realloc.o free.o calloc.o malloc_dbg.o free_dbg.o calloc_dbg.o diff --git a/libc/stdlib/malloc/Makefile b/libc/stdlib/malloc/Makefile index c2190dcdc..a280144d3 100644 --- a/libc/stdlib/malloc/Makefile +++ b/libc/stdlib/malloc/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a MSRC=alloc.c MOBJ=malloc_dbg.o free_dbg.o calloc_dbg.o realloc_dbg.o diff --git a/libc/string/Makefile b/libc/string/Makefile index 4d0a95da8..e2d04c3f9 100644 --- a/libc/string/Makefile +++ b/libc/string/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../ +TOPDIR=../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a MSRC=string.c MOBJ=strlen.o strcat.o strcpy.o strchr.o strcmp.o strncat.o strncpy.o \ diff --git a/libc/sysdeps/Makefile b/libc/sysdeps/Makefile index 51f86ea4c..cf35e3752 100644 --- a/libc/sysdeps/Makefile +++ b/libc/sysdeps/Makefile @@ -22,9 +22,7 @@ DIRS = linux -all: libc.a - -libc.a: subdirs +all: subdirs tags: ctags -R diff --git a/libc/sysdeps/linux/Makefile b/libc/sysdeps/linux/Makefile index 87aa1f3a3..db3fcb36c 100644 --- a/libc/sysdeps/linux/Makefile +++ b/libc/sysdeps/linux/Makefile @@ -20,15 +20,13 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../ +TOPDIR=../../../ include $(TOPDIR)Rules.mak DIRS = common $(TARGET_ARCH) ALL_SUBDIRS = arm common i386 m68k powerpc sh sparc -all: libc.a - -libc.a: subdirs +all: subdirs tags: ctags -R diff --git a/libc/sysdeps/linux/arm/Makefile b/libc/sysdeps/linux/arm/Makefile index 7dee13aa9..f63b5ff62 100644 --- a/libc/sysdeps/linux/arm/Makefile +++ b/libc/sysdeps/linux/arm/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../../ +TOPDIR=../../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a ASFLAGS=$(CFLAGS) TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) @@ -32,7 +31,6 @@ ifeq ($(TARGET_MACHINE_TYPE),arm-pic-elf) else CRT0=crt0.S endif - CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0)) SSRC=longjmp.S setjmp.S vfork.S @@ -50,7 +48,7 @@ $(LIBC): ar-target ar-target: $(OBJS) $(CRT0_OBJ) $(AR) $(ARFLAGS) $(LIBC) $(OBJS) - cp $(CRT0_OBJ) $(TOPDIR)crt0.o + cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ) $(CRT0_OBJ): %.o : %.S $(CC) $(CFLAGS) -c $< -o $@ diff --git a/libc/sysdeps/linux/common/Makefile b/libc/sysdeps/linux/common/Makefile index 8617c0b71..1e1957227 100644 --- a/libc/sysdeps/linux/common/Makefile +++ b/libc/sysdeps/linux/common/Makefile @@ -21,9 +21,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../../ +TOPDIR=../../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a CSRC= waitpid.c getdents.c kernel_version.c statfix.c getdnnm.c tell.c gethstnm.c \ mkfifo.c setegid.c wait.c errno.c getpagesize.c seteuid.c wait3.c setpgrp.c \ diff --git a/libc/sysdeps/linux/i386/Makefile b/libc/sysdeps/linux/i386/Makefile index 45aa84777..afca6bd82 100644 --- a/libc/sysdeps/linux/i386/Makefile +++ b/libc/sysdeps/linux/i386/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../../ +TOPDIR=../../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a ASFLAGS=$(CFLAGS) CRT0=crt0.S @@ -46,7 +45,7 @@ $(LIBC): ar-target ar-target: $(OBJS) $(CRT0_OBJ) $(AR) $(ARFLAGS) $(LIBC) $(OBJS) - cp $(CRT0_OBJ) $(TOPDIR)$(CRT0_OBJ) + cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ) $(CRT0_OBJ): %.o : %.S $(CC) $(CFLAGS) -c $< -o $@ diff --git a/libc/sysdeps/linux/m68k/Makefile b/libc/sysdeps/linux/m68k/Makefile index 3dccba6ee..d79f0e33c 100644 --- a/libc/sysdeps/linux/m68k/Makefile +++ b/libc/sysdeps/linux/m68k/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../../ +TOPDIR=../../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a ASFLAGS=$(CFLAGS) # If you're looking for vfork(), it is defined in include/unistd.h @@ -46,7 +45,7 @@ $(LIBC): ar-target ar-target: $(OBJS) $(CRT0_OBJ) $(AR) $(ARFLAGS) $(LIBC) $(OBJS) - cp $(CRT0_OBJ) $(TOPDIR)$(CRT0_OBJ) + cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ) $(CRT0_OBJ): %.o : %.S $(CC) $(CFLAGS) -c $< -o $@ diff --git a/libc/sysdeps/linux/powerpc/Makefile b/libc/sysdeps/linux/powerpc/Makefile index c738d449b..d877b85e3 100644 --- a/libc/sysdeps/linux/powerpc/Makefile +++ b/libc/sysdeps/linux/powerpc/Makefile @@ -22,9 +22,8 @@ USE_CRT0_C=y -TOPDIR=../../../ +TOPDIR=../../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a ASFLAGS=$(CFLAGS) TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) @@ -34,8 +33,7 @@ CRT0=crt0.c else CRT0=crt0.S endif - -CRT0_OBJ=crt0.o +CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0)) SSRC=longjmp.S setjmp.S vfork.S SOBJS=$(patsubst %.S,%.o, $(SSRC)) @@ -53,7 +51,7 @@ $(LIBC): ar-target ar-target: $(OBJS) $(CRT0_OBJ) $(AR) $(ARFLAGS) $(LIBC) $(OBJS) - cp $(CRT0_OBJ) $(TOPDIR)crt0.o + cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ) ifeq ($(USE_CRT0_C),y) $(CRT0_OBJ): %.o : %.c diff --git a/libc/sysdeps/linux/sh/Makefile b/libc/sysdeps/linux/sh/Makefile index e936ee1b7..f36dca0fa 100644 --- a/libc/sysdeps/linux/sh/Makefile +++ b/libc/sysdeps/linux/sh/Makefile @@ -21,9 +21,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../../ +TOPDIR=../../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a ASFLAGS=$(CFLAGS) CFLAGS+= -I../ -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl @@ -31,7 +30,6 @@ CFLAGS+= -I../ -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) CRT0=crt0.S - CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0)) SSRC=setjmp.S bsd-setjmp.S bsd-_setjmp.S __longjmp.S @@ -49,7 +47,7 @@ $(LIBC): ar-target ar-target: $(OBJS) $(CRT0_OBJ) $(AR) $(ARFLAGS) $(LIBC) $(OBJS) - cp $(CRT0_OBJ) $(TOPDIR)crt0.o + cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ) $(CRT0_OBJ): %.o : %.S $(CC) $(CFLAGS) -c $< -o $@ diff --git a/libc/sysdeps/linux/sparc/Makefile b/libc/sysdeps/linux/sparc/Makefile index fdc802b89..ba1c37f99 100644 --- a/libc/sysdeps/linux/sparc/Makefile +++ b/libc/sysdeps/linux/sparc/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../../../ +TOPDIR=../../../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a ASFLAGS=$(CFLAGS) CRT0=crt0.S @@ -46,7 +45,7 @@ $(LIBC): ar-target ar-target: $(OBJS) $(CRT0_OBJ) $(AR) $(ARFLAGS) $(LIBC) $(OBJS) - cp $(CRT0_OBJ) $(TOPDIR)$(CRT0_OBJ) + cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ) $(CRT0_OBJ): %.o : %.S $(CC) $(CFLAGS) -c $< -o $@ diff --git a/libc/termios/Makefile b/libc/termios/Makefile index 8b1f9e2ea..77adfdcfc 100644 --- a/libc/termios/Makefile +++ b/libc/termios/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../ +TOPDIR=../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a MSRC=termios.c MOBJ= tcdrain.o tcflow.o tcflush.o tcsendbreak.o tcsetpgrp.o tcgetpgrp.o \ diff --git a/libc/unistd/Makefile b/libc/unistd/Makefile index 7376b73a9..5b7e8df34 100644 --- a/libc/unistd/Makefile +++ b/libc/unistd/Makefile @@ -20,9 +20,8 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -TOPDIR=../ +TOPDIR=../../ include $(TOPDIR)Rules.mak -LIBC=$(TOPDIR)libc.a DIRS:= CSRC=execl.c execlp.c execv.c execvep.c execvp.c execle.c getcwd.c getopt.c \ |