From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 0256C2C8 for ; Tue, 20 Jun 2017 23:21:48 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9F3ED20756; Tue, 20 Jun 2017 17:21:48 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 20 Jun 2017 17:21:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:date:from:message-id:subject:to:x-me-sender:x-me-sender :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=O53FlsmfZAYEFLWeeyYma5nzgkV ueZexFCglTdru/Zw=; b=kXNspBH6sVo5eElNlE/tgamgKrnaifXm3/Lok1c7NdQ 2CXIXi9ZIAgXqagWuxalDlHWrE0bb79YBCGPDlInSaYucf2xssxoM9ZrQEmBPIpJ WRV6N+XlunvQ3XqEGo2gXUvAxF3G20Tjz8OqRxjvK4dxT2nThFMeHunBDQrCPakI = DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=O53Fls mfZAYEFLWeeyYma5nzgkVueZexFCglTdru/Zw=; b=LV5mc8YUs1yLFY2XZh0Pjm abTeC+wfqdvuDqlr315DuWlfnI9VZrfvyaNWrwFm+QojLcszofITyPUDIzORCEVE gqN1zTAjZ7rXo1aUy/255ZZVTcggJkPI6l6wU1V7lfd2vBSqKHqOBNxOK+UQX+pr b90Qxi7bmXpedoSx563xDUKBNao591cc3ywwAiDvS9zVdqWe6Kx4vr91IviUpcJ2 JW8TDZ1/GlCSiene3qx9Rbwem/em84VDGig4NNCf6njcCmNqyfQe2RLfXtuyNl05 Pfb6mi4bdxo7hy2+zCSv27BvXDeFBbz7JIAEXsujVLQ5TXY9QrtXHo5OYI4o1gEg == X-ME-Sender: X-Sasl-enc: G7DzxUoHxSj3C+RJ1xfk6zyyP40JjYBqU07sqoV0zKBB 1497993708 Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id EB9257E7E6; Tue, 20 Jun 2017 17:21:47 -0400 (EDT) From: Thomas Monjalon To: gaetan.rivet@6wind.com Cc: dev@dpdk.org Date: Tue, 20 Jun 2017 23:21:39 +0200 Message-Id: <20170620212139.9508-1-thomas@monjalon.net> X-Mailer: git-send-email 2.13.1 Subject: [dpdk-dev] [RFC PATCH] mk: symlink every headers first X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 21:21:49 -0000 If a library or a build tool uses a definition from a driver, there is a build ordering issue, like seen when moving PCI code into a bus driver. One option is to keep PCI helpers and some common definitions in EAL. The other option is to symlink every headers at the beginning of the build so they can be included by any other component. This patch shows how to achieve the second option. Signed-off-by: Thomas Monjalon --- mk/internal/rte.install-post.mk | 2 ++ mk/rte.sdkbuild.mk | 9 ++++++++- mk/rte.subdir.mk | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mk/internal/rte.install-post.mk b/mk/internal/rte.install-post.mk index b99e2b2f7..61804561f 100644 --- a/mk/internal/rte.install-post.mk +++ b/mk/internal/rte.install-post.mk @@ -55,7 +55,9 @@ $(foreach dir,$(INSTALL-DIRS-y),\ # arg1: relative install dir in RTE_OUTPUT # arg2: relative file name in a source dir (VPATH) # +.PHONY: headers define symlink_rule +headers: $(addprefix $(RTE_OUTPUT)/$(1)/,$(notdir $(2))) $(addprefix $(RTE_OUTPUT)/$(1)/,$(notdir $(2))): $(2) @echo " SYMLINK-FILE $(addprefix $(1)/,$(notdir $(2)))" @[ -d $(RTE_OUTPUT)/$(1) ] || mkdir -p $(RTE_OUTPUT)/$(1) diff --git a/mk/rte.sdkbuild.mk b/mk/rte.sdkbuild.mk index 0bf909e9e..ec04ccb2b 100644 --- a/mk/rte.sdkbuild.mk +++ b/mk/rte.sdkbuild.mk @@ -67,9 +67,16 @@ clean: $(CLEANDIRS) .PHONY: test-build test-build: test +.PHONY: headers +headers: $(addprefix headers-, $(ROOTDIRS-y)) +headers-%: + @[ -d $(BUILDDIR)/$* ] || mkdir -p $(BUILDDIR)/$* + $(Q)$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* \ + -srR headers + .SECONDEXPANSION: .PHONY: $(ROOTDIRS-y) $(ROOTDIRS-) -$(ROOTDIRS-y) $(ROOTDIRS-): +$(ROOTDIRS-y) $(ROOTDIRS-): headers @[ -d $(BUILDDIR)/$@ ] || mkdir -p $(BUILDDIR)/$@ @echo "== Build $@" $(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all diff --git a/mk/rte.subdir.mk b/mk/rte.subdir.mk index 92f5de4c8..3ae4ce525 100644 --- a/mk/rte.subdir.mk +++ b/mk/rte.subdir.mk @@ -57,6 +57,13 @@ _postinstall: build .PHONY: build build: _postbuild +.PHONY: headers +headers: $(addprefix headers-, $(DIRS-y)) +headers-%: + @[ -d $(CURDIR)/$* ] || mkdir -p $(CURDIR)/$* + @$(MAKE) S=$S/$* -f $(SRCDIR)/$*/Makefile -C $(CURDIR)/$* \ + -srR headers + .SECONDEXPANSION: .PHONY: $(DIRS-y) $(DIRS-y): -- 2.13.1