Jelajahi Sumber

buildsys: Do not build crt upon pregen

No need to build crt when just generating headers

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 9 tahun lalu
induk
melakukan
9df521f763
6 mengubah file dengan 13 tambahan dan 15 penghapusan
  1. 1 3
      Makefile.in
  2. 9 8
      Makerules
  3. 1 0
      ldso/ldso/Makefile.in
  4. 1 2
      libc/Makefile.in
  5. 0 1
      libc/sysdeps/linux/Makefile.commonarch
  6. 1 1
      librt/Makefile.in

+ 1 - 3
Makefile.in

@@ -13,7 +13,7 @@ sub_headers := headers
 
 ifeq ($(HAVE_DOT_CONFIG),y)
 
-all: pregen libs
+all: pregen libs startfiles
 libs: pregen
 
 # In this section, we need .config
@@ -219,8 +219,6 @@ install: install_runtime install_dev
 
 RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)$(MULTILIB_DIR) $(RUNTIME_PREFIX)$(MULTILIB_DIR))
 
-startfiles: $(crt-y)
-
 $(top_builddir)extra/scripts/unifdef: |$(top_builddir)extra/scripts
 $(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c
 	$(hcompile.u)

+ 9 - 8
Makerules

@@ -22,9 +22,9 @@ ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
 libs: $(lib-gdb-y)
 endif
 libs: $(lib-a-y)
-$(lib-a-y): | $(top_builddir)lib
 endif
 objs: all_objs
+$(lib-so-y) $(lib-a-y): | $(top_builddir)lib
 
 # apply unconditional per-directory flags
 define add_IS_IN_lib
@@ -451,18 +451,18 @@ CFLAGS-initfini.s := -S -g0 $(PICFLAG) -fno-inline-functions -finhibit-size-dire
 $(top_builddir)lib/initfini.s: $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c | $(top_builddir)lib
 	$(compile.c)
 
-$(top_builddir)lib/defs.h: $(top_builddir)lib/initfini.s | $(top_builddir)lib
-	$(Q)sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
-		gawk -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp
+$(top_builddir)lib/defs.h: $(top_builddir)lib/initfini.s
+	$(do_sed) -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
+		$(AWK) -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp
 	$(Q)mv $@.tmp $@
 
 $(top_builddir)lib/crti.S: $(top_builddir)lib/initfini.s $(top_builddir)lib/defs.h
-	$(Q)sed -n -e '1,/@HEADER_ENDS/p' \
+	$(do_sed) -n -e '1,/@HEADER_ENDS/p' \
 		-e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
 		-e '/@TRAILER_BEGINS/,$$p' $< > $@
 
 $(top_builddir)lib/crtn.S: $(top_builddir)lib/initfini.s
-	$(Q)sed -n -e '1,/@HEADER_ENDS/p' \
+	$(do_sed) -n -e '1,/@HEADER_ENDS/p' \
 		-e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
 		-e '/@TRAILER_BEGINS/,$$p' $< > $@
 
@@ -482,9 +482,10 @@ CRTS_COMPAT :=
 #endif
 
 startfiles = $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC)
-$(crt-y): $(startfiles)
+startfiles: $(startfiles)
 $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC): | headers
-$(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC) $(LINK_FLAT_CRTS) $(SHARED_START_FILES) $(SHARED_END_FILES) : | $(top_builddir)lib
+$(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC) \
+	$(LINK_FLAT_CRTS) $(SHARED_START_FILES) $(SHARED_END_FILES): | $(top_builddir)lib
 
 $(top_builddir)lib/$(NONSHARED_LIBNAME): $(libc-nonshared-y)
 	$(Q)$(RM) $@

+ 1 - 0
ldso/ldso/Makefile.in

@@ -76,6 +76,7 @@ LDFLAGS-$(UCLIBC_LDSO_NAME).so += -T $(ldso:.$(ABI_VERSION)=).lds
 endif
 
 $(ldso): $(ldso:.$(ABI_VERSION)=)
+$(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
 $(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
 ifeq ($(LDSO_PRELINK_SUPPORT),y)
 	$(call create-lds)

+ 1 - 2
libc/Makefile.in

@@ -87,8 +87,7 @@ $(libc_OUT)/libc.oS: $(libc-multi-y) | $(top_builddir)lib/libc.a $(top_builddir)
 	$(Q)$(RM) $@
 	$(compile-m)
 
-$(top_builddir)lib/libc.a: $(libc-a-y) | $(crt-y)
-	$(Q)$(INSTALL) -d $(dir $@)
+$(top_builddir)lib/libc.a: $(libc-a-y)
 	$(Q)$(RM) $@
 	$(do_ar)
 

+ 0 - 1
libc/sysdeps/linux/Makefile.commonarch

@@ -15,7 +15,6 @@ ARCH_SOBJ = $(patsubst %.s,%.o,$(patsubst %.S,%.o,$(addprefix $(ARCH_OUT)/,$(SSR
 
 ARCH_OBJS-y = $(ARCH_COBJ) $(ARCH_SOBJ)
 
-crt-y          := FORCE
 libc-y         += $(ARCH_OBJS-y)
 libc-nomulti-y += $(ARCH_SOBJ)
 objclean-y     += CLEAN_$(subst $(top_builddir),,$(ARCH_OUT))

+ 1 - 1
librt/Makefile.in

@@ -73,7 +73,7 @@ $(librt_OUT)/librt_so.a: $(librt-so-y)
 	$(Q)$(RM) $@
 	$(do_ar)
 
-$(top_builddir)lib/librt.a: $(librt-a-y) | $(top_builddir)lib
+$(top_builddir)lib/librt.a: $(librt-a-y)
 	$(Q)$(RM) $@
 	$(do_ar)