blob: 61bce5b41bc0e40a5f22cedd084db5fd7cb892c1 [file] [log] [blame]
Brian Silvercb565552014-12-11 12:51:36 -06001################################################################################
2#
Stewart Smith03671c02017-02-17 14:57:57 +11003# occ for POWER9
Brian Silvercb565552014-12-11 12:51:36 -06004#
5################################################################################
6
Stewart Smith2f718e42018-05-02 01:47:29 -05007OCC_VERSION = $(call qstrip,$(BR2_OCC_VERSION))
8OCC_SITE = $(call github,open-power,occ,$(OCC_VERSION))
Matt Ploetzeaf71dc2016-09-01 18:28:19 -05009
Brian Silvercb565552014-12-11 12:51:36 -060010OCC_LICENSE = Apache-2.0
William Bryan849c6692017-03-24 14:44:06 -050011
Stewart Smith03671c02017-02-17 14:57:57 +110012OCC_LICENSE_FILES = LICENSE
Brian Silvercb565552014-12-11 12:51:36 -060013
14OCC_INSTALL_IMAGES = YES
15OCC_INSTALL_TARGET = NO
16
17OCC_STAGING_DIR = $(STAGING_DIR)/occ
18
Stewart Smith03671c02017-02-17 14:57:57 +110019OCC_IMAGE_BIN_PATH = obj/image.bin
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050020
Klaus Heinrich Kiwi3e6e8352020-04-14 16:06:01 -030021OCC_DEPENDENCIES = host-ppe42-gcc
Stewart Smith6af76632018-04-27 06:45:42 +100022ifeq ($(BR2_OCC_GPU_BIN_BUILD),y)
Stewart Smith03671c02017-02-17 14:57:57 +110023 OCC_DEPENDENCIES += hostboot-binaries
Stewart Smith6af76632018-04-27 06:45:42 +100024endif
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050025
Klaus Heinrich Kiwi3e6e8352020-04-14 16:06:01 -030026ifeq ($(BR2_OCC_USE_ALTERNATE_GCC),y)
27OCC_TARGET_CROSS = $(HOST_DIR)/alternate-toolchain/bin/$(GNU_TARGET_NAME)-
28OCC_DEPENDENCIES += host-alternate-gcc
29else
30OCC_TARGET_CROSS = $(TARGET_CROSS)
31OCC_DEPENDENCIES += host-binutils
32endif
33
Stewart Smith03671c02017-02-17 14:57:57 +110034define OCC_BUILD_CMDS
Bill Hoffafbd4fbf2017-10-10 20:41:22 -050035 if [ "$(BR2_OCC_GPU_BIN_BUILD)" == "y" ]; then \
Bill Hoffa11a23f22017-10-03 07:58:12 -050036 cd $(@D)/src && \
Klaus Heinrich Kiwi3e6e8352020-04-14 16:06:01 -030037 make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(OCC_TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib GPE1_BIN_IMAGE_PATH=$(STAGING_DIR)/hostboot_binaries/ OPOCC_GPU_SUPPORT=1 all; \
Bill Hoffa11a23f22017-10-03 07:58:12 -050038 else \
39 cd $(@D)/src && \
Klaus Heinrich Kiwi3e6e8352020-04-14 16:06:01 -030040 make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(OCC_TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib all; \
Bill Hoffa11a23f22017-10-03 07:58:12 -050041 fi;
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050042endef
Stewart Smith03671c02017-02-17 14:57:57 +110043OCC_BUILD_CMDS ?= $(OCC_BUILD_CMDS_P9)
Brian Silvercb565552014-12-11 12:51:36 -060044
45define OCC_INSTALL_IMAGES_CMDS
46 mkdir -p $(STAGING_DIR)/occ
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050047 cp $(@D)/$(OCC_IMAGE_BIN_PATH) $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME)
Brian Silvercb565552014-12-11 12:51:36 -060048endef
49
50$(eval $(generic-package))