Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. include $(ADK_TOPDIR)/rules.mk
  4. PKG_NAME:= go
  5. PKG_VERSION:= 1.8
  6. PKG_RELEASE:= 1
  7. PKG_HASH:= 406865f587b44be7092f206d73fc1de252600b79b3cacc587b74b5ef5c623596
  8. PKG_DESCR:= go compiler and tools
  9. PKG_SECTION:= dev/lang
  10. HOST_BUILDDEP:= go-bootstrap-host
  11. PKG_URL:= http://www.golang.org
  12. PKG_SITES:= https://storage.googleapis.com/golang/
  13. PKG_ARCH_DEPENDS:= aarch64 arm mips mips64 ppc64 x86 x86_64
  14. PKG_CFLINE_GO:= depends on ADK_HOST_ONLY
  15. DISTFILES:= $(PKG_NAME)$(PKG_VERSION).src.tar.gz
  16. WRKDIST= ${WRKDIR}/go/src
  17. include $(ADK_TOPDIR)/mk/host.mk
  18. include $(ADK_TOPDIR)/mk/package.mk
  19. $(eval $(call HOST_template,GO,go,$(PKG_VERSION)-${PKG_RELEASE}))
  20. HOST_STYLE:= manual
  21. include $(ADK_TOPDIR)/mk/go.mk
  22. ADK_GO_BOOTSTRAP:= $(STAGING_HOST_DIR)/usr/lib/go-bootstrap
  23. ADK_GO_TEMP:= $(WRKBUILD)/go-temp
  24. ADK_GO_HOST_ENV:= GOROOT_BOOTSTRAP="$(ADK_GO_BOOTSTRAP)" \
  25. GOROOT_FINAL="$(ADK_GO_ROOT)" \
  26. GOROOT="$(WRKBUILD)" \
  27. GOBIN="$(WRKBUILD)/bin" \
  28. GOARCH=$(ADK_GO_ARCH) \
  29. GOOS=linux
  30. host-build:
  31. (cd $(WRKBUILD) && \
  32. CGO_ENABLED=0 \
  33. CC_FOR_TARGET=$(HOST_CC) \
  34. CXX_FOR_TARGET=$(HOST_CXX) \
  35. $(ADK_GO_HOST_ENV) ./make.bash)
  36. mkdir -p $(ADK_GO_TEMP)
  37. mv $(WRKBUILD)/../pkg/tool $(ADK_GO_TEMP)
  38. mv $(WRKBUILD)/../bin $(ADK_GO_TEMP)
  39. (cd $(WRKBUILD) && \
  40. CGO_ENABLED=1 \
  41. CC_FOR_TARGET=$(TARGET_CC) \
  42. CXX_FOR_TARGET=$(TARGET_CXX) \
  43. $(ADK_GO_HOST_ENV) ./make.bash)
  44. go-hostinstall:
  45. $(INSTALL_DIR) $(ADK_GO_ROOT)/bin
  46. $(INSTALL_BIN) $(ADK_GO_TEMP)/bin/{go,gofmt} $(ADK_GO_ROOT)/bin
  47. ln -sf ../lib/go/bin/go $(STAGING_HOST_DIR)/usr/bin/
  48. ln -sf ../lib/go/bin/gofmt $(STAGING_HOST_DIR)/usr/bin/
  49. $(CP) $(WRKBUILD)/../lib $(ADK_GO_ROOT)
  50. $(INSTALL_DIR) $(ADK_GO_ROOT)/pkg
  51. $(CP) $(WRKBUILD)/../pkg/include $(ADK_GO_ROOT)/pkg
  52. $(CP) $(WRKBUILD)/../pkg/linux_* $(ADK_GO_ROOT)/pkg
  53. $(CP) $(ADK_GO_TEMP)/tool $(ADK_GO_ROOT)/pkg
  54. $(CP) $(WRKBUILD)/../src $(ADK_GO_ROOT)
  55. include ${ADK_TOPDIR}/mk/host-bottom.mk
  56. include $(ADK_TOPDIR)/mk/pkg-bottom.mk