diff options
author | Ricardo Salveti <ricardo.salveti@linaro.org> | 2016-07-18 15:30:06 -0300 |
---|---|---|
committer | Ricardo Salveti <ricardo.salveti@linaro.org> | 2016-07-18 15:30:30 -0300 |
commit | a41e6ff15809d40e0f9bbc9576bf8f7f80fbec1d (patch) | |
tree | c9e6fc399c2738e84ed2585e6e51e90f9608ca12 /mk | |
parent | 8b25d1ad5d2264bdfc2818c7bda74ee2697df6db (diff) |
Imported Upstream version 16.07-rc2
Change-Id: Ie9e8ec528a2a0dace085c5e44aa7fa3b489d4ba0
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Diffstat (limited to 'mk')
-rw-r--r-- | mk/internal/rte.compile-pre.mk | 12 | ||||
-rw-r--r-- | mk/rte.hostapp.mk | 8 | ||||
-rw-r--r-- | mk/rte.sdkbuild.mk | 3 | ||||
-rw-r--r-- | mk/rte.sdkconfig.mk | 11 | ||||
-rw-r--r-- | mk/rte.sdkinstall.mk | 6 |
5 files changed, 33 insertions, 7 deletions
diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk index b9bff4a7..9c25ff6c 100644 --- a/mk/internal/rte.compile-pre.mk +++ b/mk/internal/rte.compile-pre.mk @@ -84,10 +84,22 @@ C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CFLAGS) \ C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)"," CC $(@)") endif +PMDINFO_GEN = $(RTE_SDK_BIN)/app/pmdinfogen $@ $@.pmd.c +PMDINFO_CC = $(CC) $(CFLAGS) -c -o $@.pmd.o $@.pmd.c +PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o $@.o $@.pmd.o $@ +PMDINFO_TO_O = if grep -q 'PMD_REGISTER_DRIVER(.*)' $<; then \ + echo "$(if $V,$(PMDINFO_GEN), PMDINFO $@.pmd.c)" && \ + $(PMDINFO_GEN) && \ + echo "$(if $V,$(PMDINFO_CC), CC $@.pmd.o)" && \ + $(PMDINFO_CC) && \ + echo "$(if $V,$(PMDINFO_LD), LD $@)" && \ + $(PMDINFO_LD) && \ + mv -f $@.o $@; fi C_TO_O_CMD = 'cmd_$@ = $(C_TO_O_STR)' C_TO_O_DO = @set -e; \ echo $(C_TO_O_DISP); \ $(C_TO_O) && \ + $(PMDINFO_TO_O) && \ echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \ sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \ rm -f $(call obj2dep,$(@)).tmp diff --git a/mk/rte.hostapp.mk b/mk/rte.hostapp.mk index c44d0f8a..07b391c2 100644 --- a/mk/rte.hostapp.mk +++ b/mk/rte.hostapp.mk @@ -41,7 +41,7 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk VPATH += $(SRCDIR) _BUILD = $(HOSTAPP) -_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/hostapp/$(HOSTAPP) +_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/app/$(HOSTAPP) _CLEAN = doclean .PHONY: all @@ -95,10 +95,10 @@ $(HOSTAPP): $(OBJS-y) $(LDLIBS_FILES) FORCE # # install app in $(RTE_OUTPUT)/hostapp # -$(RTE_OUTPUT)/hostapp/$(HOSTAPP): $(HOSTAPP) +$(RTE_OUTPUT)/app/$(HOSTAPP): $(HOSTAPP) @echo " INSTALL-HOSTAPP $(HOSTAPP)" - @[ -d $(RTE_OUTPUT)/hostapp ] || mkdir -p $(RTE_OUTPUT)/hostapp - $(Q)cp -f $(HOSTAPP) $(RTE_OUTPUT)/hostapp + @[ -d $(RTE_OUTPUT)/app ] || mkdir -p $(RTE_OUTPUT)/app + $(Q)cp -f $(HOSTAPP) $(RTE_OUTPUT)/app # # Clean all generated files diff --git a/mk/rte.sdkbuild.mk b/mk/rte.sdkbuild.mk index eec52412..23fcf1e1 100644 --- a/mk/rte.sdkbuild.mk +++ b/mk/rte.sdkbuild.mk @@ -49,6 +49,7 @@ $(1): $(sort $(LOCAL_DEPDIRS-$(1))) endef $(foreach d,$(ROOTDIRS-y),$(eval $(call depdirs_rule,$(d)))) +drivers: | buildtools # # build and clean targets @@ -63,7 +64,7 @@ build: $(ROOTDIRS-y) .PHONY: clean clean: $(CLEANDIRS) @rm -rf $(RTE_OUTPUT)/include $(RTE_OUTPUT)/app \ - $(RTE_OUTPUT)/hostapp $(RTE_OUTPUT)/lib \ + $(RTE_OUTPUT)/lib \ $(RTE_OUTPUT)/hostlib $(RTE_OUTPUT)/kmod @[ -d $(RTE_OUTPUT)/include ] || mkdir -p $(RTE_OUTPUT)/include @$(RTE_SDK)/scripts/gen-config-h.sh $(RTE_OUTPUT)/.config \ diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk index a3acfe64..e93237fe 100644 --- a/mk/rte.sdkconfig.mk +++ b/mk/rte.sdkconfig.mk @@ -79,11 +79,20 @@ $(RTE_OUTPUT): ifdef NODOTCONF $(RTE_OUTPUT)/.config: ; else +# Generate config from template, if there are duplicates keep only the last. +# To do so the temp config is checked for duplicate keys with cut/sort/uniq +# Then for each of those identified duplicates as long as there are more than +# just one left the last match is removed. $(RTE_OUTPUT)/.config: $(RTE_CONFIG_TEMPLATE) FORCE | $(RTE_OUTPUT) $(Q)if [ "$(RTE_CONFIG_TEMPLATE)" != "" -a -f "$(RTE_CONFIG_TEMPLATE)" ]; then \ $(CPP) -undef -P -x assembler-with-cpp \ -ffreestanding \ -o $(RTE_OUTPUT)/.config_tmp $(RTE_CONFIG_TEMPLATE) ; \ + for config in $$(grep -v "^#" $(RTE_OUTPUT)/.config_tmp | cut -d"=" -f1 | sort | uniq -d); do \ + while [ $$(grep "^$${config}=" $(RTE_OUTPUT)/.config_tmp -c ) -gt 1 ]; do \ + sed -i "0,/^$${config}=/{//d}" $(RTE_OUTPUT)/.config_tmp; \ + done; \ + done; \ if ! cmp -s $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config; then \ cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config ; \ cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config.orig ; \ @@ -108,7 +117,7 @@ $(RTE_OUTPUT)/Makefile: | $(RTE_OUTPUT) # if NODOTCONF variable is defined, don't try to rebuild .config $(RTE_OUTPUT)/include/rte_config.h: $(RTE_OUTPUT)/.config $(Q)rm -rf $(RTE_OUTPUT)/include $(RTE_OUTPUT)/app \ - $(RTE_OUTPUT)/hostapp $(RTE_OUTPUT)/lib \ + $(RTE_OUTPUT)/lib \ $(RTE_OUTPUT)/hostlib $(RTE_OUTPUT)/kmod $(RTE_OUTPUT)/build $(Q)mkdir -p $(RTE_OUTPUT)/include $(Q)$(RTE_SDK)/scripts/gen-config-h.sh $(RTE_OUTPUT)/.config \ diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk index abdab0f0..7cd352c7 100644 --- a/mk/rte.sdkinstall.mk +++ b/mk/rte.sdkinstall.mk @@ -117,6 +117,7 @@ install-runtime: $(Q)cp -a $O/lib/* $(DESTDIR)$(libdir) $(Q)$(call rte_mkdir, $(DESTDIR)$(bindir)) $(Q)tar -cf - -C $O --exclude 'app/*.map' \ + --exclude app/pmdinfogen \ --exclude 'app/cmdline*' --exclude app/test \ --exclude app/testacl --exclude app/testpipeline app | \ tar -xf - -C $(DESTDIR)$(bindir) --strip-components=1 \ @@ -126,6 +127,8 @@ install-runtime: $(Q)$(call rte_mkdir, $(DESTDIR)$(sbindir)) $(Q)$(call rte_symlink, $(DESTDIR)$(datadir)/tools/dpdk_nic_bind.py, \ $(DESTDIR)$(sbindir)/dpdk_nic_bind) + $(Q)$(call rte_symlink, $(DESTDIR)$(datadir)/tools/pmdinfo.py, \ + $(DESTDIR)$(bindir)/dpdk_pmdinfo) install-kmod: ifneq ($(wildcard $O/kmod/*),) @@ -141,8 +144,9 @@ install-sdk: $(Q)$(call rte_mkdir, $(DESTDIR)$(sdkdir)) $(Q)cp -a $(RTE_SDK)/mk $(DESTDIR)$(sdkdir) $(Q)cp -a $(RTE_SDK)/scripts $(DESTDIR)$(sdkdir) - $(Q)$(call rte_mkdir, $(DESTDIR)$(targetdir)) + $(Q)$(call rte_mkdir, $(DESTDIR)$(targetdir)/app) $(Q)cp -a $O/.config $(DESTDIR)$(targetdir) + $(Q)cp -a $O/app/pmdinfogen $(DESTDIR)$(targetdir)/app $(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include) $(Q)$(call rte_symlink, $(DESTDIR)$(libdir), $(DESTDIR)$(targetdir)/lib) |