############################################################################ # Makefile # # SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The # ASF licenses this file to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # ############################################################################ # Handle the verbosity level first thing in the build process # Control build verbosity # # V=0: Exit silent mode # V=1,2: Enable echo of commands # V=2: Enable bug/verbose options in tools and scripts ifeq ($(V),) MAKE := $(MAKE) -s --no-print-directory endif ifeq ($(V),1) export Q := else ifeq ($(V),2) export Q := else export Q := @ endif # New Environment variable NXSPACE is checked first. If set, it will point # to NuttX workspace root. NXSPACE ?= $(realpath $(CURDIR)/..) export NXSPACE NXBASE := $(realpath $(NXSPACE)/nuttx) # New BDIR variable defines the board directory. # There are two ways to run NuttX build system: # 1) From the board directory (preferred) # 2) From the NuttX top directory # In the latter case, BDIR can be ommited as the # build entry-point will always be the NuttX top directory. BDIR ?= ${NXBASE} # New OUT variable will be used as the output directory. # All the defined target should refer to this variable for their output. # Preferably, this out variable should be externally provided, for # portability reasons. Rather than keep the output local to the NuttX # source tree, this mechanism allows to specify any out-of-tree dir. # $(NXSPACE)/build is the default output directory, and it's reserved by the # NuttX build system. OUT ?= $(realpath $(NXSPACE)/build) export OUT # Force the BCFG to always be passed to build process. # This new Environment variable defines the board:config to be used. ifndef BCFG $(info ERROR: Board configuration is not set) $(info ) $(info Usage:) $(info make BCFG=) $(info ) $(info Examples:) $(info make BCFG=nsh) $(error Build stopped, BCFG required.) endif # External code support # EXTLIB variable to can be passed to the build system. # EXTLIB should be the end library that is passed to the nuttx build system ifdef EXTLIB TARGETS += ${EXTLIB} endif # Support for ROMFS image creation ifeq (${CONFIG_FS_ROMFS},y) ifdef ROMFSIMG TARGETS += ${ROMFSIMG} else $(error ROMFSIMG is not defined by the board Makefile) endif endif menuconfig: menuconfig