buildtools: fix build for some mktemp
[dpdk.git] / buildtools / gen-build-mk.sh
1 #!/bin/sh
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright(c) 2010-2014 Intel Corporation
4
5 # Auto-generate a Makefile in build directory
6 # Args:
7 #   $1: path of project src root
8 #   $2: path of build dir (can be relative to $1)
9
10 echo "# Automatically generated by gen-build-mk.sh"
11 echo
12 echo "ifdef O"
13 echo "ifeq (\"\$(origin O)\", \"command line\")"
14 echo "\$(error \"Cannot specify O= as you are already in a build directory\")"
15 echo "endif"
16 echo "endif"
17 echo
18 echo "MAKEFLAGS += --no-print-directory"
19 echo
20 echo "all:"
21 echo "  @\$(MAKE) -C $1 O=$2"
22 echo
23 echo "%::"
24 echo "  @\$(MAKE) -C $1 O=$2 \$@"