diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build index c5e2d5f13766..a46ab7b612df 100644 --- a/tools/perf/pmu-events/Build +++ b/tools/perf/pmu-events/Build @@ -29,10 +29,12 @@ $(PMU_EVENTS_C): $(EMPTY_PMU_EVENTS_C) $(call rule_mkdir) $(Q)$(call echo-cmd,gen)cp $< $@ else -# Copy checked-in json for generation. +# Copy checked-in json to OUTPUT for generation if it's an out of source build +ifneq ($(OUTPUT),) $(OUTPUT)pmu-events/arch/%: pmu-events/arch/% $(call rule_mkdir) $(Q)$(call echo-cmd,gen)cp $< $@ +endif $(LEGACY_CACHE_JSON): $(LEGACY_CACHE_PY) $(call rule_mkdir)