2015-04-01 01:25:52 +08:00
|
|
|
############################################################################
|
2019-08-05 20:04:14 +08:00
|
|
|
# boards/Makefile
|
2015-04-01 01:25:52 +08:00
|
|
|
#
|
2021-03-05 17:18:57 +08:00
|
|
|
# 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
|
2015-04-01 01:25:52 +08:00
|
|
|
#
|
2021-03-05 17:18:57 +08:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2015-04-01 01:25:52 +08:00
|
|
|
#
|
2021-03-05 17:18:57 +08:00
|
|
|
# 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.
|
2015-04-01 01:25:52 +08:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2020-05-19 03:42:11 +08:00
|
|
|
include $(TOPDIR)/Make.defs
|
2015-04-01 01:25:52 +08:00
|
|
|
|
2016-10-19 00:54:26 +08:00
|
|
|
# The board configuration should be installed in the arch/ directory
|
|
|
|
|
2020-05-21 03:41:57 +08:00
|
|
|
BOARDDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board
|
|
|
|
BOARD_INSTALLED = $(if $(wildcard $(BOARDDIR)$(DELIM)Makefile),y,)
|
2016-10-19 00:54:26 +08:00
|
|
|
|
2015-04-01 01:25:52 +08:00
|
|
|
# Basic
|
|
|
|
|
2019-06-04 06:53:11 +08:00
|
|
|
CONFIG_CSRCS = dummy.c
|
2015-04-01 01:25:52 +08:00
|
|
|
|
|
|
|
# boardctl support
|
|
|
|
|
2021-08-01 15:00:54 +08:00
|
|
|
ifeq ($(CONFIG_BOARDCTL),y)
|
2015-04-01 01:25:52 +08:00
|
|
|
CONFIG_CSRCS += boardctl.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ASRCS = $(CONFIG_ASRCS)
|
|
|
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
|
|
|
|
|
|
|
CSRCS = $(CONFIG_CSRCS)
|
|
|
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
|
|
|
|
2016-11-28 01:19:46 +08:00
|
|
|
CXXSRCS = $(CONFIG_CXXSRCS)
|
|
|
|
CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT))
|
|
|
|
|
2019-06-04 04:45:00 +08:00
|
|
|
SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS)
|
|
|
|
OBJS = $(AOBJS) $(COBJS) $(CXXOBJS)
|
2015-04-01 01:25:52 +08:00
|
|
|
|
2019-08-05 20:04:14 +08:00
|
|
|
BIN = libboards$(LIBEXT)
|
2015-04-01 01:25:52 +08:00
|
|
|
|
|
|
|
all: $(BIN)
|
2017-03-23 07:32:52 +08:00
|
|
|
.PHONY: depend context clean_context clean distclean
|
2015-04-01 01:25:52 +08:00
|
|
|
|
|
|
|
$(AOBJS): %$(OBJEXT): %.S
|
|
|
|
$(call ASSEMBLE, $<, $@)
|
|
|
|
|
|
|
|
$(COBJS): %$(OBJEXT): %.c
|
|
|
|
$(call COMPILE, $<, $@)
|
|
|
|
|
2016-11-28 01:19:46 +08:00
|
|
|
$(CXXOBJS): %$(OBJEXT): %.cxx
|
|
|
|
$(call COMPILEXX, $<, $@)
|
|
|
|
|
2019-06-04 04:45:00 +08:00
|
|
|
$(BIN): $(OBJS)
|
|
|
|
$(call ARCHIVE, $@, $(OBJS))
|
2020-11-28 11:43:30 +08:00
|
|
|
|
2020-11-19 00:44:58 +08:00
|
|
|
makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds) $(CXXSRCS:.cxx=.ddx)
|
|
|
|
$(call CATFILE, Make.dep, $^)
|
|
|
|
$(call DELFILE, $^)
|
2015-04-01 01:25:52 +08:00
|
|
|
|
2020-07-22 15:54:29 +08:00
|
|
|
.depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
|
2020-11-19 00:44:58 +08:00
|
|
|
$(Q) $(MAKE) makedepfile
|
2020-03-23 10:44:03 +08:00
|
|
|
$(Q) touch $@
|
2015-04-01 01:25:52 +08:00
|
|
|
|
2020-03-23 10:44:03 +08:00
|
|
|
depend: .depend
|
2015-04-01 01:25:52 +08:00
|
|
|
|
2022-01-24 09:58:30 +08:00
|
|
|
context:
|
2016-10-19 00:54:26 +08:00
|
|
|
ifeq ($(BOARD_INSTALLED),y)
|
2020-09-15 00:53:37 +08:00
|
|
|
$(Q) $(MAKE) -C $(BOARDDIR) context
|
2016-10-19 00:54:26 +08:00
|
|
|
endif
|
2016-06-30 01:53:00 +08:00
|
|
|
|
|
|
|
clean_context:
|
|
|
|
|
|
|
|
clean: clean_context
|
2015-04-01 01:25:52 +08:00
|
|
|
$(call DELFILE, $(BIN))
|
|
|
|
$(call CLEAN)
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(call DELFILE, Make.dep)
|
2020-03-23 10:44:03 +08:00
|
|
|
$(call DELFILE, .depend)
|
2015-04-01 01:25:52 +08:00
|
|
|
|
2016-05-11 05:44:06 +08:00
|
|
|
-include Make.dep
|