From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9647136F8E4 for ; Thu, 11 Jun 2026 21:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781213996; cv=none; b=fiaoSMLtdOIWzD/GB3zGgbpIpa/NUhPfW28xx2iisWUc2kCDyKvK8yHZZ9Yice0tsxDkgzvOpIwpmhb8dgDr4YBB02By17lG/WZObtr5D7dD7MMPwITQ/M6MaUewqCGNkpXKi40bPyjzKu0zjCn20zI+tNLNeIVhipkkkN2Tgbc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781213996; c=relaxed/simple; bh=VUVxFiFOE7rRIxpDFA8gH7oo0cb3pm8q5kQcBajMdNg=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=DGMz/TQ0oqXR8YgXRWn5rEYoPJy3CsvMNmRAGT2k0ZuFq4Y4ZIJgDD6uuBMcG4JvtCCsxJSEFwOpYvCU16eOGaVXOln8auSDH9BQD2vOFah7knLCGSs9VGLTChdaQf6E4IEVBcoGLas36wVpJIGNFatx6E6lQqIrrkcmZM81xic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hGjalTwH; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hGjalTwH" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-36d98b76d12so211820a91.2 for ; Thu, 11 Jun 2026 14:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781213994; x=1781818794; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=PUg0Ff/Oafdl0wyiqex+4ygk48MToQL6TrpPtb5XsJQ=; b=hGjalTwHsYLeztD1MobkS+uvkhyQIu3Ws/rXnUiGcbGJ9KfiFVnPQtG6lbVm28j7o6 OfB+Yg5QCJj8qxF8OSM2ty9R/zQ76O8ZztnxomBU/ZBmGrSh7sZSyygl3lIoUNd8oyix wjQGY8Sc5BgAD5xXHtbAQJEOsp6hnsBdJuUsj/UIKOrskfRu9i/MwgyeCpQaoG8BhLFm xdA7JwNBQNZW5jiyUR8OLwD1PMdWCOWCULVHqyiU3SJixLK1VwuJ07XMCiHUtoLd129v qKad8qCZ418eOASFEKrrBJ9GNgykcfX1LAw3s6kcTrAnX9aoI2h5Qhwh6wgGpM5Dgj+B zsmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781213994; x=1781818794; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PUg0Ff/Oafdl0wyiqex+4ygk48MToQL6TrpPtb5XsJQ=; b=c3BQXJhiPm+dr5eW9V37vMUasQS5LThFj+Ds27LUOw1Wfzz3fXnMdOGd3UZqCHP9Wm PnBK4IVdtTHceD2kaut5bMLwMt3bPfuLWHnGVWFy1iF0sa0oxN1LiCHmTAkqxqvBqpfZ iyKQxZ9Pfj4KNg5Zs9LCJ5PGyckYyoAjAH+DPf8G0XsuPLbMmqADvLySFhAevH7rvJEy OtFMC0b63ESDZPYs6wooK5uLTLrrNJiyq8w14lndNBpjP5pHUdyjmWIQMYMX4HtCQ/LF 0ayQ7GBgd+xNX6WRYfLJA1byARzS4MAUPBMr7u8PW+c8mgkmPhWXt54Td+24hVUVf4zG 51+w== X-Forwarded-Encrypted: i=1; AFNElJ/gf4id4ysghIIHMTaBYgewcrrFJCaxzuCZ70liwP73C/0gQGYlSouOaX3l2BndqQP43RIANGeth7tU/4o=@vger.kernel.org X-Gm-Message-State: AOJu0YzD4UuNSyE2W7101B73TMJv/MB8CHZPL23W6uM1qIiDmASKeuu2 JAsIwk718bP+UPBYr1oELFzuCV5Mx1Ue7XgryLDcrhG/K3zkWuooVk9K1Age1OYdClqLgEiiPND +LalA2LJ3VvsBuw== X-Received: from pjzl23.prod.google.com ([2002:a17:90b:797:b0:36b:9e61:a1dd]) (user=dmatlack job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:54c6:b0:366:132:fda6 with SMTP id 98e67ed59e1d1-37a02812553mr227132a91.11.1781213993767; Thu, 11 Jun 2026 14:39:53 -0700 (PDT) Date: Thu, 11 Jun 2026 21:39:45 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.54.0.1136.gdb2ca164c4-goog Message-ID: <20260611213945.3714421-1-dmatlack@google.com> Subject: [PATCH] vfio: selftests: Ensure libvfio output dirs are always created From: David Matlack To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alex Williamson , David Matlack , Sean Christopherson , Sashiko Content-Type: text/plain; charset="UTF-8" Add an explicit dependency between the output object files and the output directories that need to be created to hold those files. This ensures that the output directories are always created. Creating the output directories at parse time (current behavior) doesn't support the scenario where someone does "make clean all". The directories will be created during parsing, deleted during "clean" and then not available for the "all" target. Use an order-only prerequisite for the output directories, rather than a normal prerequisite, to avoid unnecessary recompilations. Fixes: 19faf6fd969c ("vfio: selftests: Add a helper library for VFIO selftests") Reported-by: Sashiko Closes: https://lore.kernel.org/kvm/20260610010314.DB8861F00893@smtp.kernel.org/ Signed-off-by: David Matlack --- Cc: Sean Christopherson tools/testing/selftests/vfio/lib/libvfio.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/vfio/lib/libvfio.mk b/tools/testing/selftests/vfio/lib/libvfio.mk index b7857319c3f1..2b8d73b7d329 100644 --- a/tools/testing/selftests/vfio/lib/libvfio.mk +++ b/tools/testing/selftests/vfio/lib/libvfio.mk @@ -20,11 +20,13 @@ LIBVFIO_OUTPUT := $(OUTPUT)/libvfio LIBVFIO_O := $(patsubst %.c, $(LIBVFIO_OUTPUT)/%.o, $(LIBVFIO_C)) LIBVFIO_O_DIRS := $(shell dirname $(LIBVFIO_O) | uniq) -$(shell mkdir -p $(LIBVFIO_O_DIRS)) + +$(LIBVFIO_O_DIRS): + mkdir -p $@ CFLAGS += -I$(LIBVFIO_SRCDIR)/include -$(LIBVFIO_O): $(LIBVFIO_OUTPUT)/%.o : $(LIBVFIO_SRCDIR)/%.c +$(LIBVFIO_O): $(LIBVFIO_OUTPUT)/%.o : $(LIBVFIO_SRCDIR)/%.c | $(LIBVFIO_O_DIRS) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ EXTRA_CLEAN += $(LIBVFIO_OUTPUT) base-commit: a26b499b757cfc8bbff1088bb1b844639e250893 -- 2.54.0.1136.gdb2ca164c4-goog