2012-09-04 12:54:00 +00:00
|
|
|
# BSD LICENSE
|
2014-06-03 23:42:50 +00:00
|
|
|
#
|
2014-02-10 11:46:50 +00:00
|
|
|
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
|
2012-09-04 12:54:00 +00:00
|
|
|
# All rights reserved.
|
2014-06-03 23:42:50 +00:00
|
|
|
#
|
2013-09-18 10:00:00 +00:00
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
2012-09-04 12:54:00 +00:00
|
|
|
# are met:
|
2014-06-03 23:42:50 +00:00
|
|
|
#
|
2013-09-18 10:00:00 +00:00
|
|
|
# * Redistributions of source code must retain the above copyright
|
2012-09-04 12:54:00 +00:00
|
|
|
# notice, this list of conditions and the following disclaimer.
|
2013-09-18 10:00:00 +00:00
|
|
|
# * Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
2012-09-04 12:54:00 +00:00
|
|
|
# distribution.
|
2013-09-18 10:00:00 +00:00
|
|
|
# * Neither the name of Intel Corporation nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products derived
|
2012-09-04 12:54:00 +00:00
|
|
|
# from this software without specific prior written permission.
|
2014-06-03 23:42:50 +00:00
|
|
|
#
|
2013-09-18 10:00:00 +00:00
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
2012-09-04 12:54:00 +00:00
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
2013-01-30 15:29:43 +00:00
|
|
|
# Build directory is given with O=
|
2012-09-04 12:54:00 +00:00
|
|
|
ifdef O
|
2013-01-30 15:29:43 +00:00
|
|
|
BUILD_DIR=$(O)
|
|
|
|
else
|
|
|
|
BUILD_DIR=.
|
2012-09-04 12:54:00 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Targets to install can be specified in command line. It can be a
|
|
|
|
# target name or a name containing jokers "*". Example:
|
2014-05-14 14:58:08 +00:00
|
|
|
# x86_64-native-*-gcc
|
2012-09-04 12:54:00 +00:00
|
|
|
ifndef T
|
|
|
|
T=*
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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)))
|
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install: $(INSTALL_TARGETS)
|
|
|
|
|
|
|
|
%_install:
|
|
|
|
@echo ================== Installing $*
|
2013-01-30 15:30:19 +00:00
|
|
|
$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
|
|
|
|
$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
|
mk: allow updates to build config on make install
When running "make config", an additional config.orig file is also
generated, which is intended to hold the original, clean configuration
from the template.
When running make install, we first check if there is no existing
.config file, and run make config if not. If there is a file, we then
check if it's unmodified, in which case we regenerate a new .config to
take account of any possible updates to the template. Finally, in the
case where there is an existing .config file, and it HAS been modified,
we then do a check to see if the template has had further updates, and
throw an error if so. If no updates, we continue with the build using
the existing, user-modified config.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
2014-05-14 15:55:10 +00:00
|
|
|
elif cmp -s $(BUILD_DIR)/$*/.config.orig $(BUILD_DIR)/$*/.config; then \
|
|
|
|
$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
|
|
|
|
else \
|
|
|
|
if [ -f $(BUILD_DIR)/$*/.config.orig ] ; then \
|
|
|
|
tmp_build=$(BUILD_DIR)/$*/.config.tmp; \
|
|
|
|
$(MAKE) config T=$* O=$$tmp_build; \
|
|
|
|
if ! cmp -s $(BUILD_DIR)/$*/.config.orig $$tmp_build/.config ; then \
|
|
|
|
echo "Conflict: local config and template config have both changed"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
echo "Using local configuration"; \
|
2013-01-30 15:30:19 +00:00
|
|
|
fi
|
2013-01-30 15:29:43 +00:00
|
|
|
$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
|
2012-09-04 12:54:00 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# uninstall: remove all built sdk
|
|
|
|
#
|
|
|
|
UNINSTALL_TARGETS := $(addsuffix _uninstall,\
|
|
|
|
$(filter-out %~,$(INSTALL_CONFIGS)))
|
|
|
|
|
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall: $(UNINSTALL_TARGETS)
|
|
|
|
|
|
|
|
%_uninstall:
|
|
|
|
@echo ================== Uninstalling $*
|
2013-01-30 15:29:43 +00:00
|
|
|
$(Q)rm -rf $(BUILD_DIR)/$*
|