2015-03-31 19:25:52 +02:00
|
|
|
############################################################################
|
2019-08-05 14:04:14 +02:00
|
|
|
# boards/Makefile
|
2015-03-31 19:25:52 +02:00
|
|
|
#
|
2016-05-10 23:44:06 +02:00
|
|
|
# Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
2015-03-31 19:25:52 +02:00
|
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. 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
|
|
|
|
# distribution.
|
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# 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 OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
-include $(TOPDIR)/Make.defs
|
|
|
|
|
2016-06-30 00:05:19 +02:00
|
|
|
# Determine if there is a Kconfig file for any custom board configuration
|
2016-06-29 19:53:00 +02:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARCH_BOARD_CUSTOM),y)
|
|
|
|
CUSTOM_DIR = $(patsubst "%",%,$(CONFIG_ARCH_BOARD_CUSTOM_DIR))
|
|
|
|
ifeq ($(CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH),y)
|
|
|
|
CUSTOM_KPATH = $(TOPDIR)$(DELIM)$(CUSTOM_DIR)$(DELIM)Kconfig
|
|
|
|
else
|
|
|
|
CUSTOM_KPATH = $(CUSTOM_DIR)$(DELIM)Kconfig
|
|
|
|
endif
|
|
|
|
CUSTOM_KCONFIG = $(if $(wildcard $(CUSTOM_KPATH)),y,)
|
|
|
|
else
|
|
|
|
CUSTOM_KCONFIG =
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CUSTOM_KCONFIG),y)
|
|
|
|
BOARD_KCONFIG = $(CUSTOM_KPATH)
|
|
|
|
else
|
2019-08-05 14:04:14 +02:00
|
|
|
BOARD_KCONFIG = $(TOPDIR)$(DELIM)boards$(DELIM)dummy$(DELIM)dummy_kconfig
|
2016-06-29 19:53:00 +02:00
|
|
|
endif
|
|
|
|
|
2019-08-05 14:04:14 +02:00
|
|
|
DUMMY_KCONFIG = $(TOPDIR)$(DELIM)boards$(DELIM)dummy$(DELIM)Kconfig
|
2016-06-29 19:53:00 +02:00
|
|
|
|
2016-10-18 18:54:26 +02:00
|
|
|
# The board configuration should be installed in the arch/ directory
|
|
|
|
|
|
|
|
BOARD_DIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board
|
|
|
|
BOARD_INSTALLED = $(if $(wildcard $(BOARD_DIR)$(DELIM)Makefile),y,)
|
|
|
|
|
2015-03-31 19:25:52 +02:00
|
|
|
# Basic
|
|
|
|
|
|
|
|
CONFIG_ASRCS =
|
2019-06-04 00:53:11 +02:00
|
|
|
CONFIG_CSRCS = dummy.c
|
2016-11-27 18:19:46 +01:00
|
|
|
CONFIG_CXXSRCS =
|
2015-03-31 19:25:52 +02:00
|
|
|
|
|
|
|
# boardctl support
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_LIB_BOARDCTL),y)
|
|
|
|
CONFIG_CSRCS += boardctl.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ASRCS = $(CONFIG_ASRCS)
|
|
|
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
|
|
|
|
|
|
|
CSRCS = $(CONFIG_CSRCS)
|
|
|
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
|
|
|
|
2016-11-27 18:19:46 +01:00
|
|
|
CXXSRCS = $(CONFIG_CXXSRCS)
|
|
|
|
CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT))
|
|
|
|
|
2019-06-03 22:45:00 +02:00
|
|
|
SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS)
|
|
|
|
OBJS = $(AOBJS) $(COBJS) $(CXXOBJS)
|
2015-03-31 19:25:52 +02:00
|
|
|
|
2019-08-05 14:04:14 +02:00
|
|
|
BIN = libboards$(LIBEXT)
|
2015-03-31 19:25:52 +02:00
|
|
|
|
|
|
|
all: $(BIN)
|
2017-03-23 00:32:52 +01:00
|
|
|
.PHONY: depend context clean_context clean distclean
|
2015-03-31 19:25:52 +02:00
|
|
|
|
|
|
|
$(AOBJS): %$(OBJEXT): %.S
|
|
|
|
$(call ASSEMBLE, $<, $@)
|
|
|
|
|
|
|
|
$(COBJS): %$(OBJEXT): %.c
|
|
|
|
$(call COMPILE, $<, $@)
|
|
|
|
|
2016-11-27 18:19:46 +01:00
|
|
|
$(CXXOBJS): %$(OBJEXT): %.cxx
|
|
|
|
$(call COMPILEXX, $<, $@)
|
|
|
|
|
2019-06-03 22:45:00 +02:00
|
|
|
$(BIN): $(OBJS)
|
|
|
|
$(call ARCHIVE, $@, $(OBJS))
|
2015-03-31 19:25:52 +02:00
|
|
|
|
2020-03-22 19:15:29 +01:00
|
|
|
Make.dep: Makefile $(SRCS)
|
2015-03-31 19:25:52 +02:00
|
|
|
ifneq ($(SRCS),)
|
2020-03-22 19:15:29 +01:00
|
|
|
$(Q) $(MKDEP) --dep-path . "$(CC)" -- $(CFLAGS) -- $(SRCS) >$@
|
2016-11-27 18:19:46 +01:00
|
|
|
endif
|
|
|
|
ifneq ($(CXXSRCS),)
|
2020-03-22 19:15:29 +01:00
|
|
|
$(Q) $(MKDEP) --dep-path . "$(CXX)" -- $(CXXFLAGS) -- $(CXXSRCS) >>$@
|
2015-03-31 19:25:52 +02:00
|
|
|
endif
|
|
|
|
|
2020-03-22 19:15:29 +01:00
|
|
|
depend: Make.dep
|
2015-03-31 19:25:52 +02:00
|
|
|
|
2016-06-29 19:53:00 +02:00
|
|
|
$(DUMMY_KCONFIG): $(BOARD_KCONFIG)
|
|
|
|
$(call DELFILE, $(DUMMY_KCONFIG))
|
2018-11-05 23:35:28 +01:00
|
|
|
$(call COPYFILE, $(BOARD_KCONFIG), $(DUMMY_KCONFIG))
|
2016-06-29 19:53:00 +02:00
|
|
|
|
2016-07-28 19:59:22 +02:00
|
|
|
dirlinks: $(DUMMY_KCONFIG)
|
|
|
|
|
2016-06-29 19:53:00 +02:00
|
|
|
context: $(DUMMY_KCONFIG)
|
2016-10-18 18:54:26 +02:00
|
|
|
ifeq ($(BOARD_INSTALLED),y)
|
|
|
|
$(Q) $(MAKE) -C $(BOARD_DIR) TOPDIR="$(TOPDIR)" context
|
|
|
|
endif
|
2016-06-29 19:53:00 +02:00
|
|
|
|
|
|
|
clean_context:
|
|
|
|
$(call DELFILE, $(DUMMY_KCONFIG))
|
|
|
|
|
|
|
|
clean: clean_context
|
2015-03-31 19:25:52 +02:00
|
|
|
$(call DELFILE, $(BIN))
|
|
|
|
$(call CLEAN)
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(call DELFILE, Make.dep)
|
|
|
|
|
2016-05-10 23:44:06 +02:00
|
|
|
-include Make.dep
|