From patchwork Thu Sep 11 21:44:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 290 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757627095; bh=WFV3wswtdB85tjYPm2OE0X/7tCcr+0NY8bcE6pSVs+8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bsAV9w8gqTJjh4Lwx3vxO7NNZTLkYatKhultA+4ryD1dlqL4Q4AG/OOO1GYVyQyof 0uegKBC5uTHiM6eqJ/wKpmypco1jF2uzP1fJd1c7t+em5deMipXbDiNEdhKoxCa6fz Ph6o6uYUJNP2fQJH9/9KhvIUsAXEa0671ej3gOkKUiF2p6YUxb//SgNKREdAaErSWS rtfWnTg5BAL/u/l35qixFEwXi4qhPNW+FlfHk7dZuOm7nF3QJzqbR8gJR3Ipe65l1e nNPP+hThaDOM55PBPX/p51vX28mA/PHXAy+v2gZOY+3eiAfuZtvxPFuc/qZHpeEyB0 NITKjd0nj8K7A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B45C567B0A for ; Thu, 11 Sep 2025 15:44:55 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id frdlJ55zCFFI for ; Thu, 11 Sep 2025 15:44:55 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757627095; bh=WFV3wswtdB85tjYPm2OE0X/7tCcr+0NY8bcE6pSVs+8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bsAV9w8gqTJjh4Lwx3vxO7NNZTLkYatKhultA+4ryD1dlqL4Q4AG/OOO1GYVyQyof 0uegKBC5uTHiM6eqJ/wKpmypco1jF2uzP1fJd1c7t+em5deMipXbDiNEdhKoxCa6fz Ph6o6uYUJNP2fQJH9/9KhvIUsAXEa0671ej3gOkKUiF2p6YUxb//SgNKREdAaErSWS rtfWnTg5BAL/u/l35qixFEwXi4qhPNW+FlfHk7dZuOm7nF3QJzqbR8gJR3Ipe65l1e nNPP+hThaDOM55PBPX/p51vX28mA/PHXAy+v2gZOY+3eiAfuZtvxPFuc/qZHpeEyB0 NITKjd0nj8K7A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A490567B0D for ; Thu, 11 Sep 2025 15:44:55 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757627094; bh=GxWb84WuhrRecmqNXT73luZ7C8F11SfhreNTrpy4JeE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NAxoH8DD4OvUphohSdxE1MogC0S6K5PQhREOiNQKFFrpZzpLVUCxdeN1Z1jI/X1// 7sU1l9tb4DD7szU1blGNaT5MLIpkkGDnaQK2pFqh6QdioYQJubkJ2BOaJIu2bTkyZQ TBg8Y3LKzZD8jaqKZJPfDPpso1KbtAgGMbMBW4ndm/FzM0miCp9v0C49aY9cUxU8cF gK1uHACIP38SFcuvhHOvlAn3DCSxRf4PjAkzAU6ao2RNKt1EPncDL+ko6oHg0yQ7F/ mdrIEMamg4DNMz9eR4MO8rUybw5kRh7bjGpFEr49WCEcuJyQIDmDt0mBVLHtZtHkJw kcYpMtCgfQRuw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5B1DB67B0A; Thu, 11 Sep 2025 15:44:54 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id UU8G4SIDyFrz; Thu, 11 Sep 2025 15:44:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757627089; bh=hn3ziUzubjsDk8u2/Z+zCTq8dmy88kj3mrIHMQj2RAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GvSN237vG1CePIrlmUVVYih8xI8Ny7kfP0oc9sPyx7F8DE5UvNlScR8SDvsiwDoqs 7Nh4LiP89z8X1N0ot93Mn7FsnnVH5QOKhecvMnrzePDEOjOGnd9c4MhzaoBSL1STqq oN3unOUnKKu4H0Uan9amRpJ6cAyjDSmwBWDg9rqbx0NBbtXznQ7BxebICb7Kd0d8Bf joWoXQRBOAB7lS3s/QA63ArUF/jW5Iesyownp6AzgHE8wIiSXcWxrQf8AmVpf960s7 YS2JxT+BWSqgW1hbqiVd1lvntoRFqMC34ASp3ATpGP+O8d5D0sM2mpki8KtcIn3Dp+ X+LBD0AEbBsEw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 43078679D6; Thu, 11 Sep 2025 15:44:49 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 11 Sep 2025 15:44:08 -0600 Message-ID: <20250911214425.3687188-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250911214425.3687188-1-sjg@u-boot.org> References: <20250911214425.3687188-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: PL2REGMDP4Y33FXBEDWDHE4NKK4HHMPB X-Message-ID-Hash: PL2REGMDP4Y33FXBEDWDHE4NKK4HHMPB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/14] examples: Correct dependencies for ulib List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass We need to check for the ulib library before building any examples. Add this and ensure that the examples are rebuilt if the library changes. Signed-off-by: Simon Glass --- examples/ulib/rules.mk | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/ulib/rules.mk b/examples/ulib/rules.mk index aba6c63d8b6..c4b0bdb3668 100644 --- a/examples/ulib/rules.mk +++ b/examples/ulib/rules.mk @@ -19,11 +19,11 @@ $(foreach obj,$(sys-objs),$(eval $(OUTDIR)/$(obj): \ # Automatic build rules for all programs $(foreach prog,$(progs),$(eval $(OUTDIR)/$(prog): \ - $$(addprefix $(OUTDIR)/,$$($(prog)_objs)) ; \ - $$(CC) $$(CFLAGS) -o $$@ $$^ $$(SHARED_LDFLAGS))) + $$(addprefix $(OUTDIR)/,$$($(prog)_objs)) $(UBOOT_BUILD)/libu-boot.so ; \ + $$(CC) $$(CFLAGS) -o $$@ $$(filter-out %.so,$$^) $$(SHARED_LDFLAGS))) $(foreach prog,$(progs),$(eval $(OUTDIR)/$(prog)_static: \ - $$(addprefix $(OUTDIR)/,$$($(prog)_objs)) ; \ - $$(CC) $$(CFLAGS) -o $$@ $$^ $$(STATIC_LDFLAGS))) + $$(addprefix $(OUTDIR)/,$$($(prog)_objs)) $(UBOOT_BUILD)/libu-boot.a ; \ + $$(CC) $$(CFLAGS) -o $$@ $$(filter-out %.a,$$^) $$(STATIC_LDFLAGS))) # Create the output directory if it doesn't exist $(OUTDIR): @@ -32,8 +32,3 @@ $(OUTDIR): # Default rule: compile with U-Boot headers $(OUTDIR)/%.o: $(EXAMPLE_DIR)/%.c | $(OUTDIR) $(CC) $(CFLAGS) $(UBOOT_CFLAGS) -c -o $@ $< - -# The U-Boot library must be built before we can link against it -# Order-only prerequisites ensure libraries exist before linking -$(all_bins): | $(UBOOT_BUILD)/libu-boot.a $(UBOOT_BUILD)/libu-boot.so \ - $(OUTDIR) \ No newline at end of file