2003-01-15 Roland McGrath <roland@redhat.com>

* Makerules: Use -include for tls.make, suppresses warning.
	Move gen-as-const-headers rules up so before-compile is set in time.
	(sed-remove-dotdot): Fix to work right for subdirs or top dir.
This commit is contained in:
Roland McGrath 2003-01-15 20:24:04 +00:00
parent d439762939
commit 0e56981e16

View File

@ -125,6 +125,25 @@ $(common-objpfx)%.latest: $(common-objpfx)abi-versions.h
endif # avoid-generated endif # avoid-generated
endif # $(versioning) = yes 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)
# When we have no deps pass doing it, then make sure the subdirectory # When we have no deps pass doing it, then make sure the subdirectory
# for object files gets created. # for object files gets created.
ifdef no_deps ifdef no_deps
@ -162,8 +181,11 @@ $(common-objpfx)%.make: $(..)%.make.c $(..)Makerules $(before-compile)
rm -f $@.dT) > $@T rm -f $@.dT) > $@T
mv -f $@T $@ mv -f $@T $@
sed-remove-dotdot := -e 's@ *\([^ \/$$][^ \]*\)@ $$(..)\1@g' \ ifdef subdir
-e 's@ *\.\.\/\([^ \]*\)@ $$(..)\1@g' sed-remove-dotdot := -e 's@ *\.\.\/\([^ \]*\)@ $$(..)\1@g'
else
sed-remove-dotdot := -e 's@ *\([^ \/$$][^ \]*\)@ $$(..)\1@g'
endif
# Generate an ordered list of implicit rules which find the source files in # 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 # each sysdep directory. The old method was to use vpath to search all the
@ -1160,7 +1182,7 @@ define check-abi
endef endef
ifeq ($(sysd-sorted-done),t) ifeq ($(sysd-sorted-done),t)
include $(common-objpfx)tls.make -include $(common-objpfx)tls.make
config-tls-yes := tls config-tls-yes := tls
config-tls-no := notls config-tls-no := notls
check-abi-config := \ check-abi-config := \
@ -1212,25 +1234,6 @@ endif
endif endif
# Generating headers for assembly constants.
$(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)
ifeq (,$(wildcard $(gen-as-const-headers:%.sym=$(common-objpfx)%.h)))
before-compile += $(gen-as-const-headers:%.sym=$(common-objpfx)%.h)
endif
# There's no good place to put this - here will do. # There's no good place to put this - here will do.
# The dependencies are wrong if it's run from the top level. # The dependencies are wrong if it's run from the top level.
ifeq ($(filter %posix, $(sysdirs)),) ifeq ($(filter %posix, $(sysdirs)),)