[uClibc-cvs] CVS uClibc/libc

CVS User vapier vapier at codepoet.org
Tue Jan 25 03:08:29 UTC 2005


Update of /var/cvs/uClibc/libc
In directory nail:/tmp/cvs-serv12269

Modified Files:
	.cvsignore Makefile 
Log Message:
merge parallel build support

--- /var/cvs/uClibc/libc/.cvsignore	2001/12/20 12:49:24	1.1
+++ /var/cvs/uClibc/libc/.cvsignore	2005/01/25 03:08:28	1.2
@@ -1 +1,2 @@
 tmp
+obj.*
--- /var/cvs/uClibc/libc/Makefile	2005/01/19 01:47:58	1.38
+++ /var/cvs/uClibc/libc/Makefile	2005/01/25 03:08:28	1.39
@@ -37,10 +37,33 @@
 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 @@
 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))



More information about the uClibc-cvs mailing list