Browse Source

rework depends and stripping so that libraries arent rebuilt all the time in a loop

Mike Frysinger 19 years ago
parent
commit
b20ee706ef

+ 8 - 8
Makerules

@@ -7,11 +7,11 @@
 # order is important, the stripping uses STRIP_FLAGS for lib-so, but not for lib-a
 ifeq ($(HAVE_SHARED),y)
 .LIBPATTERNS: "lib%.so"
-libs: lib-so-y lib-a-y
+libs: $(lib-so-y) $(lib-a-y)
 objs: shared_objs ar_objs
 else
 .LIBPATTERNS: "lib%.a"
-libs: lib-a-y
+libs: $(lib-a-y)
 objs: ar_objs
 endif
 
@@ -29,12 +29,13 @@ ar_objs: $(ar_objs-y)
 endif
 
 headers-y: $(headers-y)
-ld-uClibc-y: $(ld-uClibc-y)
 interp-y: $(interp)
-pre-y: interp-y ld-uClibc-y
-libc-y: pre-y $(libc) crt-y $(top_builddir)lib/$(NONSHARED_LIBNAME)
-lib-so-y: libc-y $(lib-so-y)
-lib-a-y: crt-y $(lib-a-y)
+pre-y: $(interp) $(ld-uClibc-y)
+libc-y: pre-y $(libc) $(crt-y) $(top_builddir)lib/$(NONSHARED_LIBNAME)
+ldso-dep = 
+libc-so-dep = $(top_builddir)lib/libc.so $(interp)
+lib-so-y = $(libc-so-dep) $(lib-so-y)
+lib-a-y = $(crt-y) $(lib-a-y)
 
 ifneq ($(findstring s,$(MAKEFLAGS)),)
 DISP := sil
@@ -163,7 +164,6 @@ $(CTOR_TARGETS):
 	$(do_ar)
 endif
 
-crt-y: $(crt-y)
 $(crt-y): $(CRTS) $(CTOR_TARGETS)
 
 $(top_builddir)lib/$(NONSHARED_LIBNAME): $(libc-nonshared-y)

+ 4 - 2
ldso/libdl/Makefile.in

@@ -39,7 +39,7 @@ lib-a-$(HAVE_SHARED) += $(top_builddir)lib/libdl.a
 lib-so-y += $(top_builddir)lib/libdl.so
 objclean-y += libdl_clean
 
-$(top_builddir)lib/libdl.so: $(libdl_OUT)/libdl_so.a ld-uClibc-y libc-y
+$(top_builddir)lib/libdl.so: $(libdl_OUT)/libdl_so.a $(ld-uClibc-y) $(libc-so-dep)
 	$(call link.so,$(libdl_FULL_NAME),$(MAJOR_VERSION))
 
 $(libdl_OUT)/libdl_so.a: $(libdl-so-y)
@@ -50,11 +50,13 @@ $(libdl_OUT)/libdl_so.a: $(libdl-so-y)
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/libdl.a: $(libdl-a-y:.o=.os)
 else
-$(top_builddir)lib/libdl.a: $(libdl-a-y)
+$(top_builddir)lib/libdl.a: $(libdl-a-y) $(libdl_OUT)/libdl_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifneq ($(DOPIC),y)
 	$(do_strip)
+endif
 	$(do_ar)
 
 libdl_clean:

+ 10 - 4
libc/Makefile.in

@@ -41,11 +41,11 @@ libc-so-y += $(libc-shared-y)
 
 libc-nomulti-y += $(libc-shared-y)
 
-lib-a-y += $(top_builddir)lib/libc.a crt-y
-lib-so-y += libc-y $(top_builddir)lib/$(NONSHARED_LIBNAME) crt-y
+lib-a-y += $(top_builddir)lib/libc.a $(crt-y)
+lib-so-y += libc-y $(top_builddir)lib/$(NONSHARED_LIBNAME) $(crt-y)
 objclean-y += libc_clean
 
-$(top_builddir)lib/libc.so: $(libc_OUT)/libc_so.a $(top_builddir)include/headers_done $(interp)
+$(top_builddir)lib/libc.so: $(libc_OUT)/libc_so.a $(interp)
 	$(call link.so,$(libc_FULL_NAME),$(MAJOR_VERSION))
 	$(Q)$(RM) $@
 	$(Q)echo "/* GNU ld script" > $@
@@ -65,12 +65,18 @@ $(libc_OUT)/libc_so.a: $(libc-so-y)
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/libc.a: $(libc-a-y:.o=.os)
 else
-$(top_builddir)lib/libc.a: $(libc-a-y)
+$(top_builddir)lib/libc.a: $(libc-a-y) $(libc_OUT)/libc_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifeq ($(DOPIC),y)
+	$(Q)$(STRIPTOOL) $(STRIP_FLAGS) $(filter-out $(libc-so-y),$^)
+else
 	$(do_strip)
+endif
 	$(do_ar)
 
+$(top_builddir)lib/$(NONSHARED_LIBNAME): $(top_builddir)lib/libc.a
+
 libc_clean:
 	$(RM) $(libc_OUT)/*.{o,os,a}

+ 4 - 2
libcrypt/Makefile.in

@@ -29,7 +29,7 @@ lib-a-y += $(top_builddir)lib/libcrypt.a
 lib-so-y += $(top_builddir)lib/libcrypt.so
 objclean-y += libcrypt_clean
 
-$(top_builddir)lib/libcrypt.so: $(libcrypt_OUT)/libcrypt_so.a libc-y
+$(top_builddir)lib/libcrypt.so: $(libcrypt_OUT)/libcrypt_so.a $(libc-so-dep)
 	$(call link.so,$(libcrypt_FULL_NAME),$(MAJOR_VERSION))
 
 $(libcrypt_OUT)/libcrypt_so.a: $(libcrypt-so-y)
@@ -40,11 +40,13 @@ $(libcrypt_OUT)/libcrypt_so.a: $(libcrypt-so-y)
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/libcrypt.a: $(libcrypt-a-y:.o=.os)
 else
-$(top_builddir)lib/libcrypt.a: $(libcrypt-a-y)
+$(top_builddir)lib/libcrypt.a: $(libcrypt-a-y) $(libcrypt_OUT)/libcrypt_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifneq ($(DOPIC),y)
 	$(do_strip)
+endif
 	$(do_ar)
 
 libcrypt_clean:

+ 4 - 2
libintl/Makefile.in

@@ -37,7 +37,7 @@ lib-a-$(UCLIBC_HAS_GETTEXT_AWARENESS) += $(top_builddir)lib/libintl.a
 lib-so-$(UCLIBC_HAS_GETTEXT_AWARENESS) += $(top_builddir)lib/libintl.so
 objclean-y += libintl_clean
 
-$(top_builddir)lib/libintl.so: $(libintl_OUT)/libintl_so.a libc-y
+$(top_builddir)lib/libintl.so: $(libintl_OUT)/libintl_so.a $(libc-so-dep)
 	$(call link.so,$(libintl_FULL_NAME),$(MAJOR_VERSION))
 
 $(libintl_OUT)/libintl_so.a: $(libintl-so-y)
@@ -48,11 +48,13 @@ $(libintl_OUT)/libintl_so.a: $(libintl-so-y)
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/libintl.a: $(libintl-a-y:.o=.os)
 else
-$(top_builddir)lib/libintl.a: $(libintl-a-y)
+$(top_builddir)lib/libintl.a: $(libintl-a-y) $(libintl_OUT)/libintl_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifneq ($(DOPIC),y)
 	$(do_strip)
+endif
 	$(do_ar)
 
 $(libintl_MOBJ): $(libintl_MSRC)

+ 4 - 2
libm/Makefile.in

@@ -128,7 +128,7 @@ lib-a-$(UCLIBC_HAS_FLOATS) += $(top_builddir)lib/libm.a
 lib-so-$(UCLIBC_HAS_FLOATS) += $(top_builddir)lib/libm.so
 objclean-y += libm_clean
 
-$(top_builddir)lib/libm.so: $(libm_OUT)/libm_so.a libc-y
+$(top_builddir)lib/libm.so: $(libm_OUT)/libm_so.a $(libc-so-dep)
 	$(call link.so,$(libm_FULL_NAME),$(MAJOR_VERSION))
 
 $(libm_OUT)/libm_so.a: $(libm-so-y)
@@ -139,11 +139,13 @@ $(libm_OUT)/libm_so.a: $(libm-so-y)
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/libm.a: $(libm-a-y:.o=.os)
 else
-$(top_builddir)lib/libm.a: $(libm-a-y)
+$(top_builddir)lib/libm.a: $(libm-a-y) $(libm_OUT)/libm_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifneq ($(DOPIC),y)
 	$(do_strip)
+endif
 	$(do_ar)
 
 $(libm_MOBJ): $(libm_MSRC)

+ 4 - 2
libnsl/Makefile.in

@@ -28,7 +28,7 @@ lib-a-y += $(top_builddir)lib/libnsl.a
 lib-so-y += $(top_builddir)lib/libnsl.so
 objclean-y += libnsl_clean
 
-$(top_builddir)lib/libnsl.so: $(libnsl_OUT)/libnsl_so.a libc-y
+$(top_builddir)lib/libnsl.so: $(libnsl_OUT)/libnsl_so.a $(libc-so-dep)
 	$(call link.so,$(libnsl_FULL_NAME),$(MAJOR_VERSION))
 
 $(libnsl_OUT)/libnsl_so.a: $(libnsl-so-y)
@@ -39,11 +39,13 @@ $(libnsl_OUT)/libnsl_so.a: $(libnsl-so-y)
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/libnsl.a: $(libnsl-a-y:.o=.os)
 else
-$(top_builddir)lib/libnsl.a: $(libnsl-a-y)
+$(top_builddir)lib/libnsl.a: $(libnsl-a-y) $(libnsl_OUT)/libnsl_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifneq ($(DOPIC),y)
 	$(do_strip)
+endif
 	$(do_ar)
 
 libnsl_clean:

+ 4 - 2
libpthread/linuxthreads.old/Makefile.in

@@ -62,7 +62,7 @@ objclean-y += libpthread_clean
 headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
 headers_clean-y += linuxthreads_headers_clean
 
-$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a libc-y
+$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc-so-dep)
 	$(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
 
 $(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
@@ -77,11 +77,13 @@ endif
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/libpthread.a: $(libpthread-a-y:.o=.os)
 else
-$(top_builddir)lib/libpthread.a: $(libpthread-a-y)
+$(top_builddir)lib/libpthread.a: $(libpthread-a-y) $(libpthread_OUT)/libpthread_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifneq ($(DOPIC),y)
 	$(do_strip)
+endif
 	$(do_ar)
 
 linuxthreads_headers:

+ 3 - 1
libpthread/linuxthreads.old_db/Makefile.in

@@ -43,11 +43,13 @@ $(libthread_db_OUT)/libthread_db_so.a: $(libthread_db-so-y)
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/libthread_db.a: $(libthread_db-a-y:.o=.os)
 else
-$(top_builddir)lib/libthread_db.a: $(libthread_db-a-y)
+$(top_builddir)lib/libthread_db.a: $(libthread_db-a-y) $(libthread_db_OUT)/libthread_db_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifneq ($(DOPIC),y)
 	$(do_strip)
+endif
 	$(do_ar)
 
 linuxthreads_db_headers:

+ 4 - 2
libresolv/Makefile.in

@@ -28,7 +28,7 @@ lib-a-y += $(top_builddir)lib/libresolv.a
 lib-so-y += $(top_builddir)lib/libresolv.so
 objclean-y += libresolv_clean
 
-$(top_builddir)lib/libresolv.so: $(libresolv_OUT)/libresolv_so.a libc-y
+$(top_builddir)lib/libresolv.so: $(libresolv_OUT)/libresolv_so.a $(libc-so-dep)
 	$(call link.so,$(libresolv_FULL_NAME),$(MAJOR_VERSION))
 
 $(libresolv_OUT)/libresolv_so.a: $(libresolv-so-y)
@@ -39,11 +39,13 @@ $(libresolv_OUT)/libresolv_so.a: $(libresolv-so-y)
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/libresolv.a: $(libresolv-a-y:.o=.os)
 else
-$(top_builddir)lib/libresolv.a: $(libresolv-a-y)
+$(top_builddir)lib/libresolv.a: $(libresolv-a-y) $(libresolv_OUT)/libresolv_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifneq ($(DOPIC),y)
 	$(do_strip)
+endif
 	$(do_ar)
 
 libresolv_clean:

+ 4 - 2
librt/Makefile.in

@@ -28,7 +28,7 @@ lib-a-y += $(top_builddir)lib/librt.a
 lib-so-y += $(top_builddir)lib/librt.so
 objclean-y += librt_clean
 
-$(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a libc-y
+$(top_builddir)lib/librt.so: $(librt_OUT)/librt_so.a $(libc-so-dep)
 	$(call link.so,$(librt_FULL_NAME),$(MAJOR_VERSION))
 
 $(librt_OUT)/librt_so.a: $(librt-so-y)
@@ -39,11 +39,13 @@ $(librt_OUT)/librt_so.a: $(librt-so-y)
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/librt.a: $(librt-a-y:.o=.os)
 else
-$(top_builddir)lib/librt.a: $(librt-a-y)
+$(top_builddir)lib/librt.a: $(librt-a-y) $(librt_OUT)/librt_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifneq ($(DOPIC),y)
 	$(do_strip)
+endif
 	$(do_ar)
 
 librt_clean:

+ 4 - 2
libutil/Makefile.in

@@ -31,7 +31,7 @@ lib-a-y += $(top_builddir)lib/libutil.a
 lib-so-y += $(top_builddir)lib/libutil.so
 objclean-y += libutil_clean
 
-$(top_builddir)lib/libutil.so: $(libutil_OUT)/libutil_so.a libc-y
+$(top_builddir)lib/libutil.so: $(libutil_OUT)/libutil_so.a $(libc-so-dep)
 	$(call link.so,$(libutil_FULL_NAME),$(MAJOR_VERSION))
 
 $(libutil_OUT)/libutil_so.a: $(libutil-so-y)
@@ -42,11 +42,13 @@ $(libutil_OUT)/libutil_so.a: $(libutil-so-y)
 ifeq ($(DOPIC),y)
 $(top_builddir)lib/libutil.a: $(libutil-a-y:.o=.os)
 else
-$(top_builddir)lib/libutil.a: $(libutil-a-y)
+$(top_builddir)lib/libutil.a: $(libutil-a-y) $(libutil_OUT)/libutil_so.a
 endif
 	$(Q)$(INSTALL) -d $(dir $@)
 	$(Q)$(RM) $@
+ifneq ($(DOPIC),y)
 	$(do_strip)
+endif
 	$(do_ar)
 
 libutil_clean: