|
@@ -576,7 +576,21 @@ $(OUTPUT)perf.o perf.spec \
|
|
|
: $(OUTPUT)PERF-VERSION-FILE
|
|
|
|
|
|
.SUFFIXES:
|
|
|
-.SUFFIXES: .o .c .S .s
|
|
|
+
|
|
|
+#
|
|
|
+# If a target does not match any of the later rules then prefix it by $(OUTPUT)
|
|
|
+# This makes targets like 'make O=/tmp/perf perf.o' work in a natural way.
|
|
|
+#
|
|
|
+ifneq ($(OUTPUT),)
|
|
|
+%.o: $(OUTPUT)%.o
|
|
|
+ @echo " # Redirected target $@ => $(OUTPUT)$@"
|
|
|
+util/%.o: $(OUTPUT)util/%.o
|
|
|
+ @echo " # Redirected target $@ => $(OUTPUT)util/$@"
|
|
|
+bench/%.o: $(OUTPUT)bench/%.o
|
|
|
+ @echo " # Redirected target $@ => $(OUTPUT)bench/$@"
|
|
|
+tests/%.o: $(OUTPUT)tests/%.o
|
|
|
+ @echo " # Redirected target $@ => $(OUTPUT)tests/$@"
|
|
|
+endif
|
|
|
|
|
|
# These two need to be here so that when O= is not used they take precedence
|
|
|
# over the general rule for .o
|