* [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk. @ 2015-05-01 14:22 Keith Wiles 2015-05-01 14:22 ` [dpdk-dev] [PATCH v6 2/2] Update Docs for new EXTRA_LDLIBS variable Keith Wiles 2015-05-04 9:18 ` [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk Olivier MATZ 0 siblings, 2 replies; 11+ messages in thread From: Keith Wiles @ 2015-05-01 14:22 UTC (permalink / raw) To: dev Trying to simplify the ifdefs in rte.app.mk to make the code more readable and maintainable by moving LDLIBS variable to use the same style as LDLIBS-y being used in the rest of the code. Added a new variable called EXTRA_LDLIBS to be used by example apps instead of using LDLIBS directly. The new internal variable _LDLIBS should not be used outside of the rte.app.mk file. The makefiles can still use LDLIBS, but I would suggest using EXTRA_LDLIBS instead. Signed-off-by: Keith Wiles <keith.wiles@intel.com> --- examples/dpdk_qat/Makefile | 4 +- examples/vm_power_manager/Makefile | 2 +- mk/rte.app.mk | 242 +++++++++---------------------------- 3 files changed, 63 insertions(+), 185 deletions(-) diff --git a/examples/dpdk_qat/Makefile b/examples/dpdk_qat/Makefile index f1e06a1..90ca1d3 100644 --- a/examples/dpdk_qat/Makefile +++ b/examples/dpdk_qat/Makefile @@ -77,8 +77,8 @@ else ICP_LIBRARY_PATH = $(ICP_ROOT)/build/libicp_qa_al.a endif -LDLIBS += -L$(ICP_ROOT)/build -LDLIBS += $(ICP_LIBRARY_PATH) \ +EXTRA_LDLIBS += -L$(ICP_ROOT)/build +EXTRA_LDLIBS += $(ICP_LIBRARY_PATH) \ -lz \ -losal \ -ladf_proxy \ diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile index 113dbc4..8fb78d4 100644 --- a/examples/vm_power_manager/Makefile +++ b/examples/vm_power_manager/Makefile @@ -48,7 +48,7 @@ SRCS-y += channel_monitor.c CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ CFLAGS += $(WERROR_FLAGS) -LDLIBS += -lvirt +EXTRA_LDLIBS += -lvirt # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 62a76ae..b8030d2 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -1,7 +1,7 @@ # BSD LICENSE # -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. -# Copyright(c) 2014 6WIND S.A. +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. +# Copyright(c) 2014-2015 6WIND S.A. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT) endif # default path for libs -LDLIBS += -L$(RTE_SDK_BIN)/lib +_LDLIBS-y += -L$(RTE_SDK_BIN)/lib # # Include libraries depending on config if NO_AUTOLIBS is not set @@ -59,215 +59,93 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib # ifeq ($(NO_AUTOLIBS),) -LDLIBS += --whole-archive +_LDLIBS-y += --whole-archive -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) -LDLIBS += -l$(RTE_LIBNAME) -endif +_LDLIBS-$(CONFIG_RTE_BUILD_COMBINE_LIBS) += -l$(RTE_LIBNAME) ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) -ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) -LDLIBS += -lrte_distributor -endif - -ifeq ($(CONFIG_RTE_LIBRTE_REORDER),y) -LDLIBS += -lrte_reorder -endif +_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor +_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder -ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) -LDLIBS += -lrte_kni -endif +_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni +_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem endif -ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y) -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) -LDLIBS += -lrte_ivshmem -endif -endif +_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline +_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table +_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port +_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer +_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash +_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats +_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm +_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power +_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl +_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter -ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y) -LDLIBS += -lrte_pipeline -endif +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt -ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y) -LDLIBS += -lrte_table -endif - -ifeq ($(CONFIG_RTE_LIBRTE_PORT),y) -LDLIBS += -lrte_port -endif - -ifeq ($(CONFIG_RTE_LIBRTE_TIMER),y) -LDLIBS += -lrte_timer -endif - -ifeq ($(CONFIG_RTE_LIBRTE_HASH),y) -LDLIBS += -lrte_hash -endif - -ifeq ($(CONFIG_RTE_LIBRTE_JOBSTATS),y) -LDLIBS += -lrte_jobstats -endif - -ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) -LDLIBS += -lrte_lpm -endif - -ifeq ($(CONFIG_RTE_LIBRTE_POWER),y) -LDLIBS += -lrte_power -endif - -ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) -LDLIBS += -lrte_acl -endif - -ifeq ($(CONFIG_RTE_LIBRTE_METER),y) -LDLIBS += -lrte_meter -endif - -ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) -LDLIBS += -lrte_sched -LDLIBS += -lm -LDLIBS += -lrt -endif - -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) -LDLIBS += -lrte_vhost -endif +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) -LDLIBS += -lpcap -endif +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap -ifeq ($(CONFIG_RTE_LIBRTE_VHOST)$(CONFIG_RTE_LIBRTE_VHOST_USER),yn) -LDLIBS += -lfuse +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse endif -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) -LDLIBS += -libverbs -endif +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs -LDLIBS += --start-group +_LDLIBS-y += --start-group ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) -ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) -LDLIBS += -lrte_kvargs -endif - -ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y) -LDLIBS += -lrte_mbuf -endif - -ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y) -LDLIBS += -lrte_ip_frag -endif - -ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y) -LDLIBS += -lethdev -endif - -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y) -LDLIBS += -lrte_malloc -endif - -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y) -LDLIBS += -lrte_mempool -endif - -ifeq ($(CONFIG_RTE_LIBRTE_RING),y) -LDLIBS += -lrte_ring -endif - -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) -LDLIBS += -lrte_eal -endif - -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) -LDLIBS += -lrte_cmdline -endif - -ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y) -LDLIBS += -lrte_cfgfile -endif - -ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) -LDLIBS += -lrte_pmd_bond -endif - -ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) -LDLIBS += -lrte_pmd_xenvirt -LDLIBS += -lxenstore -endif +_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs +_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf +_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag +_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev +_LDLIBS-$(CONFIG_RTE_LIBRTE_MALLOC) += -lrte_malloc +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool +_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring +_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal +_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond + +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) # plugins (link only if static libraries) -ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) -LDLIBS += -lrte_pmd_vmxnet3_uio -endif - -ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) -LDLIBS += -lrte_pmd_virtio -endif - -ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) -LDLIBS += -lrte_pmd_enic -endif - -ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) -LDLIBS += -lrte_pmd_i40e -endif - -ifeq ($(CONFIG_RTE_LIBRTE_FM10K_PMD),y) -LDLIBS += -lrte_pmd_fm10k -endif - -ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) -LDLIBS += -lrte_pmd_ixgbe -endif - -ifeq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y) -LDLIBS += -lrte_pmd_e1000 -endif - -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) -LDLIBS += -lrte_pmd_mlx4 -endif - -ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) -LDLIBS += -lrte_pmd_ring -endif - -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) -LDLIBS += -lrte_pmd_pcap -endif - -ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) -LDLIBS += -lrte_pmd_af_packet -endif - -ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) -LDLIBS += -lrte_pmd_null -endif - -endif # plugins +_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio +_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e +_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k +_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe +_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null + +endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB) endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS -LDLIBS += $(EXECENV_LDLIBS) - -LDLIBS += --end-group - -LDLIBS += --no-whole-archive +_LDLIBS-y += $(EXECENV_LDLIBS) +_LDLIBS-y += --end-group +_LDLIBS-y += --no-whole-archive endif # ifeq ($(NO_AUTOLIBS),) -LDLIBS += $(CPU_LDLIBS) +LDLIBS += $(_LDLIBS-y) $(EXTRA_LDLIBS) .PHONY: all all: install -- 2.3.0 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [dpdk-dev] [PATCH v6 2/2] Update Docs for new EXTRA_LDLIBS variable 2015-05-01 14:22 [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk Keith Wiles @ 2015-05-01 14:22 ` Keith Wiles 2015-05-04 9:18 ` [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk Olivier MATZ 1 sibling, 0 replies; 11+ messages in thread From: Keith Wiles @ 2015-05-01 14:22 UTC (permalink / raw) To: dev Removed the LDLIBS-y reference as it is not required. Signed-off-by: Keith Wiles <keith.wiles@intel.com> --- doc/build-sdk-quick.txt | 1 + doc/guides/prog_guide/build_app.rst | 2 +- doc/guides/prog_guide/dev_kit_build_system.rst | 2 ++ doc/guides/prog_guide/dev_kit_root_make_help.rst | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt index 041a40e..26d5442 100644 --- a/doc/build-sdk-quick.txt +++ b/doc/build-sdk-quick.txt @@ -13,6 +13,7 @@ Build variables EXTRA_CPPFLAGS preprocessor options EXTRA_CFLAGS compiler options EXTRA_LDFLAGS linker options + EXTRA_LDLIBS linker libary options RTE_KERNELDIR linux headers path CROSS toolchain prefix V verbose diff --git a/doc/guides/prog_guide/build_app.rst b/doc/guides/prog_guide/build_app.rst index d4a3261..983a48d 100644 --- a/doc/guides/prog_guide/build_app.rst +++ b/doc/guides/prog_guide/build_app.rst @@ -123,6 +123,6 @@ chapter for details. * CPPFLAGS: The flags to use to provide flags to the C preprocessor (only useful when assembling .S files) -* LDLIBS: A list of libraries to link with (for example, -L /path/to/libfoo - lfoo) +* LDLIBS: A list of libraries to link with (for example, -L /path/to/libfoo - lfoo) Use EXTRA_LDLIBS to add more options. * NO_AUTOLIBS: If set, the libraries provided by the framework will not be included in the LDLIBS variable automatically. diff --git a/doc/guides/prog_guide/dev_kit_build_system.rst b/doc/guides/prog_guide/dev_kit_build_system.rst index cf5c96f..b8ef167 100644 --- a/doc/guides/prog_guide/dev_kit_build_system.rst +++ b/doc/guides/prog_guide/dev_kit_build_system.rst @@ -413,6 +413,8 @@ Variables that Can be Set/Overridden by the User in a Makefile or Command Line * EXTRA_LDFLAGS: The content of this variable is appended after LDFLAGS when linking. +* EXTRA_LDLIBS: The content of this variable is appended after LDLIBS when linking. + * EXTRA_ASFLAGS: The content of this variable is appended after ASFLAGS when assembling. * EXTRA_CPPFLAGS: The content of this variable is appended after CPPFLAGS when using a C preprocessor on assembly files. diff --git a/doc/guides/prog_guide/dev_kit_root_make_help.rst b/doc/guides/prog_guide/dev_kit_root_make_help.rst index 4f30192..fdc5fea 100644 --- a/doc/guides/prog_guide/dev_kit_root_make_help.rst +++ b/doc/guides/prog_guide/dev_kit_root_make_help.rst @@ -205,7 +205,7 @@ The following variables can be specified on the command line: Enable dependency debugging. This provides some useful information about why a target is built or not. -* EXTRA_CFLAGS=, EXTRA_LDFLAGS=, EXTRA_ASFLAGS=, EXTRA_CPPFLAGS= +* EXTRA_CFLAGS=, EXTRA_LDFLAGS=, EXTRA_LDLIBS=, EXTRA_ASFLAGS=, EXTRA_CPPFLAGS= Append specific compilation, link or asm flags. -- 2.3.0 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk. 2015-05-01 14:22 [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk Keith Wiles 2015-05-01 14:22 ` [dpdk-dev] [PATCH v6 2/2] Update Docs for new EXTRA_LDLIBS variable Keith Wiles @ 2015-05-04 9:18 ` Olivier MATZ 2015-05-04 14:36 ` Wiles, Keith 2015-05-04 15:09 ` Wiles, Keith 1 sibling, 2 replies; 11+ messages in thread From: Olivier MATZ @ 2015-05-04 9:18 UTC (permalink / raw) To: Keith Wiles, dev Hi Keith, On 05/01/2015 04:22 PM, Keith Wiles wrote: > Trying to simplify the ifdefs in rte.app.mk to make the code > more readable and maintainable by moving LDLIBS variable to use > the same style as LDLIBS-y being used in the rest of the code. > > Added a new variable called EXTRA_LDLIBS to be used by example apps > instead of using LDLIBS directly. The new internal variable _LDLIBS > should not be used outside of the rte.app.mk file. The makefiles > can still use LDLIBS, but I would suggest using EXTRA_LDLIBS instead. Why are you suggesting to change LIBS to EXTRA_LIBS? We discussed in a previous thread that EXTRA_* variables should (as much as possible) be kept empty in Makefiles as it allows a user to append things in them. By the way, it would be easier to follow the different versions of your patches if you add "--in-reply-to <Message-ID>" in your git-send-email command, as described in http://dpdk.org/dev Regards, Olivier > > Signed-off-by: Keith Wiles <keith.wiles@intel.com> > --- > examples/dpdk_qat/Makefile | 4 +- > examples/vm_power_manager/Makefile | 2 +- > mk/rte.app.mk | 242 +++++++++---------------------------- > 3 files changed, 63 insertions(+), 185 deletions(-) > > diff --git a/examples/dpdk_qat/Makefile b/examples/dpdk_qat/Makefile > index f1e06a1..90ca1d3 100644 > --- a/examples/dpdk_qat/Makefile > +++ b/examples/dpdk_qat/Makefile > @@ -77,8 +77,8 @@ else > ICP_LIBRARY_PATH = $(ICP_ROOT)/build/libicp_qa_al.a > endif > > -LDLIBS += -L$(ICP_ROOT)/build > -LDLIBS += $(ICP_LIBRARY_PATH) \ > +EXTRA_LDLIBS += -L$(ICP_ROOT)/build > +EXTRA_LDLIBS += $(ICP_LIBRARY_PATH) \ > -lz \ > -losal \ > -ladf_proxy \ > diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile > index 113dbc4..8fb78d4 100644 > --- a/examples/vm_power_manager/Makefile > +++ b/examples/vm_power_manager/Makefile > @@ -48,7 +48,7 @@ SRCS-y += channel_monitor.c > CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ > CFLAGS += $(WERROR_FLAGS) > > -LDLIBS += -lvirt > +EXTRA_LDLIBS += -lvirt > > # workaround for a gcc bug with noreturn attribute > # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 > diff --git a/mk/rte.app.mk b/mk/rte.app.mk > index 62a76ae..b8030d2 100644 > --- a/mk/rte.app.mk > +++ b/mk/rte.app.mk > @@ -1,7 +1,7 @@ > # BSD LICENSE > # > -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. > -# Copyright(c) 2014 6WIND S.A. > +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. > +# Copyright(c) 2014-2015 6WIND S.A. > # All rights reserved. > # > # Redistribution and use in source and binary forms, with or without > @@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT) > endif > > # default path for libs > -LDLIBS += -L$(RTE_SDK_BIN)/lib > +_LDLIBS-y += -L$(RTE_SDK_BIN)/lib > > # > # Include libraries depending on config if NO_AUTOLIBS is not set > @@ -59,215 +59,93 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib > # > ifeq ($(NO_AUTOLIBS),) > > -LDLIBS += --whole-archive > +_LDLIBS-y += --whole-archive > > -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) > -LDLIBS += -l$(RTE_LIBNAME) > -endif > +_LDLIBS-$(CONFIG_RTE_BUILD_COMBINE_LIBS) += -l$(RTE_LIBNAME) > > ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) > > -ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) > -LDLIBS += -lrte_distributor > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_REORDER),y) > -LDLIBS += -lrte_reorder > -endif > +_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor > +_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder > > -ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) > ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) > -LDLIBS += -lrte_kni > -endif > +_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni > +_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem > endif > > -ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y) > -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) > -LDLIBS += -lrte_ivshmem > -endif > -endif > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline > +_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port > +_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer > +_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash > +_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats > +_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm > +_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power > +_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl > +_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter > > -ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y) > -LDLIBS += -lrte_pipeline > -endif > +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched > +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm > +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt > > -ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y) > -LDLIBS += -lrte_table > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_PORT),y) > -LDLIBS += -lrte_port > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_TIMER),y) > -LDLIBS += -lrte_timer > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_HASH),y) > -LDLIBS += -lrte_hash > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_JOBSTATS),y) > -LDLIBS += -lrte_jobstats > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) > -LDLIBS += -lrte_lpm > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_POWER),y) > -LDLIBS += -lrte_power > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) > -LDLIBS += -lrte_acl > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_METER),y) > -LDLIBS += -lrte_meter > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) > -LDLIBS += -lrte_sched > -LDLIBS += -lm > -LDLIBS += -lrt > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) > -LDLIBS += -lrte_vhost > -endif > +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost > > endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS > > -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > -LDLIBS += -lpcap > -endif > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap > > -ifeq ($(CONFIG_RTE_LIBRTE_VHOST)$(CONFIG_RTE_LIBRTE_VHOST_USER),yn) > -LDLIBS += -lfuse > +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) > +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse > endif > > -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) > -LDLIBS += -libverbs > -endif > +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs > > -LDLIBS += --start-group > +_LDLIBS-y += --start-group > > ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) > > -ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) > -LDLIBS += -lrte_kvargs > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y) > -LDLIBS += -lrte_mbuf > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y) > -LDLIBS += -lrte_ip_frag > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y) > -LDLIBS += -lethdev > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y) > -LDLIBS += -lrte_malloc > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y) > -LDLIBS += -lrte_mempool > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_RING),y) > -LDLIBS += -lrte_ring > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) > -LDLIBS += -lrte_eal > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) > -LDLIBS += -lrte_cmdline > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y) > -LDLIBS += -lrte_cfgfile > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) > -LDLIBS += -lrte_pmd_bond > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) > -LDLIBS += -lrte_pmd_xenvirt > -LDLIBS += -lxenstore > -endif > +_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs > +_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf > +_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag > +_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev > +_LDLIBS-$(CONFIG_RTE_LIBRTE_MALLOC) += -lrte_malloc > +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool > +_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring > +_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal > +_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline > +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond > + > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore > > ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) > # plugins (link only if static libraries) > > -ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) > -LDLIBS += -lrte_pmd_vmxnet3_uio > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) > -LDLIBS += -lrte_pmd_virtio > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) > -LDLIBS += -lrte_pmd_enic > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) > -LDLIBS += -lrte_pmd_i40e > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_FM10K_PMD),y) > -LDLIBS += -lrte_pmd_fm10k > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) > -LDLIBS += -lrte_pmd_ixgbe > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y) > -LDLIBS += -lrte_pmd_e1000 > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) > -LDLIBS += -lrte_pmd_mlx4 > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) > -LDLIBS += -lrte_pmd_ring > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > -LDLIBS += -lrte_pmd_pcap > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) > -LDLIBS += -lrte_pmd_af_packet > -endif > - > -ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) > -LDLIBS += -lrte_pmd_null > -endif > - > -endif # plugins > +_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio > +_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio > +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic > +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e > +_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k > +_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe > +_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 > +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null > + > +endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB) > > endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS > > -LDLIBS += $(EXECENV_LDLIBS) > - > -LDLIBS += --end-group > - > -LDLIBS += --no-whole-archive > +_LDLIBS-y += $(EXECENV_LDLIBS) > +_LDLIBS-y += --end-group > +_LDLIBS-y += --no-whole-archive > > endif # ifeq ($(NO_AUTOLIBS),) > > -LDLIBS += $(CPU_LDLIBS) > +LDLIBS += $(_LDLIBS-y) $(EXTRA_LDLIBS) > > .PHONY: all > all: install > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk. 2015-05-04 9:18 ` [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk Olivier MATZ @ 2015-05-04 14:36 ` Wiles, Keith 2015-05-04 15:26 ` Olivier MATZ 2015-05-04 15:09 ` Wiles, Keith 1 sibling, 1 reply; 11+ messages in thread From: Wiles, Keith @ 2015-05-04 14:36 UTC (permalink / raw) To: Olivier MATZ, dev On 5/4/15, 2:18 AM, "Olivier MATZ" <olivier.matz@6wind.com> wrote: >Hi Keith, > >On 05/01/2015 04:22 PM, Keith Wiles wrote: >> Trying to simplify the ifdefs in rte.app.mk to make the code >> more readable and maintainable by moving LDLIBS variable to use >> the same style as LDLIBS-y being used in the rest of the code. >> >> Added a new variable called EXTRA_LDLIBS to be used by example apps >> instead of using LDLIBS directly. The new internal variable _LDLIBS >> should not be used outside of the rte.app.mk file. The makefiles >> can still use LDLIBS, but I would suggest using EXTRA_LDLIBS instead. > >Why are you suggesting to change LIBS to EXTRA_LIBS? Hi Olivier, I do not change LIBS to EXTRA_LIBS as I did not touch those variables. I did add EXTRA_LDLIBS and let LDLIBS as it was in the patch. I also created LDLIBS-y as an internal variable. Did I miss your point here? ++Keith >We discussed in a previous thread that EXTRA_* variables should >(as much as possible) be kept empty in Makefiles as it allows a >user to append things in them. > >By the way, it would be easier to follow the different versions >of your patches if you add "--in-reply-to <Message-ID>" in your >git-send-email command, as described in http://dpdk.org/dev > >Regards, >Olivier > > >> >> Signed-off-by: Keith Wiles <keith.wiles@intel.com> >> --- >> examples/dpdk_qat/Makefile | 4 +- >> examples/vm_power_manager/Makefile | 2 +- >> mk/rte.app.mk | 242 >>+++++++++---------------------------- >> 3 files changed, 63 insertions(+), 185 deletions(-) >> >> diff --git a/examples/dpdk_qat/Makefile b/examples/dpdk_qat/Makefile >> index f1e06a1..90ca1d3 100644 >> --- a/examples/dpdk_qat/Makefile >> +++ b/examples/dpdk_qat/Makefile >> @@ -77,8 +77,8 @@ else >> ICP_LIBRARY_PATH = $(ICP_ROOT)/build/libicp_qa_al.a >> endif >> >> -LDLIBS += -L$(ICP_ROOT)/build >> -LDLIBS += $(ICP_LIBRARY_PATH) \ >> +EXTRA_LDLIBS += -L$(ICP_ROOT)/build >> +EXTRA_LDLIBS += $(ICP_LIBRARY_PATH) \ >> -lz \ >> -losal \ >> -ladf_proxy \ >> diff --git a/examples/vm_power_manager/Makefile >>b/examples/vm_power_manager/Makefile >> index 113dbc4..8fb78d4 100644 >> --- a/examples/vm_power_manager/Makefile >> +++ b/examples/vm_power_manager/Makefile >> @@ -48,7 +48,7 @@ SRCS-y += channel_monitor.c >> CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ >> CFLAGS += $(WERROR_FLAGS) >> >> -LDLIBS += -lvirt >> +EXTRA_LDLIBS += -lvirt >> >> # workaround for a gcc bug with noreturn attribute >> # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 >> diff --git a/mk/rte.app.mk b/mk/rte.app.mk >> index 62a76ae..b8030d2 100644 >> --- a/mk/rte.app.mk >> +++ b/mk/rte.app.mk >> @@ -1,7 +1,7 @@ >> # BSD LICENSE >> # >> -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. >> -# Copyright(c) 2014 6WIND S.A. >> +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. >> +# Copyright(c) 2014-2015 6WIND S.A. >> # All rights reserved. >> # >> # Redistribution and use in source and binary forms, with or without >> @@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT) >> endif >> >> # default path for libs >> -LDLIBS += -L$(RTE_SDK_BIN)/lib >> +_LDLIBS-y += -L$(RTE_SDK_BIN)/lib >> >> # >> # Include libraries depending on config if NO_AUTOLIBS is not set >> @@ -59,215 +59,93 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib >> # >> ifeq ($(NO_AUTOLIBS),) >> >> -LDLIBS += --whole-archive >> +_LDLIBS-y += --whole-archive >> >> -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) >> -LDLIBS += -l$(RTE_LIBNAME) >> -endif >> +_LDLIBS-$(CONFIG_RTE_BUILD_COMBINE_LIBS) += -l$(RTE_LIBNAME) >> >> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >> >> -ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) >> -LDLIBS += -lrte_distributor >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_REORDER),y) >> -LDLIBS += -lrte_reorder >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder >> >> -ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) >> ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >> -LDLIBS += -lrte_kni >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem >> endif >> >> -ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y) >> -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >> -LDLIBS += -lrte_ivshmem >> -endif >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter >> >> -ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y) >> -LDLIBS += -lrte_pipeline >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt >> >> -ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y) >> -LDLIBS += -lrte_table >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PORT),y) >> -LDLIBS += -lrte_port >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_TIMER),y) >> -LDLIBS += -lrte_timer >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_HASH),y) >> -LDLIBS += -lrte_hash >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_JOBSTATS),y) >> -LDLIBS += -lrte_jobstats >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) >> -LDLIBS += -lrte_lpm >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_POWER),y) >> -LDLIBS += -lrte_power >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) >> -LDLIBS += -lrte_acl >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_METER),y) >> -LDLIBS += -lrte_meter >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) >> -LDLIBS += -lrte_sched >> -LDLIBS += -lm >> -LDLIBS += -lrt >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) >> -LDLIBS += -lrte_vhost >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost >> >> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >> >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >> -LDLIBS += -lpcap >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap >> >> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST)$(CONFIG_RTE_LIBRTE_VHOST_USER),yn) >> -LDLIBS += -lfuse >> +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse >> endif >> >> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >> -LDLIBS += -libverbs >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs >> >> -LDLIBS += --start-group >> +_LDLIBS-y += --start-group >> >> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >> >> -ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) >> -LDLIBS += -lrte_kvargs >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y) >> -LDLIBS += -lrte_mbuf >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y) >> -LDLIBS += -lrte_ip_frag >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y) >> -LDLIBS += -lethdev >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y) >> -LDLIBS += -lrte_malloc >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y) >> -LDLIBS += -lrte_mempool >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_RING),y) >> -LDLIBS += -lrte_ring >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) >> -LDLIBS += -lrte_eal >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) >> -LDLIBS += -lrte_cmdline >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y) >> -LDLIBS += -lrte_cfgfile >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) >> -LDLIBS += -lrte_pmd_bond >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) >> -LDLIBS += -lrte_pmd_xenvirt >> -LDLIBS += -lxenstore >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MALLOC) += -lrte_malloc >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond >> + >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore >> >> ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) >> # plugins (link only if static libraries) >> >> -ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) >> -LDLIBS += -lrte_pmd_vmxnet3_uio >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) >> -LDLIBS += -lrte_pmd_virtio >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) >> -LDLIBS += -lrte_pmd_enic >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) >> -LDLIBS += -lrte_pmd_i40e >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_FM10K_PMD),y) >> -LDLIBS += -lrte_pmd_fm10k >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) >> -LDLIBS += -lrte_pmd_ixgbe >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y) >> -LDLIBS += -lrte_pmd_e1000 >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >> -LDLIBS += -lrte_pmd_mlx4 >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) >> -LDLIBS += -lrte_pmd_ring >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >> -LDLIBS += -lrte_pmd_pcap >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) >> -LDLIBS += -lrte_pmd_af_packet >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) >> -LDLIBS += -lrte_pmd_null >> -endif >> - >> -endif # plugins >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null >> + >> +endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB) >> >> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >> >> -LDLIBS += $(EXECENV_LDLIBS) >> - >> -LDLIBS += --end-group >> - >> -LDLIBS += --no-whole-archive >> +_LDLIBS-y += $(EXECENV_LDLIBS) >> +_LDLIBS-y += --end-group >> +_LDLIBS-y += --no-whole-archive >> >> endif # ifeq ($(NO_AUTOLIBS),) >> >> -LDLIBS += $(CPU_LDLIBS) >> +LDLIBS += $(_LDLIBS-y) $(EXTRA_LDLIBS) >> >> .PHONY: all >> all: install >> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk. 2015-05-04 14:36 ` Wiles, Keith @ 2015-05-04 15:26 ` Olivier MATZ 2015-05-04 16:50 ` Wiles, Keith 0 siblings, 1 reply; 11+ messages in thread From: Olivier MATZ @ 2015-05-04 15:26 UTC (permalink / raw) To: Wiles, Keith, dev On 05/04/2015 04:36 PM, Wiles, Keith wrote: > > > On 5/4/15, 2:18 AM, "Olivier MATZ" <olivier.matz@6wind.com> wrote: > >> Hi Keith, >> >> On 05/01/2015 04:22 PM, Keith Wiles wrote: >>> Trying to simplify the ifdefs in rte.app.mk to make the code >>> more readable and maintainable by moving LDLIBS variable to use >>> the same style as LDLIBS-y being used in the rest of the code. >>> >>> Added a new variable called EXTRA_LDLIBS to be used by example apps >>> instead of using LDLIBS directly. The new internal variable _LDLIBS >>> should not be used outside of the rte.app.mk file. The makefiles >>> can still use LDLIBS, but I would suggest using EXTRA_LDLIBS instead. >> >> Why are you suggesting to change LIBS to EXTRA_LIBS? > > Hi Olivier, > > I do not change LIBS to EXTRA_LIBS as I did not touch those variables. > > I did add EXTRA_LDLIBS and let LDLIBS as it was in the patch. I also > created LDLIBS-y as an internal variable. Did I miss your point here? In your previous mail, you say "The makefiles can still use LDLIBS, but I would suggest using EXTRA_LDLIBS instead." The question is: why are you suggesting that? And in the patch you are submitting, you are replacing LDLIBS by EXTRA_LDLIBS in examples/dpdk_qat/Makefile and examples/vm_power_manager/Makefile. Regards, Olivier > > ++Keith > >> We discussed in a previous thread that EXTRA_* variables should >> (as much as possible) be kept empty in Makefiles as it allows a >> user to append things in them. >> >> By the way, it would be easier to follow the different versions >> of your patches if you add "--in-reply-to <Message-ID>" in your >> git-send-email command, as described in http://dpdk.org/dev >> >> Regards, >> Olivier >> >> >>> >>> Signed-off-by: Keith Wiles <keith.wiles@intel.com> >>> --- >>> examples/dpdk_qat/Makefile | 4 +- >>> examples/vm_power_manager/Makefile | 2 +- >>> mk/rte.app.mk | 242 >>> +++++++++---------------------------- >>> 3 files changed, 63 insertions(+), 185 deletions(-) >>> >>> diff --git a/examples/dpdk_qat/Makefile b/examples/dpdk_qat/Makefile >>> index f1e06a1..90ca1d3 100644 >>> --- a/examples/dpdk_qat/Makefile >>> +++ b/examples/dpdk_qat/Makefile >>> @@ -77,8 +77,8 @@ else >>> ICP_LIBRARY_PATH = $(ICP_ROOT)/build/libicp_qa_al.a >>> endif >>> >>> -LDLIBS += -L$(ICP_ROOT)/build >>> -LDLIBS += $(ICP_LIBRARY_PATH) \ >>> +EXTRA_LDLIBS += -L$(ICP_ROOT)/build >>> +EXTRA_LDLIBS += $(ICP_LIBRARY_PATH) \ >>> -lz \ >>> -losal \ >>> -ladf_proxy \ >>> diff --git a/examples/vm_power_manager/Makefile >>> b/examples/vm_power_manager/Makefile >>> index 113dbc4..8fb78d4 100644 >>> --- a/examples/vm_power_manager/Makefile >>> +++ b/examples/vm_power_manager/Makefile >>> @@ -48,7 +48,7 @@ SRCS-y += channel_monitor.c >>> CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ >>> CFLAGS += $(WERROR_FLAGS) >>> >>> -LDLIBS += -lvirt >>> +EXTRA_LDLIBS += -lvirt >>> >>> # workaround for a gcc bug with noreturn attribute >>> # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 >>> diff --git a/mk/rte.app.mk b/mk/rte.app.mk >>> index 62a76ae..b8030d2 100644 >>> --- a/mk/rte.app.mk >>> +++ b/mk/rte.app.mk >>> @@ -1,7 +1,7 @@ >>> # BSD LICENSE >>> # >>> -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. >>> -# Copyright(c) 2014 6WIND S.A. >>> +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. >>> +# Copyright(c) 2014-2015 6WIND S.A. >>> # All rights reserved. >>> # >>> # Redistribution and use in source and binary forms, with or without >>> @@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT) >>> endif >>> >>> # default path for libs >>> -LDLIBS += -L$(RTE_SDK_BIN)/lib >>> +_LDLIBS-y += -L$(RTE_SDK_BIN)/lib >>> >>> # >>> # Include libraries depending on config if NO_AUTOLIBS is not set >>> @@ -59,215 +59,93 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib >>> # >>> ifeq ($(NO_AUTOLIBS),) >>> >>> -LDLIBS += --whole-archive >>> +_LDLIBS-y += --whole-archive >>> >>> -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) >>> -LDLIBS += -l$(RTE_LIBNAME) >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_BUILD_COMBINE_LIBS) += -l$(RTE_LIBNAME) >>> >>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) >>> -LDLIBS += -lrte_distributor >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_REORDER),y) >>> -LDLIBS += -lrte_reorder >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) >>> ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>> -LDLIBS += -lrte_kni >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem >>> endif >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y) >>> -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>> -LDLIBS += -lrte_ivshmem >>> -endif >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y) >>> -LDLIBS += -lrte_pipeline >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y) >>> -LDLIBS += -lrte_table >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PORT),y) >>> -LDLIBS += -lrte_port >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_TIMER),y) >>> -LDLIBS += -lrte_timer >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_HASH),y) >>> -LDLIBS += -lrte_hash >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_JOBSTATS),y) >>> -LDLIBS += -lrte_jobstats >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) >>> -LDLIBS += -lrte_lpm >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_POWER),y) >>> -LDLIBS += -lrte_power >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) >>> -LDLIBS += -lrte_acl >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_METER),y) >>> -LDLIBS += -lrte_meter >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) >>> -LDLIBS += -lrte_sched >>> -LDLIBS += -lm >>> -LDLIBS += -lrt >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) >>> -LDLIBS += -lrte_vhost >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost >>> >>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>> -LDLIBS += -lpcap >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST)$(CONFIG_RTE_LIBRTE_VHOST_USER),yn) >>> -LDLIBS += -lfuse >>> +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse >>> endif >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>> -LDLIBS += -libverbs >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs >>> >>> -LDLIBS += --start-group >>> +_LDLIBS-y += --start-group >>> >>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) >>> -LDLIBS += -lrte_kvargs >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y) >>> -LDLIBS += -lrte_mbuf >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y) >>> -LDLIBS += -lrte_ip_frag >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y) >>> -LDLIBS += -lethdev >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y) >>> -LDLIBS += -lrte_malloc >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y) >>> -LDLIBS += -lrte_mempool >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_RING),y) >>> -LDLIBS += -lrte_ring >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) >>> -LDLIBS += -lrte_eal >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) >>> -LDLIBS += -lrte_cmdline >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y) >>> -LDLIBS += -lrte_cfgfile >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) >>> -LDLIBS += -lrte_pmd_bond >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) >>> -LDLIBS += -lrte_pmd_xenvirt >>> -LDLIBS += -lxenstore >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MALLOC) += -lrte_malloc >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond >>> + >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore >>> >>> ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) >>> # plugins (link only if static libraries) >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) >>> -LDLIBS += -lrte_pmd_vmxnet3_uio >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) >>> -LDLIBS += -lrte_pmd_virtio >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) >>> -LDLIBS += -lrte_pmd_enic >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) >>> -LDLIBS += -lrte_pmd_i40e >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_FM10K_PMD),y) >>> -LDLIBS += -lrte_pmd_fm10k >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) >>> -LDLIBS += -lrte_pmd_ixgbe >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y) >>> -LDLIBS += -lrte_pmd_e1000 >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>> -LDLIBS += -lrte_pmd_mlx4 >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) >>> -LDLIBS += -lrte_pmd_ring >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>> -LDLIBS += -lrte_pmd_pcap >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) >>> -LDLIBS += -lrte_pmd_af_packet >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) >>> -LDLIBS += -lrte_pmd_null >>> -endif >>> - >>> -endif # plugins >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null >>> + >>> +endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB) >>> >>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>> >>> -LDLIBS += $(EXECENV_LDLIBS) >>> - >>> -LDLIBS += --end-group >>> - >>> -LDLIBS += --no-whole-archive >>> +_LDLIBS-y += $(EXECENV_LDLIBS) >>> +_LDLIBS-y += --end-group >>> +_LDLIBS-y += --no-whole-archive >>> >>> endif # ifeq ($(NO_AUTOLIBS),) >>> >>> -LDLIBS += $(CPU_LDLIBS) >>> +LDLIBS += $(_LDLIBS-y) $(EXTRA_LDLIBS) >>> >>> .PHONY: all >>> all: install >>> > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk. 2015-05-04 15:26 ` Olivier MATZ @ 2015-05-04 16:50 ` Wiles, Keith 2015-05-05 7:33 ` Olivier MATZ 0 siblings, 1 reply; 11+ messages in thread From: Wiles, Keith @ 2015-05-04 16:50 UTC (permalink / raw) To: Olivier MATZ; +Cc: dev Sent from my iPhone > On May 4, 2015, at 8:27 AM, Olivier MATZ <olivier.matz@6wind.com> wrote: > > > >> On 05/04/2015 04:36 PM, Wiles, Keith wrote: >> >> >>> On 5/4/15, 2:18 AM, "Olivier MATZ" <olivier.matz@6wind.com> wrote: >>> >>> Hi Keith, >>> >>>> On 05/01/2015 04:22 PM, Keith Wiles wrote: >>>> Trying to simplify the ifdefs in rte.app.mk to make the code >>>> more readable and maintainable by moving LDLIBS variable to use >>>> the same style as LDLIBS-y being used in the rest of the code. >>>> >>>> Added a new variable called EXTRA_LDLIBS to be used by example apps >>>> instead of using LDLIBS directly. The new internal variable _LDLIBS >>>> should not be used outside of the rte.app.mk file. The makefiles >>>> can still use LDLIBS, but I would suggest using EXTRA_LDLIBS instead. >>> >>> Why are you suggesting to change LIBS to EXTRA_LIBS? >> >> Hi Olivier, >> >> I do not change LIBS to EXTRA_LIBS as I did not touch those variables. >> >> I did add EXTRA_LDLIBS and let LDLIBS as it was in the patch. I also >> created LDLIBS-y as an internal variable. Did I miss your point here? > > In your previous mail, you say "The makefiles can still use LDLIBS, > but I would suggest using EXTRA_LDLIBS instead." > > The question is: why are you suggesting that? > > And in the patch you are submitting, you are replacing LDLIBS > by EXTRA_LDLIBS in examples/dpdk_qat/Makefile and > examples/vm_power_manager/Makefile. > I thought use the extra variable was the right way in those make files. Could have left them using LDLIBS but does it make any difference? > Regards, > Olivier > > > >> >> ++Keith >> >>> We discussed in a previous thread that EXTRA_* variables should >>> (as much as possible) be kept empty in Makefiles as it allows a >>> user to append things in them. >>> >>> By the way, it would be easier to follow the different versions >>> of your patches if you add "--in-reply-to <Message-ID>" in your >>> git-send-email command, as described in http://dpdk.org/dev >>> >>> Regards, >>> Olivier >>> >>> >>>> >>>> Signed-off-by: Keith Wiles <keith.wiles@intel.com> >>>> --- >>>> examples/dpdk_qat/Makefile | 4 +- >>>> examples/vm_power_manager/Makefile | 2 +- >>>> mk/rte.app.mk | 242 >>>> +++++++++---------------------------- >>>> 3 files changed, 63 insertions(+), 185 deletions(-) >>>> >>>> diff --git a/examples/dpdk_qat/Makefile b/examples/dpdk_qat/Makefile >>>> index f1e06a1..90ca1d3 100644 >>>> --- a/examples/dpdk_qat/Makefile >>>> +++ b/examples/dpdk_qat/Makefile >>>> @@ -77,8 +77,8 @@ else >>>> ICP_LIBRARY_PATH = $(ICP_ROOT)/build/libicp_qa_al.a >>>> endif >>>> >>>> -LDLIBS += -L$(ICP_ROOT)/build >>>> -LDLIBS += $(ICP_LIBRARY_PATH) \ >>>> +EXTRA_LDLIBS += -L$(ICP_ROOT)/build >>>> +EXTRA_LDLIBS += $(ICP_LIBRARY_PATH) \ >>>> -lz \ >>>> -losal \ >>>> -ladf_proxy \ >>>> diff --git a/examples/vm_power_manager/Makefile >>>> b/examples/vm_power_manager/Makefile >>>> index 113dbc4..8fb78d4 100644 >>>> --- a/examples/vm_power_manager/Makefile >>>> +++ b/examples/vm_power_manager/Makefile >>>> @@ -48,7 +48,7 @@ SRCS-y += channel_monitor.c >>>> CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ >>>> CFLAGS += $(WERROR_FLAGS) >>>> >>>> -LDLIBS += -lvirt >>>> +EXTRA_LDLIBS += -lvirt >>>> >>>> # workaround for a gcc bug with noreturn attribute >>>> # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 >>>> diff --git a/mk/rte.app.mk b/mk/rte.app.mk >>>> index 62a76ae..b8030d2 100644 >>>> --- a/mk/rte.app.mk >>>> +++ b/mk/rte.app.mk >>>> @@ -1,7 +1,7 @@ >>>> # BSD LICENSE >>>> # >>>> -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. >>>> -# Copyright(c) 2014 6WIND S.A. >>>> +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. >>>> +# Copyright(c) 2014-2015 6WIND S.A. >>>> # All rights reserved. >>>> # >>>> # Redistribution and use in source and binary forms, with or without >>>> @@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT) >>>> endif >>>> >>>> # default path for libs >>>> -LDLIBS += -L$(RTE_SDK_BIN)/lib >>>> +_LDLIBS-y += -L$(RTE_SDK_BIN)/lib >>>> >>>> # >>>> # Include libraries depending on config if NO_AUTOLIBS is not set >>>> @@ -59,215 +59,93 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib >>>> # >>>> ifeq ($(NO_AUTOLIBS),) >>>> >>>> -LDLIBS += --whole-archive >>>> +_LDLIBS-y += --whole-archive >>>> >>>> -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) >>>> -LDLIBS += -l$(RTE_LIBNAME) >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_BUILD_COMBINE_LIBS) += -l$(RTE_LIBNAME) >>>> >>>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) >>>> -LDLIBS += -lrte_distributor >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_REORDER),y) >>>> -LDLIBS += -lrte_reorder >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) >>>> ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>>> -LDLIBS += -lrte_kni >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem >>>> endif >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y) >>>> -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>>> -LDLIBS += -lrte_ivshmem >>>> -endif >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y) >>>> -LDLIBS += -lrte_pipeline >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y) >>>> -LDLIBS += -lrte_table >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PORT),y) >>>> -LDLIBS += -lrte_port >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_TIMER),y) >>>> -LDLIBS += -lrte_timer >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_HASH),y) >>>> -LDLIBS += -lrte_hash >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_JOBSTATS),y) >>>> -LDLIBS += -lrte_jobstats >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) >>>> -LDLIBS += -lrte_lpm >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_POWER),y) >>>> -LDLIBS += -lrte_power >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) >>>> -LDLIBS += -lrte_acl >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_METER),y) >>>> -LDLIBS += -lrte_meter >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) >>>> -LDLIBS += -lrte_sched >>>> -LDLIBS += -lm >>>> -LDLIBS += -lrt >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) >>>> -LDLIBS += -lrte_vhost >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost >>>> >>>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>>> -LDLIBS += -lpcap >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST)$(CONFIG_RTE_LIBRTE_VHOST_USER),yn) >>>> -LDLIBS += -lfuse >>>> +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse >>>> endif >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>>> -LDLIBS += -libverbs >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs >>>> >>>> -LDLIBS += --start-group >>>> +_LDLIBS-y += --start-group >>>> >>>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) >>>> -LDLIBS += -lrte_kvargs >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y) >>>> -LDLIBS += -lrte_mbuf >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y) >>>> -LDLIBS += -lrte_ip_frag >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y) >>>> -LDLIBS += -lethdev >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y) >>>> -LDLIBS += -lrte_malloc >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y) >>>> -LDLIBS += -lrte_mempool >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_RING),y) >>>> -LDLIBS += -lrte_ring >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) >>>> -LDLIBS += -lrte_eal >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) >>>> -LDLIBS += -lrte_cmdline >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y) >>>> -LDLIBS += -lrte_cfgfile >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) >>>> -LDLIBS += -lrte_pmd_bond >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) >>>> -LDLIBS += -lrte_pmd_xenvirt >>>> -LDLIBS += -lxenstore >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MALLOC) += -lrte_malloc >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond >>>> + >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore >>>> >>>> ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) >>>> # plugins (link only if static libraries) >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) >>>> -LDLIBS += -lrte_pmd_vmxnet3_uio >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) >>>> -LDLIBS += -lrte_pmd_virtio >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) >>>> -LDLIBS += -lrte_pmd_enic >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) >>>> -LDLIBS += -lrte_pmd_i40e >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_FM10K_PMD),y) >>>> -LDLIBS += -lrte_pmd_fm10k >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) >>>> -LDLIBS += -lrte_pmd_ixgbe >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y) >>>> -LDLIBS += -lrte_pmd_e1000 >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>>> -LDLIBS += -lrte_pmd_mlx4 >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) >>>> -LDLIBS += -lrte_pmd_ring >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>>> -LDLIBS += -lrte_pmd_pcap >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) >>>> -LDLIBS += -lrte_pmd_af_packet >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) >>>> -LDLIBS += -lrte_pmd_null >>>> -endif >>>> - >>>> -endif # plugins >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null >>>> + >>>> +endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB) >>>> >>>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>>> >>>> -LDLIBS += $(EXECENV_LDLIBS) >>>> - >>>> -LDLIBS += --end-group >>>> - >>>> -LDLIBS += --no-whole-archive >>>> +_LDLIBS-y += $(EXECENV_LDLIBS) >>>> +_LDLIBS-y += --end-group >>>> +_LDLIBS-y += --no-whole-archive >>>> >>>> endif # ifeq ($(NO_AUTOLIBS),) >>>> >>>> -LDLIBS += $(CPU_LDLIBS) >>>> +LDLIBS += $(_LDLIBS-y) $(EXTRA_LDLIBS) >>>> >>>> .PHONY: all >>>> all: install >> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk. 2015-05-04 16:50 ` Wiles, Keith @ 2015-05-05 7:33 ` Olivier MATZ 2015-05-06 2:12 ` Wiles, Keith 0 siblings, 1 reply; 11+ messages in thread From: Olivier MATZ @ 2015-05-05 7:33 UTC (permalink / raw) To: Wiles, Keith; +Cc: dev Hi Keith, On 05/04/2015 06:50 PM, Wiles, Keith wrote: > > > Sent from my iPhone > >> On May 4, 2015, at 8:27 AM, Olivier MATZ <olivier.matz@6wind.com> wrote: >> >> >> >>> On 05/04/2015 04:36 PM, Wiles, Keith wrote: >>> >>> >>>> On 5/4/15, 2:18 AM, "Olivier MATZ" <olivier.matz@6wind.com> wrote: >>>> >>>> Hi Keith, >>>> >>>>> On 05/01/2015 04:22 PM, Keith Wiles wrote: >>>>> Trying to simplify the ifdefs in rte.app.mk to make the code >>>>> more readable and maintainable by moving LDLIBS variable to use >>>>> the same style as LDLIBS-y being used in the rest of the code. >>>>> >>>>> Added a new variable called EXTRA_LDLIBS to be used by example apps >>>>> instead of using LDLIBS directly. The new internal variable _LDLIBS >>>>> should not be used outside of the rte.app.mk file. The makefiles >>>>> can still use LDLIBS, but I would suggest using EXTRA_LDLIBS instead. >>>> >>>> Why are you suggesting to change LIBS to EXTRA_LIBS? >>> >>> Hi Olivier, >>> >>> I do not change LIBS to EXTRA_LIBS as I did not touch those variables. >>> >>> I did add EXTRA_LDLIBS and let LDLIBS as it was in the patch. I also >>> created LDLIBS-y as an internal variable. Did I miss your point here? >> >> In your previous mail, you say "The makefiles can still use LDLIBS, >> but I would suggest using EXTRA_LDLIBS instead." >> >> The question is: why are you suggesting that? >> >> And in the patch you are submitting, you are replacing LDLIBS >> by EXTRA_LDLIBS in examples/dpdk_qat/Makefile and >> examples/vm_power_manager/Makefile. >> > > I thought use the extra variable was the right way in those make files. Could have left them using LDLIBS but does it make any difference? Why are you feeling changing to EXTRA_* is the right way? Are you seeing a problem with the current use of LDLIBS? Like I said previously (and Bruce agreed on that), using EXTRA_* should be avoided in Makefiles because it prevents to append something to the variable from the command line. Regards, Olivier > >> Regards, >> Olivier >> >> >> >>> >>> ++Keith >>> >>>> We discussed in a previous thread that EXTRA_* variables should >>>> (as much as possible) be kept empty in Makefiles as it allows a >>>> user to append things in them. >>>> >>>> By the way, it would be easier to follow the different versions >>>> of your patches if you add "--in-reply-to <Message-ID>" in your >>>> git-send-email command, as described in http://dpdk.org/dev >>>> >>>> Regards, >>>> Olivier >>>> >>>> >>>>> >>>>> Signed-off-by: Keith Wiles <keith.wiles@intel.com> >>>>> --- >>>>> examples/dpdk_qat/Makefile | 4 +- >>>>> examples/vm_power_manager/Makefile | 2 +- >>>>> mk/rte.app.mk | 242 >>>>> +++++++++---------------------------- >>>>> 3 files changed, 63 insertions(+), 185 deletions(-) >>>>> >>>>> diff --git a/examples/dpdk_qat/Makefile b/examples/dpdk_qat/Makefile >>>>> index f1e06a1..90ca1d3 100644 >>>>> --- a/examples/dpdk_qat/Makefile >>>>> +++ b/examples/dpdk_qat/Makefile >>>>> @@ -77,8 +77,8 @@ else >>>>> ICP_LIBRARY_PATH = $(ICP_ROOT)/build/libicp_qa_al.a >>>>> endif >>>>> >>>>> -LDLIBS += -L$(ICP_ROOT)/build >>>>> -LDLIBS += $(ICP_LIBRARY_PATH) \ >>>>> +EXTRA_LDLIBS += -L$(ICP_ROOT)/build >>>>> +EXTRA_LDLIBS += $(ICP_LIBRARY_PATH) \ >>>>> -lz \ >>>>> -losal \ >>>>> -ladf_proxy \ >>>>> diff --git a/examples/vm_power_manager/Makefile >>>>> b/examples/vm_power_manager/Makefile >>>>> index 113dbc4..8fb78d4 100644 >>>>> --- a/examples/vm_power_manager/Makefile >>>>> +++ b/examples/vm_power_manager/Makefile >>>>> @@ -48,7 +48,7 @@ SRCS-y += channel_monitor.c >>>>> CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ >>>>> CFLAGS += $(WERROR_FLAGS) >>>>> >>>>> -LDLIBS += -lvirt >>>>> +EXTRA_LDLIBS += -lvirt >>>>> >>>>> # workaround for a gcc bug with noreturn attribute >>>>> # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 >>>>> diff --git a/mk/rte.app.mk b/mk/rte.app.mk >>>>> index 62a76ae..b8030d2 100644 >>>>> --- a/mk/rte.app.mk >>>>> +++ b/mk/rte.app.mk >>>>> @@ -1,7 +1,7 @@ >>>>> # BSD LICENSE >>>>> # >>>>> -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. >>>>> -# Copyright(c) 2014 6WIND S.A. >>>>> +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. >>>>> +# Copyright(c) 2014-2015 6WIND S.A. >>>>> # All rights reserved. >>>>> # >>>>> # Redistribution and use in source and binary forms, with or without >>>>> @@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT) >>>>> endif >>>>> >>>>> # default path for libs >>>>> -LDLIBS += -L$(RTE_SDK_BIN)/lib >>>>> +_LDLIBS-y += -L$(RTE_SDK_BIN)/lib >>>>> >>>>> # >>>>> # Include libraries depending on config if NO_AUTOLIBS is not set >>>>> @@ -59,215 +59,93 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib >>>>> # >>>>> ifeq ($(NO_AUTOLIBS),) >>>>> >>>>> -LDLIBS += --whole-archive >>>>> +_LDLIBS-y += --whole-archive >>>>> >>>>> -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) >>>>> -LDLIBS += -l$(RTE_LIBNAME) >>>>> -endif >>>>> +_LDLIBS-$(CONFIG_RTE_BUILD_COMBINE_LIBS) += -l$(RTE_LIBNAME) >>>>> >>>>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>>>> >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) >>>>> -LDLIBS += -lrte_distributor >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_REORDER),y) >>>>> -LDLIBS += -lrte_reorder >>>>> -endif >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder >>>>> >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) >>>>> ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>>>> -LDLIBS += -lrte_kni >>>>> -endif >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem >>>>> endif >>>>> >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y) >>>>> -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>>>> -LDLIBS += -lrte_ivshmem >>>>> -endif >>>>> -endif >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter >>>>> >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y) >>>>> -LDLIBS += -lrte_pipeline >>>>> -endif >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt >>>>> >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y) >>>>> -LDLIBS += -lrte_table >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PORT),y) >>>>> -LDLIBS += -lrte_port >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_TIMER),y) >>>>> -LDLIBS += -lrte_timer >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_HASH),y) >>>>> -LDLIBS += -lrte_hash >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_JOBSTATS),y) >>>>> -LDLIBS += -lrte_jobstats >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) >>>>> -LDLIBS += -lrte_lpm >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_POWER),y) >>>>> -LDLIBS += -lrte_power >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) >>>>> -LDLIBS += -lrte_acl >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_METER),y) >>>>> -LDLIBS += -lrte_meter >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) >>>>> -LDLIBS += -lrte_sched >>>>> -LDLIBS += -lm >>>>> -LDLIBS += -lrt >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) >>>>> -LDLIBS += -lrte_vhost >>>>> -endif >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost >>>>> >>>>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>>>> >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>>>> -LDLIBS += -lpcap >>>>> -endif >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap >>>>> >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST)$(CONFIG_RTE_LIBRTE_VHOST_USER),yn) >>>>> -LDLIBS += -lfuse >>>>> +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse >>>>> endif >>>>> >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>>>> -LDLIBS += -libverbs >>>>> -endif >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs >>>>> >>>>> -LDLIBS += --start-group >>>>> +_LDLIBS-y += --start-group >>>>> >>>>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>>>> >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) >>>>> -LDLIBS += -lrte_kvargs >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y) >>>>> -LDLIBS += -lrte_mbuf >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y) >>>>> -LDLIBS += -lrte_ip_frag >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y) >>>>> -LDLIBS += -lethdev >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y) >>>>> -LDLIBS += -lrte_malloc >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y) >>>>> -LDLIBS += -lrte_mempool >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_RING),y) >>>>> -LDLIBS += -lrte_ring >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) >>>>> -LDLIBS += -lrte_eal >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) >>>>> -LDLIBS += -lrte_cmdline >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y) >>>>> -LDLIBS += -lrte_cfgfile >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) >>>>> -LDLIBS += -lrte_pmd_bond >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) >>>>> -LDLIBS += -lrte_pmd_xenvirt >>>>> -LDLIBS += -lxenstore >>>>> -endif >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MALLOC) += -lrte_malloc >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond >>>>> + >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore >>>>> >>>>> ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) >>>>> # plugins (link only if static libraries) >>>>> >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) >>>>> -LDLIBS += -lrte_pmd_vmxnet3_uio >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) >>>>> -LDLIBS += -lrte_pmd_virtio >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) >>>>> -LDLIBS += -lrte_pmd_enic >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) >>>>> -LDLIBS += -lrte_pmd_i40e >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_FM10K_PMD),y) >>>>> -LDLIBS += -lrte_pmd_fm10k >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) >>>>> -LDLIBS += -lrte_pmd_ixgbe >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y) >>>>> -LDLIBS += -lrte_pmd_e1000 >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>>>> -LDLIBS += -lrte_pmd_mlx4 >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) >>>>> -LDLIBS += -lrte_pmd_ring >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>>>> -LDLIBS += -lrte_pmd_pcap >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) >>>>> -LDLIBS += -lrte_pmd_af_packet >>>>> -endif >>>>> - >>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) >>>>> -LDLIBS += -lrte_pmd_null >>>>> -endif >>>>> - >>>>> -endif # plugins >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet >>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null >>>>> + >>>>> +endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB) >>>>> >>>>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>>>> >>>>> -LDLIBS += $(EXECENV_LDLIBS) >>>>> - >>>>> -LDLIBS += --end-group >>>>> - >>>>> -LDLIBS += --no-whole-archive >>>>> +_LDLIBS-y += $(EXECENV_LDLIBS) >>>>> +_LDLIBS-y += --end-group >>>>> +_LDLIBS-y += --no-whole-archive >>>>> >>>>> endif # ifeq ($(NO_AUTOLIBS),) >>>>> >>>>> -LDLIBS += $(CPU_LDLIBS) >>>>> +LDLIBS += $(_LDLIBS-y) $(EXTRA_LDLIBS) >>>>> >>>>> .PHONY: all >>>>> all: install >>> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk. 2015-05-05 7:33 ` Olivier MATZ @ 2015-05-06 2:12 ` Wiles, Keith 0 siblings, 0 replies; 11+ messages in thread From: Wiles, Keith @ 2015-05-06 2:12 UTC (permalink / raw) To: Olivier MATZ; +Cc: dev Hi Olivier, On 5/5/15, 12:33 AM, "Olivier MATZ" <olivier.matz@6wind.com> wrote: >Hi Keith, > >On 05/04/2015 06:50 PM, Wiles, Keith wrote: >> >> >> Sent from my iPhone >> >>> On May 4, 2015, at 8:27 AM, Olivier MATZ <olivier.matz@6wind.com> >>>wrote: >>> >>> >>> >>>> On 05/04/2015 04:36 PM, Wiles, Keith wrote: >>>> >>>> >>>>> On 5/4/15, 2:18 AM, "Olivier MATZ" <olivier.matz@6wind.com> wrote: >>>>> >>>>> Hi Keith, >>>>> >>>>>> On 05/01/2015 04:22 PM, Keith Wiles wrote: >>>>>> Trying to simplify the ifdefs in rte.app.mk to make the code >>>>>> more readable and maintainable by moving LDLIBS variable to use >>>>>> the same style as LDLIBS-y being used in the rest of the code. >>>>>> >>>>>> Added a new variable called EXTRA_LDLIBS to be used by example apps >>>>>> instead of using LDLIBS directly. The new internal variable _LDLIBS >>>>>> should not be used outside of the rte.app.mk file. The makefiles >>>>>> can still use LDLIBS, but I would suggest using EXTRA_LDLIBS >>>>>>instead. >>>>> >>>>> Why are you suggesting to change LIBS to EXTRA_LIBS? >>>> >>>> Hi Olivier, >>>> >>>> I do not change LIBS to EXTRA_LIBS as I did not touch those variables. >>>> >>>> I did add EXTRA_LDLIBS and let LDLIBS as it was in the patch. I also >>>> created LDLIBS-y as an internal variable. Did I miss your point here? >>> >>> In your previous mail, you say "The makefiles can still use LDLIBS, >>> but I would suggest using EXTRA_LDLIBS instead." >>> >>> The question is: why are you suggesting that? >>> >>> And in the patch you are submitting, you are replacing LDLIBS >>> by EXTRA_LDLIBS in examples/dpdk_qat/Makefile and >>> examples/vm_power_manager/Makefile. >>> >> >> I thought use the extra variable was the right way in those make files. >>Could have left them using LDLIBS but does it make any difference? > >Why are you feeling changing to EXTRA_* is the right way? >Are you seeing a problem with the current use of LDLIBS? > >Like I said previously (and Bruce agreed on that), using EXTRA_* >should be avoided in Makefiles because it prevents to append >something to the variable from the command line. I will submit a v7 when I get back home next week. I still do not see the big difference, but it does not matter. Regards, ++Keith > > >Regards, >Olivier > > >> >>> Regards, >>> Olivier >>> >>> >>> >>>> >>>> ++Keith >>>> >>>>> We discussed in a previous thread that EXTRA_* variables should >>>>> (as much as possible) be kept empty in Makefiles as it allows a >>>>> user to append things in them. >>>>> >>>>> By the way, it would be easier to follow the different versions >>>>> of your patches if you add "--in-reply-to <Message-ID>" in your >>>>> git-send-email command, as described in http://dpdk.org/dev >>>>> >>>>> Regards, >>>>> Olivier >>>>> >>>>> >>>>>> >>>>>> Signed-off-by: Keith Wiles <keith.wiles@intel.com> >>>>>> --- >>>>>> examples/dpdk_qat/Makefile | 4 +- >>>>>> examples/vm_power_manager/Makefile | 2 +- >>>>>> mk/rte.app.mk | 242 >>>>>> +++++++++---------------------------- >>>>>> 3 files changed, 63 insertions(+), 185 deletions(-) >>>>>> >>>>>> diff --git a/examples/dpdk_qat/Makefile b/examples/dpdk_qat/Makefile >>>>>> index f1e06a1..90ca1d3 100644 >>>>>> --- a/examples/dpdk_qat/Makefile >>>>>> +++ b/examples/dpdk_qat/Makefile >>>>>> @@ -77,8 +77,8 @@ else >>>>>> ICP_LIBRARY_PATH = $(ICP_ROOT)/build/libicp_qa_al.a >>>>>> endif >>>>>> >>>>>> -LDLIBS += -L$(ICP_ROOT)/build >>>>>> -LDLIBS += $(ICP_LIBRARY_PATH) \ >>>>>> +EXTRA_LDLIBS += -L$(ICP_ROOT)/build >>>>>> +EXTRA_LDLIBS += $(ICP_LIBRARY_PATH) \ >>>>>> -lz \ >>>>>> -losal \ >>>>>> -ladf_proxy \ >>>>>> diff --git a/examples/vm_power_manager/Makefile >>>>>> b/examples/vm_power_manager/Makefile >>>>>> index 113dbc4..8fb78d4 100644 >>>>>> --- a/examples/vm_power_manager/Makefile >>>>>> +++ b/examples/vm_power_manager/Makefile >>>>>> @@ -48,7 +48,7 @@ SRCS-y += channel_monitor.c >>>>>> CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ >>>>>> CFLAGS += $(WERROR_FLAGS) >>>>>> >>>>>> -LDLIBS += -lvirt >>>>>> +EXTRA_LDLIBS += -lvirt >>>>>> >>>>>> # workaround for a gcc bug with noreturn attribute >>>>>> # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 >>>>>> diff --git a/mk/rte.app.mk b/mk/rte.app.mk >>>>>> index 62a76ae..b8030d2 100644 >>>>>> --- a/mk/rte.app.mk >>>>>> +++ b/mk/rte.app.mk >>>>>> @@ -1,7 +1,7 @@ >>>>>> # BSD LICENSE >>>>>> # >>>>>> -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. >>>>>> -# Copyright(c) 2014 6WIND S.A. >>>>>> +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. >>>>>> +# Copyright(c) 2014-2015 6WIND S.A. >>>>>> # All rights reserved. >>>>>> # >>>>>> # Redistribution and use in source and binary forms, with or >>>>>>without >>>>>> @@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT) >>>>>> endif >>>>>> >>>>>> # default path for libs >>>>>> -LDLIBS += -L$(RTE_SDK_BIN)/lib >>>>>> +_LDLIBS-y += -L$(RTE_SDK_BIN)/lib >>>>>> >>>>>> # >>>>>> # Include libraries depending on config if NO_AUTOLIBS is not set >>>>>> @@ -59,215 +59,93 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib >>>>>> # >>>>>> ifeq ($(NO_AUTOLIBS),) >>>>>> >>>>>> -LDLIBS += --whole-archive >>>>>> +_LDLIBS-y += --whole-archive >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) >>>>>> -LDLIBS += -l$(RTE_LIBNAME) >>>>>> -endif >>>>>> +_LDLIBS-$(CONFIG_RTE_BUILD_COMBINE_LIBS) += -l$(RTE_LIBNAME) >>>>>> >>>>>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) >>>>>> -LDLIBS += -lrte_distributor >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_REORDER),y) >>>>>> -LDLIBS += -lrte_reorder >>>>>> -endif >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) >>>>>> ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>>>>> -LDLIBS += -lrte_kni >>>>>> -endif >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem >>>>>> endif >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y) >>>>>> -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>>>>> -LDLIBS += -lrte_ivshmem >>>>>> -endif >>>>>> -endif >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y) >>>>>> -LDLIBS += -lrte_pipeline >>>>>> -endif >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y) >>>>>> -LDLIBS += -lrte_table >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PORT),y) >>>>>> -LDLIBS += -lrte_port >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_TIMER),y) >>>>>> -LDLIBS += -lrte_timer >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_HASH),y) >>>>>> -LDLIBS += -lrte_hash >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_JOBSTATS),y) >>>>>> -LDLIBS += -lrte_jobstats >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) >>>>>> -LDLIBS += -lrte_lpm >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_POWER),y) >>>>>> -LDLIBS += -lrte_power >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) >>>>>> -LDLIBS += -lrte_acl >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_METER),y) >>>>>> -LDLIBS += -lrte_meter >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) >>>>>> -LDLIBS += -lrte_sched >>>>>> -LDLIBS += -lm >>>>>> -LDLIBS += -lrt >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) >>>>>> -LDLIBS += -lrte_vhost >>>>>> -endif >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost >>>>>> >>>>>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>>>>> -LDLIBS += -lpcap >>>>>> -endif >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST)$(CONFIG_RTE_LIBRTE_VHOST_USER),yn) >>>>>> -LDLIBS += -lfuse >>>>>> +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse >>>>>> endif >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>>>>> -LDLIBS += -libverbs >>>>>> -endif >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs >>>>>> >>>>>> -LDLIBS += --start-group >>>>>> +_LDLIBS-y += --start-group >>>>>> >>>>>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) >>>>>> -LDLIBS += -lrte_kvargs >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y) >>>>>> -LDLIBS += -lrte_mbuf >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y) >>>>>> -LDLIBS += -lrte_ip_frag >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y) >>>>>> -LDLIBS += -lethdev >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y) >>>>>> -LDLIBS += -lrte_malloc >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y) >>>>>> -LDLIBS += -lrte_mempool >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_RING),y) >>>>>> -LDLIBS += -lrte_ring >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) >>>>>> -LDLIBS += -lrte_eal >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) >>>>>> -LDLIBS += -lrte_cmdline >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y) >>>>>> -LDLIBS += -lrte_cfgfile >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) >>>>>> -LDLIBS += -lrte_pmd_bond >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) >>>>>> -LDLIBS += -lrte_pmd_xenvirt >>>>>> -LDLIBS += -lxenstore >>>>>> -endif >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MALLOC) += -lrte_malloc >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond >>>>>> + >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore >>>>>> >>>>>> ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) >>>>>> # plugins (link only if static libraries) >>>>>> >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) >>>>>> -LDLIBS += -lrte_pmd_vmxnet3_uio >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) >>>>>> -LDLIBS += -lrte_pmd_virtio >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) >>>>>> -LDLIBS += -lrte_pmd_enic >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) >>>>>> -LDLIBS += -lrte_pmd_i40e >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_FM10K_PMD),y) >>>>>> -LDLIBS += -lrte_pmd_fm10k >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) >>>>>> -LDLIBS += -lrte_pmd_ixgbe >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y) >>>>>> -LDLIBS += -lrte_pmd_e1000 >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>>>>> -LDLIBS += -lrte_pmd_mlx4 >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) >>>>>> -LDLIBS += -lrte_pmd_ring >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>>>>> -LDLIBS += -lrte_pmd_pcap >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) >>>>>> -LDLIBS += -lrte_pmd_af_packet >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) >>>>>> -LDLIBS += -lrte_pmd_null >>>>>> -endif >>>>>> - >>>>>> -endif # plugins >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += >>>>>>-lrte_pmd_vmxnet3_uio >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet >>>>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null >>>>>> + >>>>>> +endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB) >>>>>> >>>>>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>>>>> >>>>>> -LDLIBS += $(EXECENV_LDLIBS) >>>>>> - >>>>>> -LDLIBS += --end-group >>>>>> - >>>>>> -LDLIBS += --no-whole-archive >>>>>> +_LDLIBS-y += $(EXECENV_LDLIBS) >>>>>> +_LDLIBS-y += --end-group >>>>>> +_LDLIBS-y += --no-whole-archive >>>>>> >>>>>> endif # ifeq ($(NO_AUTOLIBS),) >>>>>> >>>>>> -LDLIBS += $(CPU_LDLIBS) >>>>>> +LDLIBS += $(_LDLIBS-y) $(EXTRA_LDLIBS) >>>>>> >>>>>> .PHONY: all >>>>>> all: install >>>> > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk. 2015-05-04 9:18 ` [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk Olivier MATZ 2015-05-04 14:36 ` Wiles, Keith @ 2015-05-04 15:09 ` Wiles, Keith 2015-05-04 15:34 ` Olivier MATZ 1 sibling, 1 reply; 11+ messages in thread From: Wiles, Keith @ 2015-05-04 15:09 UTC (permalink / raw) To: Olivier MATZ; +Cc: dev Sent from my iPhone > On May 4, 2015, at 2:19 AM, Olivier MATZ <olivier.matz@6wind.com> wrote: > > Hi Keith, > >> On 05/01/2015 04:22 PM, Keith Wiles wrote: >> Trying to simplify the ifdefs in rte.app.mk to make the code >> more readable and maintainable by moving LDLIBS variable to use >> the same style as LDLIBS-y being used in the rest of the code. >> >> Added a new variable called EXTRA_LDLIBS to be used by example apps >> instead of using LDLIBS directly. The new internal variable _LDLIBS >> should not be used outside of the rte.app.mk file. The makefiles >> can still use LDLIBS, but I would suggest using EXTRA_LDLIBS instead. > > Why are you suggesting to change LIBS to EXTRA_LIBS? > We discussed in a previous thread that EXTRA_* variables should > (as much as possible) be kept empty in Makefiles as it allows a > user to append things in them. > > By the way, it would be easier to follow the different versions > of your patches if you add "--in-reply-to <Message-ID>" in your > git-send-email command, as described in http://dpdk.org/dev One more reason email handling is not working too many details and on github this would not have happened. Regards ++Keith > > Regards, > Olivier > > >> >> Signed-off-by: Keith Wiles <keith.wiles@intel.com> >> --- >> examples/dpdk_qat/Makefile | 4 +- >> examples/vm_power_manager/Makefile | 2 +- >> mk/rte.app.mk | 242 +++++++++---------------------------- >> 3 files changed, 63 insertions(+), 185 deletions(-) >> >> diff --git a/examples/dpdk_qat/Makefile b/examples/dpdk_qat/Makefile >> index f1e06a1..90ca1d3 100644 >> --- a/examples/dpdk_qat/Makefile >> +++ b/examples/dpdk_qat/Makefile >> @@ -77,8 +77,8 @@ else >> ICP_LIBRARY_PATH = $(ICP_ROOT)/build/libicp_qa_al.a >> endif >> >> -LDLIBS += -L$(ICP_ROOT)/build >> -LDLIBS += $(ICP_LIBRARY_PATH) \ >> +EXTRA_LDLIBS += -L$(ICP_ROOT)/build >> +EXTRA_LDLIBS += $(ICP_LIBRARY_PATH) \ >> -lz \ >> -losal \ >> -ladf_proxy \ >> diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile >> index 113dbc4..8fb78d4 100644 >> --- a/examples/vm_power_manager/Makefile >> +++ b/examples/vm_power_manager/Makefile >> @@ -48,7 +48,7 @@ SRCS-y += channel_monitor.c >> CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ >> CFLAGS += $(WERROR_FLAGS) >> >> -LDLIBS += -lvirt >> +EXTRA_LDLIBS += -lvirt >> >> # workaround for a gcc bug with noreturn attribute >> # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 >> diff --git a/mk/rte.app.mk b/mk/rte.app.mk >> index 62a76ae..b8030d2 100644 >> --- a/mk/rte.app.mk >> +++ b/mk/rte.app.mk >> @@ -1,7 +1,7 @@ >> # BSD LICENSE >> # >> -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. >> -# Copyright(c) 2014 6WIND S.A. >> +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. >> +# Copyright(c) 2014-2015 6WIND S.A. >> # All rights reserved. >> # >> # Redistribution and use in source and binary forms, with or without >> @@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT) >> endif >> >> # default path for libs >> -LDLIBS += -L$(RTE_SDK_BIN)/lib >> +_LDLIBS-y += -L$(RTE_SDK_BIN)/lib >> >> # >> # Include libraries depending on config if NO_AUTOLIBS is not set >> @@ -59,215 +59,93 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib >> # >> ifeq ($(NO_AUTOLIBS),) >> >> -LDLIBS += --whole-archive >> +_LDLIBS-y += --whole-archive >> >> -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) >> -LDLIBS += -l$(RTE_LIBNAME) >> -endif >> +_LDLIBS-$(CONFIG_RTE_BUILD_COMBINE_LIBS) += -l$(RTE_LIBNAME) >> >> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >> >> -ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) >> -LDLIBS += -lrte_distributor >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_REORDER),y) >> -LDLIBS += -lrte_reorder >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder >> >> -ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) >> ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >> -LDLIBS += -lrte_kni >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem >> endif >> >> -ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y) >> -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >> -LDLIBS += -lrte_ivshmem >> -endif >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter >> >> -ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y) >> -LDLIBS += -lrte_pipeline >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt >> >> -ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y) >> -LDLIBS += -lrte_table >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PORT),y) >> -LDLIBS += -lrte_port >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_TIMER),y) >> -LDLIBS += -lrte_timer >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_HASH),y) >> -LDLIBS += -lrte_hash >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_JOBSTATS),y) >> -LDLIBS += -lrte_jobstats >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) >> -LDLIBS += -lrte_lpm >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_POWER),y) >> -LDLIBS += -lrte_power >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) >> -LDLIBS += -lrte_acl >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_METER),y) >> -LDLIBS += -lrte_meter >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) >> -LDLIBS += -lrte_sched >> -LDLIBS += -lm >> -LDLIBS += -lrt >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) >> -LDLIBS += -lrte_vhost >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost >> >> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >> >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >> -LDLIBS += -lpcap >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap >> >> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST)$(CONFIG_RTE_LIBRTE_VHOST_USER),yn) >> -LDLIBS += -lfuse >> +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse >> endif >> >> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >> -LDLIBS += -libverbs >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs >> >> -LDLIBS += --start-group >> +_LDLIBS-y += --start-group >> >> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >> >> -ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) >> -LDLIBS += -lrte_kvargs >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y) >> -LDLIBS += -lrte_mbuf >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y) >> -LDLIBS += -lrte_ip_frag >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y) >> -LDLIBS += -lethdev >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y) >> -LDLIBS += -lrte_malloc >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y) >> -LDLIBS += -lrte_mempool >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_RING),y) >> -LDLIBS += -lrte_ring >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) >> -LDLIBS += -lrte_eal >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) >> -LDLIBS += -lrte_cmdline >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y) >> -LDLIBS += -lrte_cfgfile >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) >> -LDLIBS += -lrte_pmd_bond >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) >> -LDLIBS += -lrte_pmd_xenvirt >> -LDLIBS += -lxenstore >> -endif >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MALLOC) += -lrte_malloc >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond >> + >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore >> >> ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) >> # plugins (link only if static libraries) >> >> -ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) >> -LDLIBS += -lrte_pmd_vmxnet3_uio >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) >> -LDLIBS += -lrte_pmd_virtio >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) >> -LDLIBS += -lrte_pmd_enic >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) >> -LDLIBS += -lrte_pmd_i40e >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_FM10K_PMD),y) >> -LDLIBS += -lrte_pmd_fm10k >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) >> -LDLIBS += -lrte_pmd_ixgbe >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y) >> -LDLIBS += -lrte_pmd_e1000 >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >> -LDLIBS += -lrte_pmd_mlx4 >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) >> -LDLIBS += -lrte_pmd_ring >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >> -LDLIBS += -lrte_pmd_pcap >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) >> -LDLIBS += -lrte_pmd_af_packet >> -endif >> - >> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) >> -LDLIBS += -lrte_pmd_null >> -endif >> - >> -endif # plugins >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null >> + >> +endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB) >> >> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >> >> -LDLIBS += $(EXECENV_LDLIBS) >> - >> -LDLIBS += --end-group >> - >> -LDLIBS += --no-whole-archive >> +_LDLIBS-y += $(EXECENV_LDLIBS) >> +_LDLIBS-y += --end-group >> +_LDLIBS-y += --no-whole-archive >> >> endif # ifeq ($(NO_AUTOLIBS),) >> >> -LDLIBS += $(CPU_LDLIBS) >> +LDLIBS += $(_LDLIBS-y) $(EXTRA_LDLIBS) >> >> .PHONY: all >> all: install >> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk. 2015-05-04 15:09 ` Wiles, Keith @ 2015-05-04 15:34 ` Olivier MATZ 2015-05-04 16:51 ` Wiles, Keith 0 siblings, 1 reply; 11+ messages in thread From: Olivier MATZ @ 2015-05-04 15:34 UTC (permalink / raw) To: Wiles, Keith; +Cc: dev On 05/04/2015 05:09 PM, Wiles, Keith wrote: > > > Sent from my iPhone > >> On May 4, 2015, at 2:19 AM, Olivier MATZ <olivier.matz@6wind.com> wrote: >> >> Hi Keith, >> >>> On 05/01/2015 04:22 PM, Keith Wiles wrote: >>> Trying to simplify the ifdefs in rte.app.mk to make the code >>> more readable and maintainable by moving LDLIBS variable to use >>> the same style as LDLIBS-y being used in the rest of the code. >>> >>> Added a new variable called EXTRA_LDLIBS to be used by example apps >>> instead of using LDLIBS directly. The new internal variable _LDLIBS >>> should not be used outside of the rte.app.mk file. The makefiles >>> can still use LDLIBS, but I would suggest using EXTRA_LDLIBS instead. >> >> Why are you suggesting to change LIBS to EXTRA_LIBS? >> We discussed in a previous thread that EXTRA_* variables should >> (as much as possible) be kept empty in Makefiles as it allows a >> user to append things in them. >> >> By the way, it would be easier to follow the different versions >> of your patches if you add "--in-reply-to <Message-ID>" in your >> git-send-email command, as described in http://dpdk.org/dev > > One more reason email handling is not working too many details and on github this would not have happened. Sorry but that's not the debate here. I'm just suggesting that you use --in-reply-to to help other people to review your patches. Thanks, Olivier > > Regards > ++Keith >> >> Regards, >> Olivier >> >> >>> >>> Signed-off-by: Keith Wiles <keith.wiles@intel.com> >>> --- >>> examples/dpdk_qat/Makefile | 4 +- >>> examples/vm_power_manager/Makefile | 2 +- >>> mk/rte.app.mk | 242 +++++++++---------------------------- >>> 3 files changed, 63 insertions(+), 185 deletions(-) >>> >>> diff --git a/examples/dpdk_qat/Makefile b/examples/dpdk_qat/Makefile >>> index f1e06a1..90ca1d3 100644 >>> --- a/examples/dpdk_qat/Makefile >>> +++ b/examples/dpdk_qat/Makefile >>> @@ -77,8 +77,8 @@ else >>> ICP_LIBRARY_PATH = $(ICP_ROOT)/build/libicp_qa_al.a >>> endif >>> >>> -LDLIBS += -L$(ICP_ROOT)/build >>> -LDLIBS += $(ICP_LIBRARY_PATH) \ >>> +EXTRA_LDLIBS += -L$(ICP_ROOT)/build >>> +EXTRA_LDLIBS += $(ICP_LIBRARY_PATH) \ >>> -lz \ >>> -losal \ >>> -ladf_proxy \ >>> diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile >>> index 113dbc4..8fb78d4 100644 >>> --- a/examples/vm_power_manager/Makefile >>> +++ b/examples/vm_power_manager/Makefile >>> @@ -48,7 +48,7 @@ SRCS-y += channel_monitor.c >>> CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ >>> CFLAGS += $(WERROR_FLAGS) >>> >>> -LDLIBS += -lvirt >>> +EXTRA_LDLIBS += -lvirt >>> >>> # workaround for a gcc bug with noreturn attribute >>> # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 >>> diff --git a/mk/rte.app.mk b/mk/rte.app.mk >>> index 62a76ae..b8030d2 100644 >>> --- a/mk/rte.app.mk >>> +++ b/mk/rte.app.mk >>> @@ -1,7 +1,7 @@ >>> # BSD LICENSE >>> # >>> -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. >>> -# Copyright(c) 2014 6WIND S.A. >>> +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. >>> +# Copyright(c) 2014-2015 6WIND S.A. >>> # All rights reserved. >>> # >>> # Redistribution and use in source and binary forms, with or without >>> @@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT) >>> endif >>> >>> # default path for libs >>> -LDLIBS += -L$(RTE_SDK_BIN)/lib >>> +_LDLIBS-y += -L$(RTE_SDK_BIN)/lib >>> >>> # >>> # Include libraries depending on config if NO_AUTOLIBS is not set >>> @@ -59,215 +59,93 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib >>> # >>> ifeq ($(NO_AUTOLIBS),) >>> >>> -LDLIBS += --whole-archive >>> +_LDLIBS-y += --whole-archive >>> >>> -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) >>> -LDLIBS += -l$(RTE_LIBNAME) >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_BUILD_COMBINE_LIBS) += -l$(RTE_LIBNAME) >>> >>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) >>> -LDLIBS += -lrte_distributor >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_REORDER),y) >>> -LDLIBS += -lrte_reorder >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) >>> ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>> -LDLIBS += -lrte_kni >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem >>> endif >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y) >>> -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>> -LDLIBS += -lrte_ivshmem >>> -endif >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y) >>> -LDLIBS += -lrte_pipeline >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y) >>> -LDLIBS += -lrte_table >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PORT),y) >>> -LDLIBS += -lrte_port >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_TIMER),y) >>> -LDLIBS += -lrte_timer >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_HASH),y) >>> -LDLIBS += -lrte_hash >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_JOBSTATS),y) >>> -LDLIBS += -lrte_jobstats >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) >>> -LDLIBS += -lrte_lpm >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_POWER),y) >>> -LDLIBS += -lrte_power >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) >>> -LDLIBS += -lrte_acl >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_METER),y) >>> -LDLIBS += -lrte_meter >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) >>> -LDLIBS += -lrte_sched >>> -LDLIBS += -lm >>> -LDLIBS += -lrt >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) >>> -LDLIBS += -lrte_vhost >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost >>> >>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>> -LDLIBS += -lpcap >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST)$(CONFIG_RTE_LIBRTE_VHOST_USER),yn) >>> -LDLIBS += -lfuse >>> +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse >>> endif >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>> -LDLIBS += -libverbs >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs >>> >>> -LDLIBS += --start-group >>> +_LDLIBS-y += --start-group >>> >>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) >>> -LDLIBS += -lrte_kvargs >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y) >>> -LDLIBS += -lrte_mbuf >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y) >>> -LDLIBS += -lrte_ip_frag >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y) >>> -LDLIBS += -lethdev >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y) >>> -LDLIBS += -lrte_malloc >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y) >>> -LDLIBS += -lrte_mempool >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_RING),y) >>> -LDLIBS += -lrte_ring >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) >>> -LDLIBS += -lrte_eal >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) >>> -LDLIBS += -lrte_cmdline >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y) >>> -LDLIBS += -lrte_cfgfile >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) >>> -LDLIBS += -lrte_pmd_bond >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) >>> -LDLIBS += -lrte_pmd_xenvirt >>> -LDLIBS += -lxenstore >>> -endif >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MALLOC) += -lrte_malloc >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond >>> + >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore >>> >>> ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) >>> # plugins (link only if static libraries) >>> >>> -ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) >>> -LDLIBS += -lrte_pmd_vmxnet3_uio >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) >>> -LDLIBS += -lrte_pmd_virtio >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) >>> -LDLIBS += -lrte_pmd_enic >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) >>> -LDLIBS += -lrte_pmd_i40e >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_FM10K_PMD),y) >>> -LDLIBS += -lrte_pmd_fm10k >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) >>> -LDLIBS += -lrte_pmd_ixgbe >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y) >>> -LDLIBS += -lrte_pmd_e1000 >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>> -LDLIBS += -lrte_pmd_mlx4 >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) >>> -LDLIBS += -lrte_pmd_ring >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>> -LDLIBS += -lrte_pmd_pcap >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) >>> -LDLIBS += -lrte_pmd_af_packet >>> -endif >>> - >>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) >>> -LDLIBS += -lrte_pmd_null >>> -endif >>> - >>> -endif # plugins >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet >>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null >>> + >>> +endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB) >>> >>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>> >>> -LDLIBS += $(EXECENV_LDLIBS) >>> - >>> -LDLIBS += --end-group >>> - >>> -LDLIBS += --no-whole-archive >>> +_LDLIBS-y += $(EXECENV_LDLIBS) >>> +_LDLIBS-y += --end-group >>> +_LDLIBS-y += --no-whole-archive >>> >>> endif # ifeq ($(NO_AUTOLIBS),) >>> >>> -LDLIBS += $(CPU_LDLIBS) >>> +LDLIBS += $(_LDLIBS-y) $(EXTRA_LDLIBS) >>> >>> .PHONY: all >>> all: install >>> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk. 2015-05-04 15:34 ` Olivier MATZ @ 2015-05-04 16:51 ` Wiles, Keith 0 siblings, 0 replies; 11+ messages in thread From: Wiles, Keith @ 2015-05-04 16:51 UTC (permalink / raw) To: Olivier MATZ; +Cc: dev Sent from my iPhone > On May 4, 2015, at 8:34 AM, Olivier MATZ <olivier.matz@6wind.com> wrote: > > > >> On 05/04/2015 05:09 PM, Wiles, Keith wrote: >> >> >> Sent from my iPhone >> >>> On May 4, 2015, at 2:19 AM, Olivier MATZ <olivier.matz@6wind.com> wrote: >>> >>> Hi Keith, >>> >>>> On 05/01/2015 04:22 PM, Keith Wiles wrote: >>>> Trying to simplify the ifdefs in rte.app.mk to make the code >>>> more readable and maintainable by moving LDLIBS variable to use >>>> the same style as LDLIBS-y being used in the rest of the code. >>>> >>>> Added a new variable called EXTRA_LDLIBS to be used by example apps >>>> instead of using LDLIBS directly. The new internal variable _LDLIBS >>>> should not be used outside of the rte.app.mk file. The makefiles >>>> can still use LDLIBS, but I would suggest using EXTRA_LDLIBS instead. >>> >>> Why are you suggesting to change LIBS to EXTRA_LIBS? >>> We discussed in a previous thread that EXTRA_* variables should >>> (as much as possible) be kept empty in Makefiles as it allows a >>> user to append things in them. >>> >>> By the way, it would be easier to follow the different versions >>> of your patches if you add "--in-reply-to <Message-ID>" in your >>> git-send-email command, as described in http://dpdk.org/dev >> >> One more reason email handling is not working too many details and on github this would not have happened. > > Sorry but that's not the debate here. I'm just suggesting that you > use --in-reply-to to help other people to review your patches. That is why I did not put it in the previous email. Sorry if I offend you in some way. > > Thanks, > Olivier > > > >> >> Regards >> ++Keith >>> >>> Regards, >>> Olivier >>> >>> >>>> >>>> Signed-off-by: Keith Wiles <keith.wiles@intel.com> >>>> --- >>>> examples/dpdk_qat/Makefile | 4 +- >>>> examples/vm_power_manager/Makefile | 2 +- >>>> mk/rte.app.mk | 242 +++++++++---------------------------- >>>> 3 files changed, 63 insertions(+), 185 deletions(-) >>>> >>>> diff --git a/examples/dpdk_qat/Makefile b/examples/dpdk_qat/Makefile >>>> index f1e06a1..90ca1d3 100644 >>>> --- a/examples/dpdk_qat/Makefile >>>> +++ b/examples/dpdk_qat/Makefile >>>> @@ -77,8 +77,8 @@ else >>>> ICP_LIBRARY_PATH = $(ICP_ROOT)/build/libicp_qa_al.a >>>> endif >>>> >>>> -LDLIBS += -L$(ICP_ROOT)/build >>>> -LDLIBS += $(ICP_LIBRARY_PATH) \ >>>> +EXTRA_LDLIBS += -L$(ICP_ROOT)/build >>>> +EXTRA_LDLIBS += $(ICP_LIBRARY_PATH) \ >>>> -lz \ >>>> -losal \ >>>> -ladf_proxy \ >>>> diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile >>>> index 113dbc4..8fb78d4 100644 >>>> --- a/examples/vm_power_manager/Makefile >>>> +++ b/examples/vm_power_manager/Makefile >>>> @@ -48,7 +48,7 @@ SRCS-y += channel_monitor.c >>>> CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/ >>>> CFLAGS += $(WERROR_FLAGS) >>>> >>>> -LDLIBS += -lvirt >>>> +EXTRA_LDLIBS += -lvirt >>>> >>>> # workaround for a gcc bug with noreturn attribute >>>> # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 >>>> diff --git a/mk/rte.app.mk b/mk/rte.app.mk >>>> index 62a76ae..b8030d2 100644 >>>> --- a/mk/rte.app.mk >>>> +++ b/mk/rte.app.mk >>>> @@ -1,7 +1,7 @@ >>>> # BSD LICENSE >>>> # >>>> -# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. >>>> -# Copyright(c) 2014 6WIND S.A. >>>> +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. >>>> +# Copyright(c) 2014-2015 6WIND S.A. >>>> # All rights reserved. >>>> # >>>> # Redistribution and use in source and binary forms, with or without >>>> @@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT) >>>> endif >>>> >>>> # default path for libs >>>> -LDLIBS += -L$(RTE_SDK_BIN)/lib >>>> +_LDLIBS-y += -L$(RTE_SDK_BIN)/lib >>>> >>>> # >>>> # Include libraries depending on config if NO_AUTOLIBS is not set >>>> @@ -59,215 +59,93 @@ LDLIBS += -L$(RTE_SDK_BIN)/lib >>>> # >>>> ifeq ($(NO_AUTOLIBS),) >>>> >>>> -LDLIBS += --whole-archive >>>> +_LDLIBS-y += --whole-archive >>>> >>>> -ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) >>>> -LDLIBS += -l$(RTE_LIBNAME) >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_BUILD_COMBINE_LIBS) += -l$(RTE_LIBNAME) >>>> >>>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y) >>>> -LDLIBS += -lrte_distributor >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_REORDER),y) >>>> -LDLIBS += -lrte_reorder >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_KNI),y) >>>> ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>>> -LDLIBS += -lrte_kni >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem >>>> endif >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y) >>>> -ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) >>>> -LDLIBS += -lrte_ivshmem >>>> -endif >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y) >>>> -LDLIBS += -lrte_pipeline >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y) >>>> -LDLIBS += -lrte_table >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PORT),y) >>>> -LDLIBS += -lrte_port >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_TIMER),y) >>>> -LDLIBS += -lrte_timer >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_HASH),y) >>>> -LDLIBS += -lrte_hash >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_JOBSTATS),y) >>>> -LDLIBS += -lrte_jobstats >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_LPM),y) >>>> -LDLIBS += -lrte_lpm >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_POWER),y) >>>> -LDLIBS += -lrte_power >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_ACL),y) >>>> -LDLIBS += -lrte_acl >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_METER),y) >>>> -LDLIBS += -lrte_meter >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) >>>> -LDLIBS += -lrte_sched >>>> -LDLIBS += -lm >>>> -LDLIBS += -lrt >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST), y) >>>> -LDLIBS += -lrte_vhost >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost >>>> >>>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>>> -LDLIBS += -lpcap >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_VHOST)$(CONFIG_RTE_LIBRTE_VHOST_USER),yn) >>>> -LDLIBS += -lfuse >>>> +ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse >>>> endif >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>>> -LDLIBS += -libverbs >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs >>>> >>>> -LDLIBS += --start-group >>>> +_LDLIBS-y += --start-group >>>> >>>> ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n) >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) >>>> -LDLIBS += -lrte_kvargs >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_MBUF),y) >>>> -LDLIBS += -lrte_mbuf >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_IP_FRAG),y) >>>> -LDLIBS += -lrte_ip_frag >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y) >>>> -LDLIBS += -lethdev >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y) >>>> -LDLIBS += -lrte_malloc >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y) >>>> -LDLIBS += -lrte_mempool >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_RING),y) >>>> -LDLIBS += -lrte_ring >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) >>>> -LDLIBS += -lrte_eal >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) >>>> -LDLIBS += -lrte_cmdline >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),y) >>>> -LDLIBS += -lrte_cfgfile >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) >>>> -LDLIBS += -lrte_pmd_bond >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) >>>> -LDLIBS += -lrte_pmd_xenvirt >>>> -LDLIBS += -lxenstore >>>> -endif >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MALLOC) += -lrte_malloc >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond >>>> + >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore >>>> >>>> ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) >>>> # plugins (link only if static libraries) >>>> >>>> -ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) >>>> -LDLIBS += -lrte_pmd_vmxnet3_uio >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) >>>> -LDLIBS += -lrte_pmd_virtio >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) >>>> -LDLIBS += -lrte_pmd_enic >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y) >>>> -LDLIBS += -lrte_pmd_i40e >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_FM10K_PMD),y) >>>> -LDLIBS += -lrte_pmd_fm10k >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) >>>> -LDLIBS += -lrte_pmd_ixgbe >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_E1000_PMD),y) >>>> -LDLIBS += -lrte_pmd_e1000 >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_MLX4_PMD),y) >>>> -LDLIBS += -lrte_pmd_mlx4 >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) >>>> -LDLIBS += -lrte_pmd_ring >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) >>>> -LDLIBS += -lrte_pmd_pcap >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) >>>> -LDLIBS += -lrte_pmd_af_packet >>>> -endif >>>> - >>>> -ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y) >>>> -LDLIBS += -lrte_pmd_null >>>> -endif >>>> - >>>> -endif # plugins >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet >>>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null >>>> + >>>> +endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB) >>>> >>>> endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS >>>> >>>> -LDLIBS += $(EXECENV_LDLIBS) >>>> - >>>> -LDLIBS += --end-group >>>> - >>>> -LDLIBS += --no-whole-archive >>>> +_LDLIBS-y += $(EXECENV_LDLIBS) >>>> +_LDLIBS-y += --end-group >>>> +_LDLIBS-y += --no-whole-archive >>>> >>>> endif # ifeq ($(NO_AUTOLIBS),) >>>> >>>> -LDLIBS += $(CPU_LDLIBS) >>>> +LDLIBS += $(_LDLIBS-y) $(EXTRA_LDLIBS) >>>> >>>> .PHONY: all >>>> all: install >>>> ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-05-06 2:12 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-05-01 14:22 [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk Keith Wiles 2015-05-01 14:22 ` [dpdk-dev] [PATCH v6 2/2] Update Docs for new EXTRA_LDLIBS variable Keith Wiles 2015-05-04 9:18 ` [dpdk-dev] [PATCH v6 1/2] Simplify the ifdefs in rte.app.mk Olivier MATZ 2015-05-04 14:36 ` Wiles, Keith 2015-05-04 15:26 ` Olivier MATZ 2015-05-04 16:50 ` Wiles, Keith 2015-05-05 7:33 ` Olivier MATZ 2015-05-06 2:12 ` Wiles, Keith 2015-05-04 15:09 ` Wiles, Keith 2015-05-04 15:34 ` Olivier MATZ 2015-05-04 16:51 ` Wiles, Keith
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).