about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Rules6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 858b9fa2de..3ffaa38b5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-21  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	* Rules ($(objpfx)bench-%.c): Include code from a C source
+	file.
+
 2013-03-21  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #15287]
diff --git a/Rules b/Rules
index bc5dacd2f6..02cdb4ac78 100644
--- a/Rules
+++ b/Rules
@@ -210,8 +210,12 @@ $(binaries-bench): %: %.o \
 	$(+link)
 
 $(objpfx)bench-%.c: %-inputs bench-skeleton.c
+	{ if [ -n "$($*-INCLUDE)" ]; then \
+	  cat $($*-INCLUDE); \
+	fi; \
 	$(..)scripts/bench.pl $(patsubst %-inputs,%,$<) \
-	  $($*-ITER) $($*-ARGLIST) $($*-RET) > $@
+	  $($*-ITER) $($*-ARGLIST) $($*-RET); } > $@-tmp
+	mv -f $@-tmp $@
 
 
 .PHONY: distclean realclean subdir_distclean subdir_realclean \