summary refs log tree commit diff
path: root/Makerules
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-06-12 11:30:23 +0000
committerRoland McGrath <roland@gnu.org>2003-06-12 11:30:23 +0000
commitf291538ffc24e7758cf9199e4153633d82696e5d (patch)
tree27a3ee080f85ff41afa3b3b79f6ec62bc6ee56fb /Makerules
parent45ec72e8d67c72056a43deb22bcb6c4e1d1f65c2 (diff)
downloadglibc-f291538ffc24e7758cf9199e4153633d82696e5d.tar.gz
glibc-f291538ffc24e7758cf9199e4153633d82696e5d.tar.xz
glibc-f291538ffc24e7758cf9199e4153633d82696e5d.zip
2003-06-12 Roland McGrath <roland@redhat.com>
	* Makerules ($(objpfx)stubs): Rewrite sed magic.
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules24
1 files changed, 14 insertions, 10 deletions
diff --git a/Makerules b/Makerules
index c3d780800f..18f276ece5 100644
--- a/Makerules
+++ b/Makerules
@@ -1355,18 +1355,22 @@ ifdef objpfx
 stubs: $(objpfx)stubs
 endif
 $(objpfx)stubs: $(+depfiles)
+ifneq (,$(strip $(+depfiles)))
 # Use /dev/null since `...` might expand to empty.
-	(s=`cd $(sysdep_dir) && $(PWD_P)`; \
-	 $(patsubst %/,cd % &&,$(objpfx)) \
-	 sed -n 's/^stub_warning *(\([^)]*\).*$$/#define __stub_\1/p' \
-	  `sed -n -e 's@$(sysdep_dir)/@'"$$s"'/@g' \
-		  -e 's@\$$(common-objpfx)@$(..)@g' -e 's@\$$(objpfx)@@g' \
-		  -e '/:  *[^ ]/{s@^.*: *\([^ ]*\) .*$$@\1@; h; }' \
-		  -e '/:$$/d' \
-		  -e '/stub-tag\.h/{; g; p; }' \
-		  $(patsubst $(objpfx)%,%,$^) /dev/null` \
-	     /dev/null) > $@T
+	c=`($(patsubst %/,cd % &&,$(objpfx)) \
+	    sed -n -e 's@\$$(common-objpfx)@$(common-objpfx)@g' \
+		   -e 's@\$$(objpfx)@$(objpfx)@g' \
+		   -e '/stub-tag\.h/{; g; s/./&/p; }' \
+		   -e '/:/{x; s/^.*$$//; x; }' \
+		   -e 's/^.*://;s/\\$$//;s/^ *\([^ ][^ ]*\) .*$$/\1/' \
+		   -e '/^[^ ][^ ]*$$/{G;s/^.*\n\(..*\)/\1/;s/\n//;h; }' \
+		   $(patsubst $(objpfx)%,%,$^)) | sort | uniq`; \
+	sed -n 's/^stub_warning *(\([^)]*\).*$$/#define __stub_\1/p' \
+	    $$c /dev/null > $@T
 	mv -f $@T $@
+else
+	> $@
+endif
 
 # Make the distribution tar file.