Makefile.rules 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ifeq ($(NOISY_BUILD),)
  2. SUBMAKE?=$(MAKE) --quiet --no-print-directory
  3. ECHO_PREFIX?=@
  4. CMD_PREFIX?=@
  5. QUIET_CONFIGURE=-q
  6. REALLY_QUIET=>/dev/null 2>&1
  7. else
  8. SUBMAKE?=$(MAKE)
  9. ECHO_PREFIX?=@\#
  10. CMD_PREFIX?=
  11. QUIET_CONFIGURE=
  12. REALLY_QUIET=
  13. endif
  14. export SUBMAKE
  15. export ECHO_PREFIX
  16. export CMD_PREFIX
  17. export QUIET_CONFIGURE
  18. export REALLY_QUIET
  19. export ASTTOPDIR
  20. export ASTSBINDIR
  21. export DESTDIR
  22. export ASTDATADIR
  23. export TAR
  24. export PATCH
  25. export SED
  26. export NM
  27. export MD5
  28. export CAT
  29. export CUT
  30. export GREP
  31. export DOWNLOAD
  32. export DOWNLOAD_TO_STDOUT
  33. export DOWNLOAD_TIMEOUT
  34. DOWNLOAD_DIR := $(or $(EXTERNALS_CACHE_DIR),$(TMPDIR),$(wildcard /tmp),.)
  35. # These depend on the subpackage defining TARBALL_FILE.
  36. TARBALL_EXISTS = test -f $(DOWNLOAD_DIR)/$(TARBALL_FILE) -a -f $(TARBALL_MD5)
  37. define TARBALL_VERIFY
  38. ($(SHELL_ECHO_PREFIX) Verifying $(DOWNLOAD_DIR)/$(TARBALL_FILE) &&\
  39. tarball_sum=$$($(CAT) $(DOWNLOAD_DIR)/$(TARBALL_FILE) | $(MD5) | $(CUT) -d' ' -f1) ;\
  40. required_sum=$$($(GREP) -e $(TARBALL_FILE) $(TARBALL_MD5) | $(CUT) -d' ' -f1) ;\
  41. if [ -z "$$required_sum" -o "$$tarball_sum" != "$$required_sum" ] ; then $(SHELL_ECHO_PREFIX) Verify failed ; exit 1 ;\
  42. else $(SHELL_ECHO_PREFIX) Verify successful ; exit 0 ; fi; )
  43. endef
  44. define TARBALL_DOWNLOAD
  45. ($(SHELL_ECHO_PREFIX) Downloading $(TARBALL_URL) to $(DOWNLOAD_DIR)/$(TARBALL_FILE) ;\
  46. $(DOWNLOAD_TO_STDOUT) $(call DOWNLOAD_TIMEOUT,5,60) $(TARBALL_URL) > $(DOWNLOAD_DIR)/$(TARBALL_FILE) &&\
  47. $(TARBALL_VERIFY))
  48. endef
  49. TARBALL_URL = $(PACKAGE_URL)/$(TARBALL_FILE)
  50. TARBALL_MD5 = $(TARBALL_FILE).md5