build: replace meson OS detection with variable
[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
9 echo "# Automatically generated by gen-build-mk.sh"
10 echo
11 echo "ifdef O"
12 echo "ifeq (\"\$(origin O)\", \"command line\")"
13 echo "\$(error \"Cannot specify O= as you are already in a build directory\")"
14 echo "endif"
15 echo "endif"
16 echo
17 echo "MAKEFLAGS += --no-print-directory"
18 echo
19 echo "all:"
20 echo "  @\$(MAKE) -C $1 O=\$(CURDIR)"
21 echo
22 echo "%::"
23 echo "  @\$(MAKE) -C $1 O=\$(CURDIR) \$@"