From 86f75210e028ef78e3349be78e52d5936d42920d Mon Sep 17 00:00:00 2001 From: Anton Midyukov Date: Thu, 17 Jun 2021 04:48:23 +0700 Subject: [PATCH] Makefile, profile.mk: not create temp directories with DIRECT_TARGETS See-also: https://bugzilla.altlinux.org/show_bug.cgi?id=40148 --- Makefile | 2 +- lib/profile.mk | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 811abbe0..5d036a5e 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ export PATH := $(CURDIR)/bin:$(PATH) # recursive make considered useful for m-p MAKE += -r --no-print-directory -DIRECT_TARGETS := help help/distro help/ve help/vm clean distclean check +export DIRECT_TARGETS := help help/distro help/ve help/vm clean distclean check .PHONY: $(DIRECT_TARGETS) # these build nothing so no use of reports either diff --git a/lib/profile.mk b/lib/profile.mk index f01e8f30..feaae61e 100644 --- a/lib/profile.mk +++ b/lib/profile.mk @@ -2,6 +2,7 @@ ifndef MKIMAGE_PROFILES $(error this makefile is designed to be included in toplevel one) endif +ifneq (,$(filter-out $(DIRECT_TARGETS),$(MAKECMDGOALS))) # this could have come from env; or could be symlinked; or is made anew # (the reuse rationale is avoiding extra tmpdir lookups) # NB: immediate assignment matters @@ -20,6 +21,7 @@ endif ifeq (,$(BUILDDIR)) $(error suitable BUILDDIR unavailable) endif +endif # even smart caching only hurts when every build goes from scratch NO_CACHE ?= 1