Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F52AC369A2 for ; Mon, 14 Apr 2025 14:18:23 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.950412.1346758 (Exim 4.92) (envelope-from ) id 1u4Kda-0003fJ-9Z; Mon, 14 Apr 2025 14:18:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 950412.1346758; Mon, 14 Apr 2025 14:18:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u4Kda-0003fB-5T; Mon, 14 Apr 2025 14:18:14 +0000 Received: by outflank-mailman (input) for mailman id 950412; Mon, 14 Apr 2025 14:18:13 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u4KdY-0003eG-V4 for xen-devel@lists.xenproject.org; Mon, 14 Apr 2025 14:18:12 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1u4KdY-00EtTd-1q; Mon, 14 Apr 2025 14:18:12 +0000 Received: from [2a01:e0a:1da:8420:b77:bd5:6e45:7633] (helo=l14..) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u4KdY-00F14n-0t; Mon, 14 Apr 2025 14:18:12 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From; bh=2TRvNZpz+JhX9kS2Q7J1oFd+thWzi4Dn8OH/vUQM944=; b=vFXS6pW1zZ7KN0C2fjRNhd5H/B HMCRgeTZpmmAP7181tIcNjkpJ7AWL9adZ4ZOyM6GBTaK9CqxUWIdu41llj41BTVPnnUk8l5hhQjna +2hTAVCNxm8nxiy1mvu+S76GcdCKtAX5wc51kW94YUwejpdQ/rRF/CqT2S+kp6KgAi2Y=; From: Anthony PERARD To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Anthony PERARD Subject: [XEN PATCH] tools/tests: Fix newly introduced Makefile Date: Mon, 14 Apr 2025 16:17:14 +0200 Message-Id: <20250414141714.10166-1-anthony@xenproject.org> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Anthony PERARD Fix few issue with this new directory: - clean generated files - and ignore those generated files - include the dependency files generated by `gcc`. - rework prerequisites: "test-rangeset.o" also needs the generated files "list.h" and "rangeset.h". Technically, both only needs "harness.h" which needs the generated headers, but that's a bit simpler and the previous point will add the dependency on "harness.h" automatically. This last point fix an issue where `make` might decide to build "test-rangeset.o" before the other files are ready. Fixes: 7bf777b42cad ("tootls/tests: introduce unit tests for rangesets") Signed-off-by: Anthony PERARD --- Make doesn't needs the *.h to generated the .c. So removing that prerequisite means make can generate all 3 at the same time. --- tools/tests/rangeset/.gitignore | 4 ++++ tools/tests/rangeset/Makefile | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 tools/tests/rangeset/.gitignore diff --git a/tools/tests/rangeset/.gitignore b/tools/tests/rangeset/.gitignore new file mode 100644 index 0000000000..cdeb778535 --- /dev/null +++ b/tools/tests/rangeset/.gitignore @@ -0,0 +1,4 @@ +/list.h +/rangeset.c +/rangeset.h +/test-rangeset diff --git a/tools/tests/rangeset/Makefile b/tools/tests/rangeset/Makefile index 70076eff34..3dafcbd054 100644 --- a/tools/tests/rangeset/Makefile +++ b/tools/tests/rangeset/Makefile @@ -12,7 +12,7 @@ run: $(TARGET) .PHONY: clean clean: - $(RM) -- *.o $(TARGET) $(DEPS_RM) + $(RM) -- *.o $(TARGET) $(DEPS_RM) list.h rangeset.h rangeset.c .PHONY: distclean distclean: clean @@ -32,7 +32,7 @@ rangeset.h: $(XEN_ROOT)/xen/include/xen/rangeset.h list.h rangeset.h: sed -e '/#include/d' <$< >$@ -rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c list.h rangeset.h +rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c # Remove includes and add the test harness header sed -e '/#include/d' -e '1s/^/#include "harness.h"/' <$< >$@ @@ -42,5 +42,9 @@ CFLAGS += $(CFLAGS_xeninclude) LDFLAGS += $(APPEND_LDFLAGS) +test-rangeset.o rangeset.o: list.h rangeset.h + test-rangeset: rangeset.o test-rangeset.o $(CC) $^ -o $@ $(LDFLAGS) + +-include $(DEPS_INCLUDE) -- Anthony PERARD