Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # occ |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
hostboot | 423de91 | 2017-03-14 00:07:34 -0500 | [diff] [blame] | 7 | OCC_VERSION_BRANCH_MASTER_P8 ?= 301b535a933e0c9c41b0f014677004cc8da2c445 |
Elizabeth Liner | c093c80 | 2017-03-23 13:44:08 -0500 | [diff] [blame] | 8 | OCC_VERSION_BRANCH_MASTER ?= 4141b5f5fef2ba4b444aabbda1677e7f583cd4e8 |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 9 | |
| 10 | OCC_VERSION ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_VERSION_BRANCH_MASTER),$(OCC_VERSION_BRANCH_MASTER_P8)) |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 11 | OCC_SITE ?= $(call github,open-power,occ,$(OCC_VERSION)) |
| 12 | OCC_LICENSE = Apache-2.0 |
William Bryan | 849c669 | 2017-03-24 14:44:06 -0500 | [diff] [blame^] | 13 | |
| 14 | OCC_LICENSE_FILES_P8 = src/LICENSE |
| 15 | OCC_LICENSE_FILES_P9 = LICENSE |
| 16 | OCC_LICENSE_FILES ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_LICENSE_FILES_P9),$(OCC_LICENSE_FILES_P8)) |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 17 | |
| 18 | OCC_INSTALL_IMAGES = YES |
| 19 | OCC_INSTALL_TARGET = NO |
| 20 | |
| 21 | OCC_STAGING_DIR = $(STAGING_DIR)/occ |
| 22 | |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 23 | OCC_IMAGE_BIN_PATH = $(if $(BR2_OPENPOWER_POWER9),obj/image.bin,src/image.bin) |
| 24 | |
| 25 | OCC_DEPENDENCIES_P8 = host-binutils host-p8-pore-binutils |
| 26 | OCC_DEPENDENCIES_P9 = host-binutils host-ppe42-gcc |
| 27 | OCC_DEPENDENCIES ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_DEPENDENCIES_P9),$(OCC_DEPENDENCIES_P8)) |
| 28 | |
| 29 | define OCC_APPLY_PATCHES |
| 30 | if [ "$(BR2_OPENPOWER_POWER9)" == "y" ]; then \ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 31 | $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/package/occ/p9Patches \*.patch; \ |
| 32 | if [ -d $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p9Patches ]; then \ |
| 33 | $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p9Patches \*.patch; \ |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 34 | fi; \ |
| 35 | fi; \ |
| 36 | if [ "$(BR2_OPENPOWER_POWER8)" == "y" ]; then \ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 37 | $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/package/occ/p8Patches \*.patch; \ |
| 38 | if [ -d $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p8Patches ]; then \ |
| 39 | $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p8Patches \*.patch; \ |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 40 | fi; \ |
| 41 | fi; |
| 42 | endef |
| 43 | |
| 44 | OCC_POST_PATCH_HOOKS += OCC_APPLY_PATCHES |
| 45 | |
| 46 | define OCC_BUILD_CMDS_P8 |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 47 | cd $(@D)/src && \ |
| 48 | make POREPATH=$(P8_PORE_BINUTILS_BIN)/bin/ OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) all && \ |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 49 | make tracehash && \ |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 50 | make combineImage |
| 51 | endef |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 52 | define OCC_BUILD_CMDS_P9 |
| 53 | cd $(@D)/src && \ |
| 54 | make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib all |
| 55 | endef |
| 56 | OCC_BUILD_CMDS ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_BUILD_CMDS_P9),$(OCC_BUILD_CMDS_P8)) |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 57 | |
| 58 | define OCC_INSTALL_IMAGES_CMDS |
| 59 | mkdir -p $(STAGING_DIR)/occ |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 60 | cp $(@D)/$(OCC_IMAGE_BIN_PATH) $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 61 | endef |
| 62 | |
| 63 | $(eval $(generic-package)) |