dpdk-fm10k/buildtools/gen-build-mk.sh
Bruce Richardson 6927f8dbf3 mk: allow renaming of build directories
When building using make, the Makefile in the build directory contained
the name of the build directory to be passed as an "O=" parameter to
the DPDK SDK makefiles. Unfortunately, this meant that the compilation
would always fail if the build directory was renamed. To remove this
limitation, we can use $(CURDIR) instead of the directory name.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-11-14 01:46:00 +01:00

24 lines
565 B
Bash
Executable file

#!/bin/sh
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation
# Auto-generate a Makefile in build directory
# Args:
# $1: path of project src root
echo "# Automatically generated by gen-build-mk.sh"
echo
echo "ifdef O"
echo "ifeq (\"\$(origin O)\", \"command line\")"
echo "\$(error \"Cannot specify O= as you are already in a build directory\")"
echo "endif"
echo "endif"
echo
echo "MAKEFLAGS += --no-print-directory"
echo
echo "all:"
echo " @\$(MAKE) -C $1 O=\$(CURDIR)"
echo
echo "%::"
echo " @\$(MAKE) -C $1 O=\$(CURDIR) \$@"