about summary refs log tree commit diff
path: root/Rules
diff options
context:
space:
mode:
Diffstat (limited to 'Rules')
-rw-r--r--Rules17
1 files changed, 15 insertions, 2 deletions
diff --git a/Rules b/Rules
index 88581a35da..d9efdc2b75 100644
--- a/Rules
+++ b/Rules
@@ -88,9 +88,9 @@ else
 others: $(addprefix $(objpfx),$(extra-objs))
 endif
 ifeq ($(cross-compiling),yes)
-tests: $(addprefix $(objpfx),$(tests) $(test-srcs))
+tests: $(addprefix $(objpfx),$(tests) $(tests-static) $(test-srcs))
 else
-tests: $(tests:%=$(objpfx)%.out)
+tests: $(tests:%=$(objpfx)%.out) $(tests-static:%=$(objpfx)%.sout)
 endif
 
 ifeq ($(build-programs),yes)
@@ -129,6 +129,19 @@ $(objpfx)%.out: %.input $(objpfx)%
 $(objpfx)%.out: /dev/null $(objpfx)%	# Make it 2nd arg for canned sequence.
 	$($*-ENV) $(built-program-cmd) > $@
 endif	# tests
+
+ifneq "$(strip $(tests-static) $(test-static-srcs))" ""
+# These are the implicit rules for making test outputs
+# from the test programs and whatever input files are present.
+$(objpfx)%.sout: %.args $(objpfx)% %.input
+	$($*-ENV) $(built-program-file) `cat $(word 1,$^)` < $(word 3,$^) > $@
+$(objpfx)%.sout: %.args $(objpfx)%
+	$($*-ENV) $(built-program-file) `cat $(word 1,$^)` > $@
+$(objpfx)%.sout: %.input $(objpfx)%
+	$($*-ENV) $(built-program-file) < $(word 1,$^) > $@
+$(objpfx)%.sout: /dev/null $(objpfx)%	# Make it 2nd arg for canned sequence.
+	$($*-ENV) $(built-program-file) > $@
+endif	# tests
 
 .PHONY: distclean realclean subdir_distclean subdir_realclean \
 	subdir_clean subdir_mostlyclean