diff options
author | Roland McGrath <roland@gnu.org> | 2003-05-05 19:13:59 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2003-05-05 19:13:59 +0000 |
commit | 7f3a54bdf9bcfbb0a101889058e8a30ac297d1f0 (patch) | |
tree | 287749fd189de1b3dc713d41c6b38d5d5eca8c82 /Makerules | |
parent | 4661a1534390784e32ce940ad05ebb8ea9cdb62d (diff) | |
download | glibc-7f3a54bdf9bcfbb0a101889058e8a30ac297d1f0.tar.gz glibc-7f3a54bdf9bcfbb0a101889058e8a30ac297d1f0.tar.xz glibc-7f3a54bdf9bcfbb0a101889058e8a30ac297d1f0.zip |
2003-05-05 Roland McGrath <roland@redhat.com>
* Makerules (common-before-compile): New variable. ($(common-objpfx)%.make): Depend on that instead of $(before-compile). ($(common-objpfx)%.h $(common-objpfx)%.h.d): Likewise. Move this rule to after all setting of before-compile.
Diffstat (limited to 'Makerules')
-rw-r--r-- | Makerules | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/Makerules b/Makerules index ef4658d5a6..1398b16646 100644 --- a/Makerules +++ b/Makerules @@ -125,25 +125,6 @@ $(common-objpfx)%.latest: $(common-objpfx)abi-versions.h endif # avoid-generated endif # $(versioning) = yes - -# Generating headers for assembly constants. -# We need this defined early to get into before-compile before -# it's used in sysd-rules, below. -$(common-objpfx)%.h $(common-objpfx)%.h.d: $(..)scripts/gen-as-const.awk \ - %.sym $(before-compile) - $(AWK) -f $< $(filter %.sym,$^) \ - | $(CC) -S -o - $(CFLAGS) $(CPPFLAGS) -x c - \ - -MD -MF $(@:.h=.h.d)T -MT '$(@:.h=.h.d) $(@:.h.d=.h)' \ - | sed -n 's/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$$/#define \1 \2/p' > $(@:.h.d=.h)T - sed $(sed-remove-objpfx) $(sed-remove-dotdot) \ - $(@:.h=.h.d)T > $(@:.h=.h.d)T2 - rm -f $(@:.h=.h.d)T - mv -f $(@:.h=.h.d)T2 $(@:.h=.h.d) - mv -f $(@:.h.d=.h)T $(@:.h.d=.h) -vpath %.sym $(sysdirs) -before-compile += $(gen-as-const-headers:%.sym=$(common-objpfx)%.h) - - # Make sure the subdirectory for object files gets created. ifdef objpfx ifeq (,$(wildcard $(objpfx).)) @@ -165,6 +146,14 @@ ifdef before-compile $(before-compile): endif +# We don't want $(common-objpfx) files to depend on miscellaneous stuff +# in subdirs. +ifdef subdir +common-before-compile := $(filter-out $(objpfx)%,$(before-compile)) +else +common-before-compile = $(before-compile) +endif + ifndef subdir # If a makefile needs to do something conditional on something that # can only be figured out from headers, write a FOO.make.c input @@ -173,7 +162,7 @@ ifndef subdir # # We only generate these in the top-level makefile, to avoid any weirdness # from subdir-specific makefile tweaks creeping in on an update. -$(common-objpfx)%.make: $(..)%.make.c $(..)Makerules $(before-compile) +$(common-objpfx)%.make: $(..)%.make.c $(..)Makerules $(common-before-compile) rm -f $@T $@.dT (echo '# Generated from $*.make.c by Makerules.'; \ $(CC) $(CFLAGS) $(CPPFLAGS) -E $< \ @@ -190,6 +179,24 @@ sed-remove-dotdot := -e 's@ *\.\.\/\([^ \]*\)@ $$(..)\1@g' else sed-remove-dotdot := -e 's@ *\([^ \/$$][^ \]*\)@ $$(..)\1@g' endif + + +# Generating headers for assembly constants. +# We need this defined early to get into before-compile before +# it's used in sysd-rules, below. +$(common-objpfx)%.h $(common-objpfx)%.h.d: $(..)scripts/gen-as-const.awk \ + %.sym $(common-before-compile) + $(AWK) -f $< $(filter %.sym,$^) \ + | $(CC) -S -o - $(CFLAGS) $(CPPFLAGS) -x c - \ + -MD -MF $(@:.h=.h.d)T -MT '$(@:.h=.h.d) $(@:.h.d=.h)' \ + | sed -n 's/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$$/#define \1 \2/p' > $(@:.h.d=.h)T + sed $(sed-remove-objpfx) $(sed-remove-dotdot) \ + $(@:.h=.h.d)T > $(@:.h=.h.d)T2 + rm -f $(@:.h=.h.d)T + mv -f $(@:.h=.h.d)T2 $(@:.h=.h.d) + mv -f $(@:.h.d=.h)T $(@:.h.d=.h) +vpath %.sym $(sysdirs) +before-compile += $(gen-as-const-headers:%.sym=$(common-objpfx)%.h) # Generate an ordered list of implicit rules which find the source files in # each sysdep directory. The old method was to use vpath to search all the |