# We're building in two situations: when MAKECMDGOALS is empty
# (default target is to build), or when MAKECMDGOALS contains
# something else than one of the nobuild_targets.
-nobuild_targets := source %-source source-check \
+nobuild_targets := source %-source \
legal-info %-legal-info external-deps _external-deps \
clean distclean help show-targets graph-depends \
%-graph-depends %-show-depends %-show-version \
external-deps:
@$(MAKE1) -Bs $(EXTRAMAKEARGS) _external-deps | sort -u
-# check if download URLs are outdated
-.PHONY: source-check
-source-check: $(foreach p,$(PACKAGES),$(p)-all-source-check)
-
.PHONY: legal-info-clean
legal-info-clean:
@rm -fr $(LEGAL_INFO_DIR)
@echo
@echo 'Miscellaneous:'
@echo ' source - download all sources needed for offline-build'
- @echo ' source-check - check selected packages for valid download URLs'
@echo ' external-deps - list external packages used'
@echo ' legal-info - generate info about license compliance'
@echo ' printvars - dump all the internal variables'
# ssh authentication. DOWNLOAD_WGET is the normal wget-based download
# mechanism.
#
-# The SOURCE_CHECK_* helpers are in charge of simply checking that the source
-# is available for download. This can be used to make sure one will be able
-# to get all the sources needed for one's build configuration.
################################################################################
define DOWNLOAD_GIT
$($(PKG)_DL_OPTS)
endef
-# TODO: improve to check that the given PKG_DL_VERSION exists on the remote
-# repository
-define SOURCE_CHECK_GIT
- $(GIT) ls-remote --heads $($(PKG)_SITE) > /dev/null
-endef
-
define DOWNLOAD_BZR
$(EXTRA_ENV) $(DL_WRAPPER) -b bzr \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
$($(PKG)_DL_OPTS)
endef
-define SOURCE_CHECK_BZR
- $(BZR) ls --quiet $($(PKG)_SITE) > /dev/null
-endef
-
define DOWNLOAD_CVS
$(EXTRA_ENV) $(DL_WRAPPER) -b cvs \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
$($(PKG)_DL_OPTS)
endef
-# Not all CVS servers support ls/rls, use login to see if we can connect
-define SOURCE_CHECK_CVS
- $(CVS) -d:pserver:anonymous:@$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) login
-endef
-
define DOWNLOAD_SVN
$(EXTRA_ENV) $(DL_WRAPPER) -b svn \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
$($(PKG)_DL_OPTS)
endef
-define SOURCE_CHECK_SVN
- $(SVN) ls $($(PKG)_SITE)@$($(PKG)_DL_VERSION) > /dev/null
-endef
-
# SCP URIs should be of the form scp://[user@]host:filepath
# Note that filepath is relative to the user's home directory, so you may want
# to prepend the path with a slash: scp://[user@]host:/absolutepath
$($(PKG)_DL_OPTS)
endef
-define SOURCE_CHECK_SCP
- $(SSH) $(call domain,$(1),:) ls '$(call notdomain,$(1),:)' > /dev/null
-endef
-
define DOWNLOAD_HG
$(EXTRA_ENV) $(DL_WRAPPER) -b hg \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
$($(PKG)_DL_OPTS)
endef
-# TODO: improve to check that the given PKG_DL_VERSION exists on the remote
-# repository
-define SOURCE_CHECK_HG
- $(HG) incoming --force -l1 $($(PKG)_SITE) > /dev/null
-endef
-
define DOWNLOAD_WGET
$(EXTRA_ENV) $(DL_WRAPPER) -b wget \
-o $(DL_DIR)/$(2) \
$($(PKG)_DL_OPTS)
endef
-define SOURCE_CHECK_WGET
- $(WGET) --spider '$(call qstrip,$(1))'
-endef
-
define DOWNLOAD_LOCALFILES
$(EXTRA_ENV) $(DL_WRAPPER) -b cp \
-o $(DL_DIR)/$(2) \
$($(PKG)_DL_OPTS)
endef
-define SOURCE_CHECK_LOCALFILES
- test -e $(call stripurischeme,$(call qstrip,$(1)))
-endef
-
################################################################################
# DOWNLOAD -- Download helper. Will try to download source from:
# 1) BR2_PRIMARY_SITE if enabled
$(call DOWNLOAD_INNER,$(1),$(notdir $(1)),DOWNLOAD)
endef
-define SOURCE_CHECK
- $(call DOWNLOAD_INNER,$(1),$(notdir $(1)),SOURCE_CHECK)
-endef
-
define DOWNLOAD_INNER
$(Q)$(if $(filter bzr cvs hg svn,$($(PKG)_SITE_METHOD)),export BR_NO_CHECK_HASH_FOR=$(2);) \
if test -n "$(call qstrip,$(BR2_PRIMARY_SITE))" ; then \
endif # actual sources != sources
endif # actual sources != ""
-$(1)-source-check: PKG=$(2)
-$(1)-source-check:
- $$(foreach p,$$($(2)_ALL_DOWNLOADS),$$(call SOURCE_CHECK,$$(p))$$(sep))
-
$(1)-external-deps:
@for p in $$($(2)_SOURCE) $$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS) ; do \
echo `basename $$$$p` ; \
$(1)-source:
$(1)-legal-source:
-$(1)-source-check:
- test -d $$($(2)_OVERRIDE_SRCDIR)
-
$(1)-external-deps:
@echo "file://$$($(2)_OVERRIDE_SRCDIR)"
endif
$(1)-all-source: $(1)-source
$(1)-all-source: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-source)
-$(1)-all-source-check: $(1)-source-check
-$(1)-all-source-check: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-source-check)
-
$(1)-all-external-deps: $(1)-external-deps
$(1)-all-external-deps: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-external-deps)
$(1)-all-external-deps \
$(1)-all-legal-info \
$(1)-all-source \
- $(1)-all-source-check \
$(1)-build \
$(1)-clean-for-rebuild \
$(1)-clean-for-reconfigure \
$(1)-rsync \
$(1)-show-depends \
$(1)-show-version \
- $(1)-source \
- $(1)-source-check
+ $(1)-source
ifneq ($$($(2)_SOURCE),)
ifeq ($$($(2)_SITE),)