nuttx/libs/libc/fdt/Make.defs
liaoao 74dddfe92b fdt: add libfdt support
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-10 20:47:37 +08:00

61 lines
1.7 KiB
Plaintext

############################################################################
# libs/libc/fdt/Make.defs
#
# 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.
#
############################################################################
ifeq ($(CONFIG_LIBFDT),y)
VERSION=$(CONFIG_LIBFDT_DTC_VERSION)
# Download and unpack tarball if no git repo found
ifeq ($(wildcard dtc/.git),)
dtc:
$(call DOWNLOAD,https://github.com/dgibson/dtc/archive,v$(VERSION).zip,dtc.zip)
$(Q) unzip -o dtc.zip
$(Q) mv dtc-$(VERSION) dtc
else
dtc:
endif
context:: dtc
CSRCS += fdt.c
CSRCS += fdt_ro.c
CSRCS += fdt_wip.c
CSRCS += fdt_sw.c
CSRCS += fdt_rw.c
CSRCS += fdt_strerror.c
CSRCS += fdt_empty_tree.c
CSRCS += fdt_addresses.c
CSRCS += fdt_overlay.c
CSRCS += fdt_check.c
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)dtc$(DELIM)libfdt$(DELIM)
VPATH += dtc/libfdt
SUBDIRS += dtc/libfdt
DEPPATH += --dep-path dtc/libfdt
distclean::
ifeq ($(wildcard dtc/.git),)
$(call DELDIR, dtc)
$(call DELFILE, dtc.zip)
endif
endif