-#
-# install: build sdk for all supported targets
-#
-INSTALL_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
- $(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
-INSTALL_TARGETS := $(addsuffix _install,\
- $(filter-out %~,$(INSTALL_CONFIGS)))
+ifdef T # defaults with T= will install an almost flat staging tree
+export prefix ?=
+kerneldir ?= $(prefix)/kmod
+else
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+kerneldir ?= /lib/modules/$(shell uname -r)/extra/dpdk
+else
+kerneldir ?= /boot/modules
+endif
+prefix ?= /usr/local
+endif
+exec_prefix ?= $(prefix)
+bindir ?= $(exec_prefix)/bin
+sbindir ?= $(exec_prefix)/sbin
+libdir ?= $(exec_prefix)/lib
+includedir ?= $(prefix)/include/dpdk
+datarootdir ?= $(prefix)/share
+docdir ?= $(datarootdir)/doc/dpdk
+datadir ?= $(datarootdir)/dpdk
+mandir ?= $(datarootdir)/man
+sdkdir ?= $(datadir)
+targetdir ?= $(datadir)/$(RTE_TARGET)
+
+# The install directories may be staged in DESTDIR
+
+# Create the directory $1 if not exists
+rte_mkdir = test -d $1 || mkdir -p $1
+
+# Create the relative symbolic link $2 -> $1
+# May be replaced with --relative option of ln from coreutils-8.16
+rte_symlink = ln -snf $$($(RTE_SDK)/buildtools/relpath.sh $1 $(dir $2)) $2
+
+.PHONY: pre_install
+pre_install:
+ifdef T
+ $(Q)if [ ! -f $(RTE_OUTPUT)/.config ]; then \
+ $(MAKE) config O=$(RTE_OUTPUT); \
+ elif cmp -s $(RTE_OUTPUT)/.config.orig $(RTE_OUTPUT)/.config; then \
+ $(MAKE) config O=$(RTE_OUTPUT); \
+ else \
+ if [ -f $(RTE_OUTPUT)/.config.orig ] ; then \
+ tmp_build=$(RTE_OUTPUT)/.config.tmp; \
+ $(MAKE) config O=$$tmp_build; \
+ if ! cmp -s $(RTE_OUTPUT)/.config.orig $$tmp_build/.config ; then \
+ echo "Conflict: local config and template config have both changed"; \
+ exit 1; \
+ fi; \
+ fi; \
+ echo "Using local configuration"; \
+ fi
+ $(Q)$(MAKE) all O=$(RTE_OUTPUT)
+endif