# BSD LICENSE
#
-# Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.PHONY: showversion
+showversion:
+ @sed -rn 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
+ $(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h | \
+ tr '\n' '.' | sed -r 's,\.([0-9]+)\.$$,r\1\n,'
+
INSTALL_CONFIGS := $(filter-out %~,\
$(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
$(wildcard $(RTE_SRCDIR)/config/defconfig_*)))
INSTALL_TARGETS := $(addsuffix _install,$(INSTALL_CONFIGS))
+.PHONY: showconfigs
+showconfigs:
+ @$(foreach CONFIG, $(INSTALL_CONFIGS), echo $(CONFIG);)
+
.PHONY: config
ifeq ($(RTE_CONFIG_TEMPLATE),)
config:
- @echo -n "No template specified. Use T=template " ; \
- echo "among the following list:" ; \
- for t in $(INSTALL_CONFIGS); do \
- echo " $$t" ; \
- done
+ @printf "No template specified. "
+ @echo "Use T=template among the following list:"
+ @$(MAKE) -rR showconfigs | sed 's,^, ,'
else
config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile
$(Q)$(MAKE) depdirs
$(RTE_OUTPUT)/.config: $(RTE_CONFIG_TEMPLATE) FORCE
@[ -d $(RTE_OUTPUT) ] || mkdir -p $(RTE_OUTPUT)
$(Q)if [ "$(RTE_CONFIG_TEMPLATE)" != "" -a -f "$(RTE_CONFIG_TEMPLATE)" ]; then \
- if grep -q '#include' $(RTE_CONFIG_TEMPLATE) ; then \
- $(CPP) -undef -C -P -x assembler-with-cpp -fdirectives-only \
- -o $(RTE_OUTPUT)/.config_tmp $(RTE_CONFIG_TEMPLATE) ; \
- else \
- cp $(RTE_CONFIG_TEMPLATE) $(RTE_OUTPUT)/.config_tmp ; \
- fi ; \
+ $(CPP) -undef -P -x assembler-with-cpp \
+ -fdirectives-only -ffreestanding \
+ -o $(RTE_OUTPUT)/.config_tmp $(RTE_CONFIG_TEMPLATE) ; \
if ! cmp -s $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config; then \
cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config ; \
fi ; \