Browse Source

merge parallel build support

Mike Frysinger 19 years ago
parent
commit
130697527b
68 changed files with 303 additions and 341 deletions
  1. 1 0
      libc/.cvsignore
  2. 25 1
      libc/Makefile
  3. 4 6
      libc/inet/Makefile
  4. 4 5
      libc/inet/rpc/Makefile
  5. 1 4
      libc/misc/Makefile
  6. 4 4
      libc/misc/assert/Makefile
  7. 4 5
      libc/misc/ctype/Makefile
  8. 4 5
      libc/misc/dirent/Makefile
  9. 4 5
      libc/misc/error/Makefile
  10. 4 5
      libc/misc/file/Makefile
  11. 4 5
      libc/misc/fnmatch/Makefile
  12. 4 5
      libc/misc/ftw/Makefile
  13. 4 5
      libc/misc/glob/Makefile
  14. 4 4
      libc/misc/gnu/Makefile
  15. 4 5
      libc/misc/internals/Makefile
  16. 4 5
      libc/misc/intl/Makefile
  17. 4 5
      libc/misc/locale/Makefile
  18. 4 5
      libc/misc/mntent/Makefile
  19. 4 5
      libc/misc/pthread/Makefile
  20. 4 5
      libc/misc/regex/Makefile
  21. 4 5
      libc/misc/search/Makefile
  22. 4 6
      libc/misc/statfs/Makefile
  23. 4 5
      libc/misc/syslog/Makefile
  24. 4 6
      libc/misc/sysvipc/Makefile
  25. 4 5
      libc/misc/time/Makefile
  26. 4 5
      libc/misc/ttyent/Makefile
  27. 4 4
      libc/misc/utmp/Makefile
  28. 4 5
      libc/misc/wchar/Makefile
  29. 4 5
      libc/misc/wctype/Makefile
  30. 4 5
      libc/misc/wordexp/Makefile
  31. 4 4
      libc/pwd_grp/Makefile
  32. 4 4
      libc/signal/Makefile
  33. 5 7
      libc/stdio/Makefile
  34. 4 6
      libc/stdlib/Makefile
  35. 5 7
      libc/stdlib/malloc-simple/Makefile
  36. 4 5
      libc/stdlib/malloc-standard/Makefile
  37. 4 4
      libc/stdlib/malloc/Makefile
  38. 4 5
      libc/string/Makefile
  39. 5 5
      libc/string/arm/Makefile
  40. 4 5
      libc/string/frv/Makefile
  41. 4 6
      libc/string/generic/Makefile
  42. 4 5
      libc/string/i386/Makefile
  43. 5 5
      libc/string/mips/Makefile
  44. 4 5
      libc/string/powerpc/Makefile
  45. 5 5
      libc/string/sh64/Makefile
  46. 0 2
      libc/sysdeps/Makefile
  47. 0 2
      libc/sysdeps/linux/Makefile
  48. 5 5
      libc/sysdeps/linux/alpha/Makefile
  49. 5 6
      libc/sysdeps/linux/arm/Makefile
  50. 5 5
      libc/sysdeps/linux/bfin/Makefile
  51. 5 5
      libc/sysdeps/linux/common/Makefile
  52. 5 6
      libc/sysdeps/linux/cris/Makefile
  53. 5 7
      libc/sysdeps/linux/e1/Makefile
  54. 5 6
      libc/sysdeps/linux/h8300/Makefile
  55. 5 6
      libc/sysdeps/linux/i386/Makefile
  56. 5 7
      libc/sysdeps/linux/i960/Makefile
  57. 5 4
      libc/sysdeps/linux/m68k/Makefile
  58. 5 6
      libc/sysdeps/linux/microblaze/Makefile
  59. 5 5
      libc/sysdeps/linux/mips/Makefile
  60. 5 6
      libc/sysdeps/linux/nios/Makefile
  61. 5 6
      libc/sysdeps/linux/nios2/Makefile
  62. 5 6
      libc/sysdeps/linux/powerpc/Makefile
  63. 5 6
      libc/sysdeps/linux/sh/Makefile
  64. 5 6
      libc/sysdeps/linux/sh64/Makefile
  65. 5 5
      libc/sysdeps/linux/sparc/Makefile
  66. 5 6
      libc/sysdeps/linux/v850/Makefile
  67. 4 6
      libc/termios/Makefile
  68. 4 4
      libc/unistd/Makefile

+ 1 - 0
libc/.cvsignore

@@ -1 +1,2 @@
 tmp
+obj.*

+ 25 - 1
libc/Makefile

@@ -37,10 +37,33 @@ DIRS = misc pwd_grp stdio string termios inet signal stdlib sysdeps unistd
 VERSION_SCRIPT:=${shell if [ -f sysdeps/linux/$(TARGET_ARCH)/libc.map ] ; then \
         echo "--version-script sysdeps/linux/$(TARGET_ARCH)/libc.map"; fi}
 
-all: halfclean $(LIBNAME) $(DO_SHARED)
+LIBNAME_TARGET:=$(TOPDIR)lib/$(LIBNAME)
 
+all: halfclean $(LIBNAME_TARGET) $(DO_SHARED)
+
+# Some functions are duplicated across subdirs, and when you pass $(AR)
+# the same object file more than once, it'll add it to the archive multiple 
+# times (boo!).  So what we do here is:
+#  - import all the objects (thus we may have dupes)
+#  - delete all the dupes
+#  - re-import certain objects based upon preference
+#    - the sysdeps dir should override all other symbols for example
+# We need to use shell globbing with obj.* because if we use make's wildcard,
+# the wildcard will be evaluated when `make` is run instead of when the make 
+# target is evaluated.  That means if you run `rm obj.* ; make`, the wildcard 
+# will evaluate to no files :(.
 $(LIBNAME) ar-target: subdirs
+	objs=`cat obj.*` ; $(AR) $(ARFLAGS) $(LIBNAME) $$objs
+	objs=`cat obj.*` ; $(AR) dN 2 $(LIBNAME) $$objs
+	@for objfile in obj.signal obj.string.generic obj.string \
+	               obj.sysdeps.$(TARGET_ARCH) obj.sysdeps.common ; do \
+		echo $(AR) $(ARFLAGS) $(LIBNAME) $$objfile ; \
+		objs=`cat $$objfile` ; \
+		$(AR) $(ARFLAGS) $(LIBNAME) $$objs || exit 1 ; \
+	done
 	$(RANLIB) $(LIBNAME)
+
+$(LIBNAME_TARGET): $(LIBNAME)
 	$(INSTALL) -d $(TOPDIR)lib
 	$(RM) $(TOPDIR)lib/$(LIBNAME)
 	$(INSTALL) -m 644 $(LIBNAME) $(TOPDIR)lib
@@ -67,6 +90,7 @@ tags:
 clean: subdirs_clean halfclean
 	@$(RM) -r tmp
 	$(RM) include/asm include/linux include/bits
+	$(RM) obj.*
 
 subdirs: $(patsubst %, _dir_%, $(DIRS))
 subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))

+ 4 - 6
libc/inet/Makefile

@@ -58,13 +58,12 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(MOBJ) $(MOBJ2) $(MOBJ3) $(COBJS)
 
+OBJ_LIST=../obj.inet
 
-all: $(OBJS) $(LIBC)
+all: $(OBJ_LIST) subdirs
 
-$(LIBC): ar-target subdirs
-
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, inet/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -95,4 +94,3 @@ $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
 	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
 
 .PHONY: dummy
-

+ 4 - 5
libc/inet/rpc/Makefile

@@ -50,12 +50,12 @@ endif
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: ar-target
+OBJ_LIST=../../obj.inet.rpc
 
-$(LIBC): $(OBJS)
+all: $(OBJ_LIST)
 
-ar-target: $(LIBC)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, inet/rpc/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -63,4 +63,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 1 - 4
libc/misc/Makefile

@@ -50,9 +50,7 @@ ifeq ($(strip $(UCLIBC_HAS_GLOB)),y)
 DIRS += glob
 endif
 
-all: libc.a
-
-libc.a: subdirs
+all: subdirs
 
 tags:
 	ctags -R
@@ -70,4 +68,3 @@ $(patsubst %, _dirclean_%, $(DIRS)) : dummy
 	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
 
 .PHONY: dummy
-

+ 4 - 4
libc/misc/assert/Makefile

@@ -28,12 +28,12 @@ CSRC=__assert.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(LIBC)
+OBJ_LIST=../../obj.misc.assert
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/assert/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@

+ 4 - 5
libc/misc/ctype/Makefile

@@ -47,12 +47,12 @@ ifeq ($(UCLIBC_HAS_XLOCALE),y)
 	OBJS += $(MOBJx)
 endif
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.ctype
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/ctype/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -66,4 +66,3 @@ $(OBJS): Makefile
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/dirent/Makefile

@@ -30,12 +30,12 @@ CSRC=alphasort.c closedir.c dirfd.c opendir.c readdir.c rewinddir.c scandir.c \
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.dirent
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/dirent/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -43,4 +43,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/error/Makefile

@@ -23,12 +23,12 @@ CSRC=error.c err.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.error
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/error/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -36,4 +36,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/file/Makefile

@@ -32,12 +32,12 @@ endif
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.file
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/file/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -45,4 +45,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/fnmatch/Makefile

@@ -28,12 +28,12 @@ CSRC=fnmatch.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.fnmatch
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/fnmatch/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -41,4 +41,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/ftw/Makefile

@@ -27,12 +27,12 @@ MSRC=ftw.c
 MOBJ=ftw.o ftw64.o
 OBJS=$(MOBJ)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.ftw
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/ftw/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -40,4 +40,3 @@ $(MOBJ): $(MSRC)
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/glob/Makefile

@@ -28,12 +28,12 @@ CSRC=glob.c glob64.c glob-hooks.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.glob
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/glob/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -43,4 +43,3 @@ glob64.o: glob64.c glob.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 4
libc/misc/gnu/Makefile

@@ -28,12 +28,12 @@ CSRC=obstack.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(LIBC)
+OBJ_LIST=../../obj.misc.gnu
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/gnu/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@

+ 4 - 5
libc/misc/internals/Makefile

@@ -29,12 +29,12 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(COBJS)
 
-all: $(OBJS) interp.o $(LIBC)
+OBJ_LIST=../../obj.misc.internals
 
-$(LIBC): interp.c ar-target
+all: $(OBJ_LIST) interp.o
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/internals/%, $(OBJS)) > $(OBJ_LIST)
 
 interp.c: Makefile
 	echo "/* Force shared libraries to know about the correct library loader */" > interp.c
@@ -54,4 +54,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] interp.c *~ core
-

+ 4 - 5
libc/misc/intl/Makefile

@@ -30,12 +30,12 @@ MOBJ= __uClibc_dgettext.o __uClibc_dcgettext.o \
 
 OBJS=$(MOBJ)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.intl
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/intl/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -47,4 +47,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/locale/Makefile

@@ -43,13 +43,12 @@ endif
 
 OBJS= $(MOBJ) $(MOBJx) $(DATA)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.locale
 
+all: $(OBJ_LIST)
 
-$(LIBC): ar-target
-
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/locale/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o

+ 4 - 5
libc/misc/mntent/Makefile

@@ -28,12 +28,12 @@ CSRC=mntent.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.mntent
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/mntent/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -41,4 +41,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/pthread/Makefile

@@ -33,12 +33,12 @@ CSRC=no-tsd.c weaks.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.pthread
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/pthread/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -46,4 +46,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/regex/Makefile

@@ -28,12 +28,12 @@ CSRC=regex.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.regex
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/regex/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -41,4 +41,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/search/Makefile

@@ -41,12 +41,12 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(COBJS) $(MOBJ1) $(MOBJ2) $(MOBJ3) $(MOBJ4)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.search
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target:  $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/search/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ1): $(MSRC1)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -70,4 +70,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 6
libc/misc/statfs/Makefile

@@ -30,13 +30,12 @@ endif
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
+OBJ_LIST=../../obj.misc.statfs
 
-all: $(OBJS) $(LIBC)
+all: $(OBJ_LIST)
 
-$(LIBC): ar-target
-
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/statfs/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -44,4 +43,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/syslog/Makefile

@@ -28,12 +28,12 @@ CSRC=syslog.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.syslog
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/syslog/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -41,4 +41,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 6
libc/misc/sysvipc/Makefile

@@ -40,13 +40,12 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(MOBJ) $(MOBJ2) $(MOBJ3) $(COBJS)
 
+OBJ_LIST=../../obj.misc.sysvipc
 
-all: $(OBJS) $(LIBC)
+all: $(OBJ_LIST)
 
-$(LIBC): ar-target subdirs
-
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/sysvipc/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -77,4 +76,3 @@ $(patsubst %, _dirclean_%, $(DIRS)) : dummy
 	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
 
 .PHONY: dummy
-

+ 4 - 5
libc/misc/time/Makefile

@@ -50,12 +50,12 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(COBJS) $(MOBJ) $(MOBJx)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.time
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/time/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -71,4 +71,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/ttyent/Makefile

@@ -23,12 +23,12 @@ CSRC=getttyent.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.ttyent
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/ttyent/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -36,4 +36,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 4
libc/misc/utmp/Makefile

@@ -28,12 +28,12 @@ CSRC=utent.c wtent.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(LIBC)
+OBJ_LIST=../../obj.misc.utmp
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/utmp/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@

+ 4 - 5
libc/misc/wchar/Makefile

@@ -45,12 +45,12 @@ endif
 
 OBJS=$(MOBJ1)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.wchar
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/wchar/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ1): $(MSRC1)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -62,4 +62,3 @@ $(MOBJ2): $(MSRC2)
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/wctype/Makefile

@@ -41,12 +41,12 @@ ifeq ($(UCLIBC_HAS_XLOCALE),y)
 	OBJS += $(MOBJx)
 endif
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.wctype
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/wctype/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -58,4 +58,3 @@ $(MOBJx): $(MSRC)
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/misc/wordexp/Makefile

@@ -23,12 +23,12 @@ CSRC=wordexp.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.misc.wordexp
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, misc/wordexp/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -36,4 +36,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 4
libc/pwd_grp/Makefile

@@ -46,12 +46,12 @@ endif
 COBJ=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(MOBJ) $(COBJ)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../obj.pwd_grp
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, pwd_grp/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o

+ 4 - 4
libc/signal/Makefile

@@ -28,12 +28,12 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../obj.signal
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, signal/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@

+ 5 - 7
libc/stdio/Makefile

@@ -118,13 +118,12 @@ ifeq ($(strip $(UCLIBC_HAS_LFS)),y)
 OBJS += $(CLOBJS)
 endif
 
+OBJ_LIST=../obj.stdio
 
-all: $(OBJS) $(LIBC)
+all: $(OBJ_LIST)
 
-$(LIBC): ar-target
-
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, stdio/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -153,5 +152,4 @@ $(MWOBJ): $(MWSRC)
 $(OBJ): Makefile
 
 clean:
-	rm -f *.[oa] *~ core
-
+	$(RM) *.[oa] *~ core

+ 4 - 6
libc/stdlib/Makefile

@@ -94,12 +94,12 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(MOBJ) $(MOBJx) $(MOBJ1) $(MOBJ1x) $(MOBJ2) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../obj.stdlib
 
-$(LIBC): ar-target subdirs
+all: $(OBJ_LIST) subdirs
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, stdlib/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -140,5 +140,3 @@ clean: subdirs_clean
 	$(RM) *.[oa] *~ core
 
 .PHONY: dummy
-
-

+ 5 - 7
libc/stdlib/malloc-simple/Makefile

@@ -27,18 +27,16 @@ MSRC=alloc.c
 MOBJ=malloc.o realloc.o free.o calloc.o memalign.o
 OBJS=$(MOBJ)
 
+OBJ_LIST=../../obj.stdlib.malloc-simple
 
-all: $(OBJS) $(LIBC)
+all: $(OBJ_LIST)
 
-$(LIBC): ar-target
-
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, stdlib/malloc-simple/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
 	$(STRIPTOOL) -x -R .note -R .comment $*.o
 
 clean:
-	rm -f *.[oa] *~ core
-
+	$(RM) *.[oa] *~ core

+ 4 - 5
libc/stdlib/malloc-standard/Makefile

@@ -35,12 +35,12 @@ CSRC=malloc.c calloc.c realloc.c free.c memalign.c mallopt.c mallinfo.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.stdlib.malloc-standard
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, stdlib/malloc-standard/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -48,4 +48,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 4
libc/stdlib/malloc/Makefile

@@ -39,12 +39,12 @@ endif
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.stdlib.malloc
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, stdlib/malloc/%, $(OBJS)) > $(OBJ_LIST)
 
 malloc.o free.o realloc.o memalign.o: malloc.h
 $(COBJS): heap.h

+ 4 - 5
libc/string/Makefile

@@ -67,12 +67,12 @@ ifeq ($(UCLIBC_HAS_WCHAR),y)
 	OBJS += $(MOBJW) $(MOBJWx)
 endif
 
-all: $(LIBC) subdirs
+OBJ_LIST=../obj.string
 
-$(LIBC): ar-target
+all: $(OBJ_LIST) subdirs
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, string/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -107,4 +107,3 @@ $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
 	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
 
 .PHONY: dummy
-

+ 5 - 5
libc/string/arm/Makefile

@@ -22,13 +22,14 @@ include $(TOPDIR)Rules.mak
 SSRC= _memcpy.S bcopy.S bzero.S memcmp.S memcpy.S memmove.S memset.S \
 	strcmp.S strlen.S strncmp.S
 SOBJS=$(patsubst %.S,%.o, $(SSRC))
+OBJS=$(SOBJS)
 
-all: $(SOBJS) $(LIBC)
+OBJ_LIST=../../obj.string.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(SOBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(SOBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
 
 $(SOBJS): %.o : %.S
 	$(CC) $(ASFLAGS) -c $< -o $@
@@ -36,4 +37,3 @@ $(SOBJS): %.o : %.S
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/string/frv/Makefile

@@ -23,12 +23,12 @@ SSRC=memcpy.S memset.S
 SOBJS=$(patsubst %.S,%.o, $(SSRC))
 OBJS=$(SOBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.string.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
 
 $(SOBJS): %.o : %.S
 	$(CC) $(ASFLAGS) -c $< -o $@
@@ -36,4 +36,3 @@ $(SOBJS): %.o : %.S
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 6
libc/string/generic/Makefile

@@ -25,15 +25,14 @@ CSRC=	memchr.c memcmp.c memcpy.c memmem.c memmove.c mempcpy.c memrchr.c \
 	strrchr.c strsep.c strspn.c strstr.c strtok_r.c
 
 COBJS=$(patsubst %.c,%.o, $(CSRC))
-
 OBJS=$(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.string.generic
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, string/generic/%, $(OBJS)) > $(OBJ_LIST)
 
 # $(MOBJ): $(MSRC)
 # 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -45,4 +44,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/string/i386/Makefile

@@ -25,12 +25,12 @@ MOBJ= strcpy.o strncpy.o strcat.o strncat.o strcmp.o \
 	memcpy.o memmove.o memchr.o memset.o 
 OBJS=$(MOBJ)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.string.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -42,4 +42,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 5 - 5
libc/string/mips/Makefile

@@ -21,13 +21,14 @@ include $(TOPDIR)Rules.mak
 
 SSRC= memcpy.S memset.S
 SOBJS=$(patsubst %.S,%.o, $(SSRC))
+OBJS=$(SOBJS)
 
-all: $(SOBJS) $(LIBC)
+OBJ_LIST=../../obj.string.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(SOBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(SOBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
 
 $(SOBJS): %.o : %.S
 	$(CC) $(ASFLAGS) -c $< -o $@
@@ -35,4 +36,3 @@ $(SOBJS): %.o : %.S
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 5
libc/string/powerpc/Makefile

@@ -23,12 +23,12 @@ MSRC= string.c
 MOBJ= memcpy.o memmove.o memset.o bzero.o 
 OBJS=$(MOBJ)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../obj.string.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -40,4 +40,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 5 - 5
libc/string/sh64/Makefile

@@ -21,13 +21,14 @@ include $(TOPDIR)Rules.mak
 
 SSRC= memcpy.S memset.S strcpy.S strlen.S
 SOBJS=$(patsubst %.S,%.o, $(SSRC))
+OBJS=$(SOBJS)
 
-all: $(SOBJS) $(LIBC)
+OBJ_LIST=../../obj.string.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(SOBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(SOBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, string/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
 
 $(SOBJS): %.o : %.S
 	$(CC) $(ASFLAGS) -c $< -o $@
@@ -35,4 +36,3 @@ $(SOBJS): %.o : %.S
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 0 - 2
libc/sysdeps/Makefile

@@ -34,6 +34,4 @@ $(patsubst %, _dir_%, $(DIRS)) : dummy
 $(patsubst %, _dirclean_%, $(DIRS)) : dummy
 	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
 
-
 .PHONY: dummy
-

+ 0 - 2
libc/sysdeps/linux/Makefile

@@ -39,6 +39,4 @@ subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
 $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
 	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
 
-
 .PHONY: dummy $(TARGET_ARCH)
-

+ 5 - 5
libc/sysdeps/linux/alpha/Makefile

@@ -32,12 +32,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -75,7 +76,6 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 	$(LN) -fs ../libc/sysdeps/linux/alpha/fpu_control.h $(TOPDIR)/include/
 

+ 5 - 6
libc/sysdeps/linux/arm/Makefile

@@ -33,12 +33,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(MOBJ) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -76,7 +77,6 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 	$(LN) -fs ../libc/sysdeps/linux/arm/fpu_control.h $(TOPDIR)/include/
 
@@ -84,4 +84,3 @@ clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
 	$(RM) gmon-start.S
-

+ 5 - 5
libc/sysdeps/linux/bfin/Makefile

@@ -32,13 +32,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(MOBJ) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
-	mkdir -p $(TOPDIR)lib/
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)

+ 5 - 5
libc/sysdeps/linux/common/Makefile

@@ -63,14 +63,14 @@ endif
 
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 
-OBJ=$(COBJS) $(MOBJ)
+OBJS=$(COBJS) $(MOBJ)
 
-all: $(STR_SYSCALLS) $(OBJ) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.common
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJ)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJ)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, sysdeps/linux/common/%, $(OBJS)) > $(OBJ_LIST)
 
 $(COBJS): %.o : %.c
 	$(CC) $(CFLAGS) -c $< -o $@

+ 5 - 6
libc/sysdeps/linux/cris/Makefile

@@ -34,12 +34,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -77,9 +78,7 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 5 - 7
libc/sysdeps/linux/e1/Makefile

@@ -37,12 +37,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(MOBJ) $(COBJS) $(CRT0_OBJ)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/$(CRT0_OBJ)
 
 $(CRT0_OBJ): %.o : %.S
@@ -80,14 +81,11 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 
-
 clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
 ifneq ($(strip $(HAVE_ELF)),y)
 	$(RM) $(TOPDIR)/include/float.h
 endif
-

+ 5 - 6
libc/sysdeps/linux/h8300/Makefile

@@ -37,12 +37,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -80,9 +81,7 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 5 - 6
libc/sysdeps/linux/i386/Makefile

@@ -34,12 +34,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(SCRT0_OBJ) $(TOPDIR)lib/
 ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
 	$(RM) $(TOPDIR)lib/Scrt0.o
@@ -86,7 +87,6 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 	$(LN) -fs ../libc/sysdeps/linux/i386/fpu_control.h $(TOPDIR)/include/
 
@@ -95,4 +95,3 @@ clean:
 	$(RM) bits/sysnum.h
 	$(RM) $(TOPDIR)/include/fpu_control.h
 	$(RM) gmon-start.S
-

+ 5 - 7
libc/sysdeps/linux/i960/Makefile

@@ -34,12 +34,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -77,11 +78,8 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 
-
 clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
-

+ 5 - 4
libc/sysdeps/linux/m68k/Makefile

@@ -38,12 +38,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(MOBJ) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)

+ 5 - 6
libc/sysdeps/linux/microblaze/Makefile

@@ -40,12 +40,13 @@ COBJS = $(patsubst %.c,%.o, $(CSRC))
 
 OBJS = $(SOBJS) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -83,10 +84,8 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 
 clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
-

+ 5 - 5
libc/sysdeps/linux/mips/Makefile

@@ -32,12 +32,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(MOBJ) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 	$(LN) -fs $(CRT0_OBJ) $(TOPDIR)/lib/crt0.o
 	$(LN) -fs $(CRT0_OBJ) $(TOPDIR)/lib/Scrt1.o
@@ -78,7 +79,6 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 	$(LN) -fs ../libc/sysdeps/linux/mips/sgidefs.h $(TOPDIR)/include/
 #	$(LN) -fs ../libc/sysdeps/linux/mips/regdef.h $(TOPDIR)/include/

+ 5 - 6
libc/sysdeps/linux/nios/Makefile

@@ -31,12 +31,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(MOBJ) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -74,7 +75,6 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 	$(LN) -fs ../libc/sysdeps/linux/nios/fpu_control.h $(TOPDIR)/include/
 
@@ -82,4 +82,3 @@ clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
 	$(RM) $(TOPDIR)/include/fpu_control.h
-	

+ 5 - 6
libc/sysdeps/linux/nios2/Makefile

@@ -31,12 +31,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(MOBJ) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -74,7 +75,6 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 	$(LN) -fs ../libc/sysdeps/linux/nios2/fpu_control.h $(TOPDIR)/include/
 
@@ -82,4 +82,3 @@ clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
 	$(RM) $(TOPDIR)/include/fpu_control.h
-	

+ 5 - 6
libc/sysdeps/linux/powerpc/Makefile

@@ -34,12 +34,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(SCRT0_OBJ) $(TOPDIR)lib/
 ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
 	$(RM) $(TOPDIR)lib/Scrt0.o
@@ -87,7 +88,6 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 	$(LN) -fs ../libc/sysdeps/linux/powerpc/fpu_control.h $(TOPDIR)/include/
 
@@ -95,4 +95,3 @@ clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
 	$(RM) gmon-start.S
-

+ 5 - 6
libc/sysdeps/linux/sh/Makefile

@@ -36,12 +36,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(MOBJ) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -79,7 +80,6 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 	$(LN) -fs ../libc/sysdeps/linux/sh/fpu_control.h $(TOPDIR)/include/
 
@@ -87,4 +87,3 @@ clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
 	$(RM) gmon-start.S
-

+ 5 - 6
libc/sysdeps/linux/sh64/Makefile

@@ -37,12 +37,13 @@ COBJS = $(patsubst %.c,%.o, $(CSRC))
 
 OBJS = $(SOBJS) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -80,10 +81,8 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 
 clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
-

+ 5 - 5
libc/sysdeps/linux/sparc/Makefile

@@ -32,12 +32,13 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 
 OBJS=$(SOBJS) $(MOBJ) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target 
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -75,7 +76,6 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 	$(LN) -fs ../libc/sysdeps/linux/sparc/fpu_control.h $(TOPDIR)/include/
 

+ 5 - 6
libc/sysdeps/linux/v850/Makefile

@@ -37,12 +37,13 @@ COBJS = $(patsubst %.c,%.o, $(CSRC))
 
 OBJS = $(SOBJS) $(COBJS)
 
-all: $(OBJS) $(LIBC)
+OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
 
-$(LIBC): ar-target
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
+	$(INSTALL) -d $(TOPDIR)lib/
 	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
 $(CRT0_OBJ): $(CRT0_SRC)
@@ -80,10 +81,8 @@ $(TOPDIR)lib/crtn.o:
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
-
 headers:
 
 clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
-

+ 4 - 6
libc/termios/Makefile

@@ -34,13 +34,12 @@ CSRC=tcgetattr.c tcgetsid.c tcsetattr.c ttyname.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(MOBJ) $(COBJS)
 
+OBJ_LIST=../obj.termios
 
-all: $(OBJS) $(LIBC)
+all: $(OBJ_LIST)
 
-$(LIBC): ar-target
-
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, termios/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ): $(MSRC)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
@@ -52,4 +51,3 @@ $(COBJS): %.o : %.c
 
 clean:
 	$(RM) *.[oa] *~ core
-

+ 4 - 4
libc/unistd/Makefile

@@ -42,12 +42,12 @@ endif
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS) $(MOBJ1)
 
-all: $(SYSCONF) $(OBJS) $(LIBC)
+OBJ_LIST=../obj.unistd
 
-$(LIBC): ar-target subdirs
+all: $(OBJ_LIST)
 
-ar-target: $(OBJS)
-	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+$(OBJ_LIST): $(OBJS)
+	echo $(patsubst %, unistd/%, $(OBJS)) > $(OBJ_LIST)
 
 $(MOBJ1): $(MSRC1)
 	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o