openamp/: Add Makefile defines.
This commit is contained in:
parent
19015f7e26
commit
4d64634137
@ -41,8 +41,8 @@ CSRCS =
|
||||
VPATH := $(SRCDIR)
|
||||
DEPPATH = --dep-path .
|
||||
|
||||
-include libmetal/Make.defs
|
||||
-include open-amp/Make.defs
|
||||
include libmetal.defs
|
||||
include open-amp.defs
|
||||
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
|
94
openamp/libmetal.defs
Normal file
94
openamp/libmetal.defs
Normal file
@ -0,0 +1,94 @@
|
||||
############################################################################
|
||||
# openamp/libmetal.defs
|
||||
#
|
||||
# Copyright (C) 2019 Xiaomi. All rights reserved.
|
||||
# Author: Xiang Xiao <xiaoxiang@pinecone.net>
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
ifeq ($(CONFIG_OPENAMP),y)
|
||||
|
||||
ifeq ($(CONFIG_ARCH), sim)
|
||||
LIBMETAL_ARCH = x86_64
|
||||
else
|
||||
LIBMETAL_ARCH = $(subst -,,$(CONFIG_ARCH))
|
||||
endif
|
||||
|
||||
LIBMETAL_HDRS += $(wildcard libmetal/lib/compiler/gcc/*.h)
|
||||
LIBMETAL_HDRS += $(wildcard libmetal/lib/processor/$(LIBMETAL_ARCH)/*.h)
|
||||
LIBMETAL_HDRS += $(wildcard libmetal/lib/system/nuttx/*.h)
|
||||
LIBMETAL_HDRS += $(wildcard libmetal/lib/*.h)
|
||||
|
||||
CSRCS += libmetal/lib/system/nuttx/condition.c
|
||||
CSRCS += libmetal/lib/system/nuttx/device.c
|
||||
CSRCS += libmetal/lib/system/nuttx/init.c
|
||||
CSRCS += libmetal/lib/system/nuttx/io.c
|
||||
CSRCS += libmetal/lib/system/nuttx/irq.c
|
||||
CSRCS += libmetal/lib/system/nuttx/shmem.c
|
||||
CSRCS += libmetal/lib/system/nuttx/time.c
|
||||
CSRCS += libmetal/lib/device.c
|
||||
CSRCS += libmetal/lib/dma.c
|
||||
CSRCS += libmetal/lib/init.c
|
||||
CSRCS += libmetal/lib/io.c
|
||||
CSRCS += libmetal/lib/irq.c
|
||||
CSRCS += libmetal/lib/log.c
|
||||
CSRCS += libmetal/lib/shmem.c
|
||||
CSRCS += libmetal/lib/version.c
|
||||
|
||||
CFLAGS += -DMETAL_INTERNAL
|
||||
|
||||
LIBMETAL_HDRS_SEDEXP := \
|
||||
"s/@PROJECT_VER_MAJOR@/0/g; \
|
||||
s/@PROJECT_VER_MINOR@/1/g; \
|
||||
s/@PROJECT_VER_PATCH@/0/g; \
|
||||
s/@PROJECT_VER@/0.1.0/g; \
|
||||
s/@PROJECT_SYSTEM@/nuttx/g; \
|
||||
s/@PROJECT_PROCESSOR@/$(LIBMETAL_ARCH)/g; \
|
||||
s/@PROJECT_MACHINE@/$(CONFIG_ARCH_CHIP)/g; \
|
||||
s/@PROJECT_SYSTEM_UPPER@/nuttx/g; \
|
||||
s/@PROJECT_PROCESSOR_UPPER@/$(LIBMETAL_ARCH)/g; \
|
||||
s/@PROJECT_MACHINE_UPPER@/$(CONFIG_ARCH_CHIP)/g; \
|
||||
s/cmakedefine/undef/g"
|
||||
|
||||
.libmetal_headers: $(LIBMETAL_HDRS)
|
||||
$(foreach headers,$(LIBMETAL_HDRS), \
|
||||
$(eval hobj := $(patsubst libmetal$(DELIM)lib$(DELIM)%,$(TOPDIR)$(DELIM)include$(DELIM)metal$(DELIM)%,$(headers))) \
|
||||
$(shell if [ ! -d $(dir $(hobj)) ];then mkdir -p $(dir $(hobj)); fi) \
|
||||
$(shell sed $(LIBMETAL_HDRS_SEDEXP) $(headers) > $(hobj)) \
|
||||
)
|
||||
touch $@
|
||||
|
||||
dirlinks:: .libmetal_headers
|
||||
|
||||
distclean::
|
||||
$(call DELDIR, $(TOPDIR)$(DELIM)include$(DELIM)metal)
|
||||
$(call DELFILE, .libmetal_headers)
|
||||
|
||||
endif
|
60
openamp/open-amp.defs
Normal file
60
openamp/open-amp.defs
Normal file
@ -0,0 +1,60 @@
|
||||
############################################################################
|
||||
# openamp/open-amp.defs
|
||||
#
|
||||
# Copyright (C) 2019 Xiaomi. All rights reserved.
|
||||
# Author: Xiang Xiao <xiaoxiang@pinecone.net>
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
ifeq ($(CONFIG_OPENAMP),y)
|
||||
|
||||
OPENAMP_HDRS += $(wildcard open-amp/lib/include/openamp/*.h)
|
||||
|
||||
CSRCS += open-amp/lib/remoteproc/elf_loader.c
|
||||
CSRCS += open-amp/lib/remoteproc/remoteproc.c
|
||||
CSRCS += open-amp/lib/remoteproc/remoteproc_virtio.c
|
||||
CSRCS += open-amp/lib/remoteproc/rsc_table_parser.c
|
||||
CSRCS += open-amp/lib/rpmsg/rpmsg.c
|
||||
CSRCS += open-amp/lib/rpmsg/rpmsg_virtio.c
|
||||
CSRCS += open-amp/lib/virtio/virtio.c
|
||||
CSRCS += open-amp/lib/virtio/virtqueue.c
|
||||
|
||||
.openamp_headers: $(OPENAMP_HDRS)
|
||||
$(shell mkdir -p $(TOPDIR)$(DELIM)include$(DELIM)openamp$(DELIM))
|
||||
$(foreach header,$^,$(shell cp -rf $(header) $(TOPDIR)$(DELIM)include$(DELIM)openamp$(DELIM)))
|
||||
touch $@
|
||||
|
||||
dirlinks:: .openamp_headers
|
||||
|
||||
distclean::
|
||||
$(call DELDIR, $(TOPDIR)$(DELIM)include$(DELIM)openamp$(DELIM))
|
||||
$(call DELFILE, .openamp_headers)
|
||||
|
||||
endif
|
Loading…
Reference in New Issue
Block a user