Allow Makefiles to specify test-static for tests which cannot be
authordrepper <drepper>
Fri, 27 Mar 1998 22:49:06 +0000 (22:49 +0000)
committerdrepper <drepper>
Fri, 27 Mar 1998 22:49:06 +0000 (22:49 +0000)
linked dynamically.

Rules

diff --git a/Rules b/Rules
index 88581a3..d9efdc2 100644 (file)
--- 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
 \f
 .PHONY: distclean realclean subdir_distclean subdir_realclean \
        subdir_clean subdir_mostlyclean