From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id C93497E2B for ; Mon, 6 Oct 2014 12:45:37 +0200 (CEST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by fmsmga103.fm.intel.com with ESMTP; 06 Oct 2014 03:43:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,663,1406617200"; d="scan'208";a="482220575" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by azsmga001.ch.intel.com with ESMTP; 06 Oct 2014 03:52:39 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s96AqbWT021172; Mon, 6 Oct 2014 11:52:38 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s96AqbJW003430; Mon, 6 Oct 2014 11:52:37 +0100 Received: (from smonroy@localhost) by sivswdev02.ir.intel.com with id s96Aqb2r003426; Mon, 6 Oct 2014 11:52:37 +0100 From: Sergio Gonzalez Monroy To: dev@dpdk.org Date: Mon, 6 Oct 2014 11:52:34 +0100 Message-Id: <1412592755-3370-4-git-send-email-sergio.gonzalez.monroy@intel.com> X-Mailer: git-send-email 1.8.5.4 In-Reply-To: <1412592755-3370-1-git-send-email-sergio.gonzalez.monroy@intel.com> References: <1412265386-26291-1-git-send-email-sergio.gonzalez.monroy@intel.com> <1412592755-3370-1-git-send-email-sergio.gonzalez.monroy@intel.com> Subject: [dpdk-dev] [PATCH v2 3/4] Update library build process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2014 10:45:38 -0000 Remove COMBINE_LIBS option and by default build: - CONFIG_RTE_BUILD_SHARED_LIB=y : both individual and combined libraries - CONFIG_RTE_BUILD_SHARED_LIB=n : single combined library Signed-off-by: Sergio Gonzalez Monroy --- config/common_bsdapp | 3 +-- config/common_linuxapp | 3 +-- mk/rte.lib.mk | 73 ++++++++------------------------------------------ mk/rte.sdkbuild.mk | 2 +- mk/rte.sharelib.mk | 41 +++++++++++----------------- mk/rte.vars.mk | 4 --- 6 files changed, 29 insertions(+), 97 deletions(-) diff --git a/config/common_bsdapp b/config/common_bsdapp index eebd05b..65d2ecc 100644 --- a/config/common_bsdapp +++ b/config/common_bsdapp @@ -79,9 +79,8 @@ CONFIG_RTE_FORCE_INTRINSICS=n CONFIG_RTE_BUILD_SHARED_LIB=n # -# Combine to one single library +# Library name # -CONFIG_RTE_BUILD_COMBINE_LIBS=n CONFIG_RTE_LIBNAME=intel_dpdk # diff --git a/config/common_linuxapp b/config/common_linuxapp index 4713eb4..5bdcdf3 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -79,9 +79,8 @@ CONFIG_RTE_FORCE_INTRINSICS=n CONFIG_RTE_BUILD_SHARED_LIB=n # -# Combine to one single library +# Library name # -CONFIG_RTE_BUILD_COMBINE_LIBS=n CONFIG_RTE_LIBNAME="intel_dpdk" # diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk index f458258..e7420bf 100644 --- a/mk/rte.lib.mk +++ b/mk/rte.lib.mk @@ -66,48 +66,23 @@ LD_MULDEFS := $(call linkerprefix,-z$(comma)muldefs) CPU_LDFLAGS := $(call linkerprefix,$(CPU_LDFLAGS)) endif -O_TO_A = $(AR) crus $(LIB) $(OBJS-y) -O_TO_A_STR = $(subst ','\'',$(O_TO_A)) #'# fix syntax highlight -O_TO_A_DISP = $(if $(V),"$(O_TO_A_STR)"," AR $(@)") -O_TO_A_CMD = "cmd_$@ = $(O_TO_A_STR)" -O_TO_A_DO = @set -e; \ - echo $(O_TO_A_DISP); \ - $(O_TO_A) && \ - echo $(O_TO_A_CMD) > $(call exe2cmd,$(@)) - O_TO_S = $(LD) $(CPU_LDFLAGS) $(LD_MULDEFS) -shared $(OBJS-y) -o $(LIB) -O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight +O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #') # fix syntax highlight O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)"," LD $(@)") +O_TO_S_CMD = "cmd_$@ = $(O_TO_S_STR)" O_TO_S_DO = @set -e; \ + cp -f $(OBJS-y) $(RTE_OUTPUT)/build/lib; \ echo $(O_TO_S_DISP); \ $(O_TO_S) && \ echo $(O_TO_S_CMD) > $(call exe2cmd,$(@)) -ifeq ($(RTE_BUILD_SHARED_LIB),n) -O_TO_C = $(AR) crus $(LIB_ONE) $(OBJS-y) -O_TO_C_STR = $(subst ','\'',$(O_TO_C)) #'# fix syntax highlight -O_TO_C_DISP = $(if $(V),"$(O_TO_C_STR)"," AR_C $(@)") -O_TO_C_DO = @set -e; \ - $(lib_dir) \ - $(copy_obj) -else -O_TO_C = $(LD) $(LD_MULDEFS) -shared $(OBJS-y) -o $(LIB_ONE) -O_TO_C_STR = $(subst ','\'',$(O_TO_C)) #'# fix syntax highlight -O_TO_C_DISP = $(if $(V),"$(O_TO_C_STR)"," LD_C $(@)") -O_TO_C_DO = @set -e; \ - $(lib_dir) \ - $(copy_obj) -endif - -copy_obj = cp -f $(OBJS-y) $(RTE_OUTPUT)/build/lib; -lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib; -include .$(LIB).cmd # # Archive objects in .a file if needed # -ifeq ($(RTE_BUILD_SHARED_LIB),y) $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE +ifeq ($(RTE_BUILD_SHARED_LIB),y) @[ -d $(dir $@) ] || mkdir -p $(dir $@) $(if $(D),\ @echo -n "$< -> $@ " ; \ @@ -116,51 +91,25 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE echo -n "depfile_missing=$(call boolean,$(depfile_missing)) " ; \ echo "depfile_newer=$(call boolean,$(depfile_newer)) ") $(if $(or \ - $(file_missing),\ - $(call cmdline_changed,$(O_TO_S_STR)),\ - $(depfile_missing),\ - $(depfile_newer)),\ - $(O_TO_S_DO)) -ifeq ($(RTE_BUILD_COMBINE_LIBS),y) - $(if $(or \ - $(file_missing),\ - $(call cmdline_changed,$(O_TO_C_STR)),\ - $(depfile_missing),\ - $(depfile_newer)),\ - $(O_TO_C_DO)) -endif -else -$(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE - @[ -d $(dir $@) ] || mkdir -p $(dir $@) - $(if $(D),\ - @echo -n "$< -> $@ " ; \ - echo -n "file_missing=$(call boolean,$(file_missing)) " ; \ - echo -n "cmdline_changed=$(call boolean,$(call cmdline_changed,$(O_TO_A_STR))) " ; \ - echo -n "depfile_missing=$(call boolean,$(depfile_missing)) " ; \ - echo "depfile_newer=$(call boolean,$(depfile_newer)) ") - $(if $(or \ $(file_missing),\ - $(call cmdline_changed,$(O_TO_A_STR)),\ + $(call cmdline_changed,$(O_TO_S_STR)),\ $(depfile_missing),\ $(depfile_newer)),\ - $(O_TO_A_DO)) -ifeq ($(RTE_BUILD_COMBINE_LIBS),y) - $(if $(or \ - $(file_missing),\ - $(call cmdline_changed,$(O_TO_C_STR)),\ - $(depfile_missing),\ - $(depfile_newer)),\ - $(O_TO_C_DO)) -endif + $(O_TO_S_DO)) +else + @set -e; \ + cp -f $(OBJS-y) $(RTE_OUTPUT)/build/lib; endif # # install lib in $(RTE_OUTPUT)/lib # $(RTE_OUTPUT)/lib/$(LIB): $(LIB) +ifeq ($(RTE_BUILD_SHARED_LIB),y) @echo " INSTALL-LIB $(LIB)" @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib +endif # # Clean all generated files diff --git a/mk/rte.sdkbuild.mk b/mk/rte.sdkbuild.mk index 3154457..f20ec1e 100644 --- a/mk/rte.sdkbuild.mk +++ b/mk/rte.sdkbuild.mk @@ -93,7 +93,7 @@ $(ROOTDIRS-y): @[ -d $(BUILDDIR)/$@ ] || mkdir -p $(BUILDDIR)/$@ @echo "== Build $@" $(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all - @if [ $@ = lib -a $(RTE_BUILD_COMBINE_LIBS) = y ]; then \ + @if [ $@ = lib ]; then \ $(MAKE) -f $(RTE_SDK)/lib/Makefile sharelib; \ fi diff --git a/mk/rte.sharelib.mk b/mk/rte.sharelib.mk index 73ce709..8fc6548 100644 --- a/mk/rte.sharelib.mk +++ b/mk/rte.sharelib.mk @@ -34,13 +34,11 @@ include $(RTE_SDK)/mk/internal/rte.build-pre.mk # VPATH contains at least SRCDIR VPATH += $(SRCDIR) -ifeq ($(RTE_BUILD_COMBINE_LIBS),y) ifeq ($(RTE_BUILD_SHARED_LIB),y) LIB_ONE := lib$(RTE_LIBNAME).so else LIB_ONE := lib$(RTE_LIBNAME).a endif -endif ifeq ($(LINK_USING_CC),1) # Override the definition of LD here, since we're linking with CC @@ -54,37 +52,28 @@ sharelib: $(LIB_ONE) FORCE OBJS = $(wildcard $(RTE_OUTPUT)/build/lib/*.o) -O_TO_S = $(LD) $(CPU_LDFLAGS) $(LD_MULDEFS) -shared $(OBJS)\ +ifeq ($(RTE_BUILD_SHARED_LIB),y) +O_TO_L = $(LD) $(CPU_LDFLAGS) $(LD_MULDEFS) -shared $(OBJS)\ -o $(RTE_OUTPUT)/lib/$(LIB_ONE) -O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight -O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)"," LD $(@)") -O_TO_S_CMD = "cmd_$@ = $(O_TO_S_STR)" -O_TO_S_DO = @set -e; \ - echo $(O_TO_S_DISP); \ - $(O_TO_S) +L_DISP=LD +else +O_TO_L = $(AR) crus $(RTE_OUTPUT)/lib/$(LIB_ONE) $(OBJS) +L_DISP=AR +endif +O_TO_L_STR = $(subst ','\'',$(O_TO_L)) #')# fix syntax highlight +O_TO_L_DISP = $(if $(V),"$(O_TO_L_STR)"," $(L_DISP) $(@)") +O_TO_L_CMD = "cmd_$@ = $(O_TO_L_STR)" +O_TO_L_DO = @set -e; \ + mkdir -p $(RTE_OUTPUT)/lib; \ + echo $(O_TO_L_DISP); \ + $(O_TO_L) -O_TO_A = $(AR) crus $(RTE_OUTPUT)/lib/$(LIB_ONE) $(OBJS) -O_TO_A_STR = $(subst ','\'',$(O_TO_A)) #'# fix syntax highlight -O_TO_A_DISP = $(if $(V),"$(O_TO_A_STR)"," LD $(@)") -O_TO_A_CMD = "cmd_$@ = $(O_TO_A_STR)" -O_TO_A_DO = @set -e; \ - echo $(O_TO_A_DISP); \ - $(O_TO_A) # # Archive objects to share library # -ifeq ($(RTE_BUILD_COMBINE_LIBS),y) -ifeq ($(RTE_BUILD_SHARED_LIB),y) $(LIB_ONE): FORCE - @[ -d $(dir $@) ] || mkdir -p $(dir $@) - $(O_TO_S_DO) -else -$(LIB_ONE): FORCE - @[ -d $(dir $@) ] || mkdir -p $(dir $@) - $(O_TO_A_DO) -endif -endif + $(O_TO_L_DO) # # Clean all generated files diff --git a/mk/rte.vars.mk b/mk/rte.vars.mk index 1e874ee..5bcc4a5 100644 --- a/mk/rte.vars.mk +++ b/mk/rte.vars.mk @@ -67,10 +67,6 @@ ifneq ($(BUILDING_RTE_SDK),) ifeq ($(RTE_BUILD_SHARED_LIB),) RTE_BUILD_SHARED_LIB := n endif - RTE_BUILD_COMBINE_LIBS := $(CONFIG_RTE_BUILD_COMBINE_LIBS:"%"=%) - ifeq ($(RTE_BUILD_COMBINE_LIBS),) - RTE_BUILD_COMBINE_LIBS := n - endif RTE_LIBNAME := $(CONFIG_RTE_LIBNAME:"%"=%) ifeq ($(RTE_LIBNAME),) RTE_LIBNAME := intel_dpdk -- 1.9.3