Don't download tarballs if a local git repo found

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2022-08-28 00:21:40 +08:00 committed by Xiang Xiao
parent 38af5befad
commit e0185faa78
5 changed files with 23 additions and 1 deletions

View File

@ -49,11 +49,14 @@ $(LITTLEFS_TARBALL):
$(Q) mv littlefs/littlefs-$(LITTLEFS_VERSION) littlefs/littlefs
$(Q) touch littlefs/.littlefsunpack
# Download and unpack tarball if no git repo found
ifeq ($(wildcard littlefs/littlefs/.git),)
context:: .littlefsunpack
distclean::
$(call DELFILE, littlefs/.littlefsunpack)
$(call DELFILE, littlefs/$(LITTLEFS_TARBALL))
$(call DELDIR, littlefs/littlefs)
endif
endif

View File

@ -20,6 +20,8 @@
LIBCXX_VERSION=12.0.0
# Download and unpack tarball if no git repo found
ifeq ($(wildcard libcxx/.git),)
libcxx-$(LIBCXX_VERSION).src.tar.xz:
$(Q) curl -O -L https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXX_VERSION)/libcxx-$(LIBCXX_VERSION).src.tar.xz
@ -34,6 +36,7 @@ ifeq ($(CONFIG_LIBC_ARCH_ATOMIC),y)
$(Q) patch -p1 < 0002-Omit-atomic_-un-signed_lock_free-if-unsupported.patch
endif
$(Q) touch $@
endif
$(TOPDIR)/include/libcxx: libcxx
$(Q) $(DIRLINK) $(CURDIR)/libcxx/include $(TOPDIR)/include/libcxx
@ -41,9 +44,11 @@ $(TOPDIR)/include/libcxx: libcxx
context:: $(TOPDIR)/include/libcxx
distclean::
$(Q) $(DELFILE) libcxx-$(LIBCXX_VERSION).src.tar.xz
$(Q) $(DIRUNLINK) $(TOPDIR)/include/libcxx
ifeq ($(wildcard libcxx/.git),)
$(Q) $(DELFILE) libcxx-$(LIBCXX_VERSION).src.tar.xz
$(call DELDIR, libcxx)
endif
CXXFLAGS += -std=c++17 ${shell $(DEFINE) "$(CC)" _LIBCPP_BUILDING_LIBRARY}

View File

@ -29,11 +29,15 @@ libcxxabi: libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz
$(Q) patch -p0 < 0001-libc-abi-avoid-the-waring-__EXCEPTIONS-is-not-define.patch
$(Q) touch $@
# Download and unpack tarball if no git repo found
ifeq ($(wildcard libcxxabi/.git),)
distclean::
$(Q) $(DELFILE) libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz
$(call DELDIR, libcxxabi)
context:: libcxxabi
endif
ifeq ($(CONFIG_LIBCXXABI), y)
CXXFLAGS += ${shell $(DEFINE) "$(CC)" LIBCXX_BUILDING_LIBCXXABI}

View File

@ -60,9 +60,12 @@ LIBMETAL_HDRS_SEDEXP := \
s/cmakedefine/undef/g"
libmetal.zip:
# Download and unpack tarball if no git repo found
ifeq ($(wildcard libmetal/.git),)
$(Q) curl -L https://github.com/OpenAMP/libmetal/archive/v$(VERSION).zip -o libmetal.zip
$(Q) unzip -o libmetal.zip
$(Q) mv libmetal-$(VERSION) libmetal
endif
.libmetal_headers: libmetal.zip
$(eval headers := $(wildcard libmetal/lib/compiler/gcc/*.h))
@ -80,8 +83,10 @@ context:: .libmetal_headers
distclean::
$(call DELDIR, $(TOPDIR)$(DELIM)include$(DELIM)metal)
ifeq ($(wildcard libmetal/.git),)
$(call DELDIR, libmetal)
$(call DELFILE, libmetal.zip)
endif
$(call DELFILE, .libmetal_headers)
endif

View File

@ -30,6 +30,8 @@ CSRCS += open-amp/lib/virtio/virtio.c
CSRCS += open-amp/lib/virtio/virtqueue.c
open-amp.zip:
# Download and unpack tarball if no git repo found
ifeq ($(wildcard open-amp/.git),)
$(Q) curl -L https://github.com/OpenAMP/open-amp/archive/v$(VERSION).zip -o open-amp.zip
$(Q) unzip -o open-amp.zip
$(Q) mv open-amp-$(VERSION) open-amp
@ -45,6 +47,7 @@ open-amp.zip:
$(Q) patch -p0 < 0010-rpmsg-notify-the-user-when-the-remote-address-is-rec.patch
$(Q) patch -p0 < 0011-openamp-avoid-double-calling-ns_bound-when-each-othe.patch
$(Q) patch -p0 < 0012-remoteproc-make-all-elf_-functions-static-except-elf.patch
endif
.openamp_headers: open-amp.zip
$(eval headers := $(wildcard open-amp/lib/include/openamp/*.h))
@ -56,8 +59,10 @@ context:: .openamp_headers
distclean::
$(call DELDIR, $(TOPDIR)$(DELIM)include$(DELIM)openamp$(DELIM))
ifeq ($(wildcard open-amp/.git),)
$(call DELDIR, open-amp)
$(call DELFILE, open-amp.zip)
endif
$(call DELFILE, .openamp_headers)
endif