host.mk 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. # This is where all package operation is done in
  4. ifneq (,$(findstring host,$(MAKECMDGOALS)))
  5. WRKDIR?= ${HOST_BUILD_DIR}/w-${PKG_NAME}-${PKG_VERSION}-${PKG_RELEASE}-host
  6. endif
  7. HOST_AUTOTOOL_ENV+= PATH='${HOST_PATH}' \
  8. PKG_CONFIG_LIBDIR='${STAGING_HOST_DIR}/usr/lib/pkgconfig:${STAGING_HOST_DIR}/usr/share/pkgconfig' \
  9. PKG_CONFIG_SYSROOT_DIR='${STAGING_HOST_DIR}' \
  10. ${COMMON_ENV}
  11. # this is environment for 'configure'
  12. HOST_CONFIGURE_ENV?= PATH='${HOST_PATH}' \
  13. ${COMMON_ENV} \
  14. ${HOST_ENV} \
  15. PKG_CONFIG_LIBDIR='${STAGING_HOST_DIR}/usr/lib/pkgconfig:${STAGING_HOST_DIR}/usr/share/pkgconfig:${STAGING_HOST_DIR}/usr/lib/${GNU_HOST_NAME}/pkgconfig' \
  16. PKG_CONFIG_SYSROOT_DIR='${STAGING_HOST_DIR}' \
  17. PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
  18. # this is environment for 'make all' and 'make install'
  19. HOST_MAKE_ENV?=
  20. # this is arguments for 'make all' and 'make install'
  21. HOST_XAKE_FLAGS?=
  22. # this is arguments for 'make all' ONLY
  23. HOST_MAKE_FLAGS?=
  24. # this is arguments for 'make install' ONLY
  25. HOST_FAKE_FLAGS?=
  26. HOST_ALL_TARGET?= all
  27. HOST_INSTALL_TARGET?= install
  28. HOST_MAKE_ENV+= PATH='${HOST_PATH}' \
  29. ${COMMON_ENV} \
  30. ${HOST_ENV}
  31. HOST_MAKE_FLAGS+= ${HOST_XAKE_FLAGS} V=1
  32. HOST_FAKE_FLAGS+= ${HOST_XAKE_FLAGS}
  33. HOST_WRKINST= ${WRKDIR}/fake
  34. _HOST_EXTRACT_COOKIE= ${WRKDIST}/.extract_done
  35. _HOST_PATCH_COOKIE= ${WRKDIST}/.prepared
  36. _HOST_CONFIGURE_COOKIE= ${WRKDIR}/.host_configure_done
  37. _HOST_BUILD_COOKIE= ${WRKDIR}/.host_build_done
  38. _HOST_FAKE_COOKIE= ${HOST_WRKINST}/.host_fake_done
  39. _HOST_COOKIE= ${STAGING_PKG_DIR}/stamps/${PKG_NAME}${PKG_VERSION}-${PKG_RELEASE}-host
  40. hostextract: ${_HOST_EXTRACT_COOKIE}
  41. hostpatch: ${_HOST_PATCH_COOKIE}
  42. hostconfigure: ${_HOST_CONFIGURE_COOKIE}
  43. hostbuild: ${_HOST_BUILD_COOKIE}
  44. hostfake: ${_HOST_FAKE_COOKIE}
  45. # there are some parameters to the HOST_template function
  46. # 1.) Config.in identifier ADK_PACKAGE_$(1)
  47. # 2.) name of the package, for single package mostly $(PKG_NAME)
  48. # 3.) package version (upstream version) and package release (adk version),
  49. # always $(PKG_VERSION)-$(PKG_RELEASE)
  50. define HOST_template
  51. ALL_PKGOPTS+= $(1)
  52. PKGNAME_$(1)= $(2)
  53. HOSTDIR_$(1)= $(WRKDIR)/fake
  54. ALL_HOSTDIRS+= $${HOSTDIR_$(1)}
  55. ALL_HOSTINST+= $(2)-hostinstall
  56. $$(HOSTDIR_$(1)): ${_HOST_PATCH_COOKIE} ${_HOST_FAKE_COOKIE}
  57. endef
  58. .PHONY: all hostextract hostpatch hostconfigure \
  59. hostbuild hostpackage hostfake hostclean