host.mk 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_CONFIGURE_ENV+= AUTOM4TE=${STAGING_HOST_DIR}/usr/bin/autom4te \
  8. CONFIG_SHELL='$(strip ${SHELL})' \
  9. PKG_CONFIG_LIBDIR='${STAGING_HOST_DIR}/usr/lib/pkgconfig' \
  10. PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
  11. PATH='${HOST_PATH}' \
  12. CC='$(strip ${CC_FOR_BUILD})' \
  13. CFLAGS='$(strip ${CFLAGS_FOR_BUILD})' \
  14. CXXFLAGS='$(strip ${CXXFLAGS_FOR_BUILD})' \
  15. CPPFLAGS='$(strip ${CPPFLAGS_FOR_BUILD})' \
  16. LDFLAGS='$(strip ${LDFLAGS_FOR_BUILD})'
  17. # this is environment for 'make all' and 'make install'
  18. HOST_MAKE_ENV?=
  19. # this is arguments for 'make all' and 'make install'
  20. HOST_XAKE_FLAGS?=
  21. # this is arguments for 'make all' ONLY
  22. HOST_MAKE_FLAGS?=
  23. # this is arguments for 'make install' ONLY
  24. HOST_FAKE_FLAGS?=
  25. HOST_ALL_TARGET?= all
  26. HOST_INSTALL_TARGET?= install
  27. HOST_MAKE_ENV+= PATH='${HOST_PATH}' \
  28. PKG_CONFIG_LIBDIR='${STAGING_HOST_DIR}/usr/lib/pkgconfig' \
  29. PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
  30. CC='$(strip ${CC_FOR_BUILD})' \
  31. CFLAGS='$(strip ${CFLAGS_FOR_BUILD})' \
  32. CXXFLAGS='$(strip ${CXXFLAGS_FOR_BUILD})' \
  33. CPPFLAGS='$(strip ${CPPFLAGS_FOR_BUILD})' \
  34. LDFLAGS='$(strip ${LDFLAGS_FOR_BUILD})'
  35. HOST_MAKE_FLAGS+= ${HOST_XAKE_FLAGS} V=1
  36. HOST_FAKE_FLAGS+= ${HOST_XAKE_FLAGS}
  37. HOST_WRKINST= ${WRKDIR}/fake
  38. _HOST_EXTRACT_COOKIE= ${WRKDIST}/.extract_done
  39. _HOST_PATCH_COOKIE= ${WRKDIST}/.prepared
  40. _HOST_CONFIGURE_COOKIE= ${WRKDIR}/.host_configure_done
  41. _HOST_BUILD_COOKIE= ${WRKDIR}/.host_build_done
  42. _HOST_FAKE_COOKIE= ${HOST_WRKINST}/.host_fake_done
  43. _HOST_COOKIE= ${STAGING_PKG_DIR}/stamps/${PKG_NAME}${PKG_VERSION}-${PKG_RELEASE}-host
  44. hostextract: ${_HOST_EXTRACT_COOKIE}
  45. hostpatch: ${_HOST_PATCH_COOKIE}
  46. hostconfigure: ${_HOST_CONFIGURE_COOKIE}
  47. hostbuild: ${_HOST_BUILD_COOKIE}
  48. hostfake: ${_HOST_FAKE_COOKIE}
  49. # there are some parameters to the HOST_template function
  50. # 1.) Config.in identifier ADK_PACKAGE_$(1)
  51. # 2.) name of the package, for single package mostly $(PKG_NAME)
  52. # 3.) package version (upstream version) and package release (adk version),
  53. # always $(PKG_VERSION)-$(PKG_RELEASE)
  54. define HOST_template
  55. ALL_PKGOPTS+= $(1)
  56. PKGNAME_$(1)= $(2)
  57. HOSTDIR_$(1)= $(WRKDIR)/fake
  58. ALL_HOSTDIRS+= $${HOSTDIR_$(1)}
  59. ALL_HOSTINST+= $(2)-hostinstall
  60. $$(HOSTDIR_$(1)): ${_HOST_PATCH_COOKIE} ${_HOST_FAKE_COOKIE}
  61. endef
  62. .PHONY: all hostextract hostpatch hostconfigure \
  63. hostbuild hostpackage hostfake hostclean