blob: 7e0980edf2483e8a8a87cac767a7023b53ebd90f [file] [log] [blame]
Brian Silver015b5912014-08-07 15:50:15 -05001################################################################################
2#
3# habanero_xml
4#
5################################################################################
6
7HABANERO_XML_VERSION ?= 7156de2d91ec5195148b7dc941aa4b786e9281d8
8HABANERO_XML_SITE ?= $(call github,open-power,habanero-xml,$(HABANERO_XML_VERSION))
9
10HABANERO_XML_LICENSE = Apache-2.0
11HABANERO_XML_DEPENDENCIES = hostboot-install-images openpower-mrw-install-images common-p8-xml-install-images
12
13HABANERO_XML_INSTALL_IMAGES = YES
14HABANERO_XML_INSTALL_TARGET = NO
15
16MRW_SCRATCH=$(STAGING_DIR)/openpower_mrw_scratch
17MRW_INSTALL_DIRECTORY=$(STAGING_DIR)/preprocessed_mrw
18MRW_HB_TOOLS=$(STAGING_DIR)/hostboot_build_images
19
20HABANERO_XML_ENV_VARS= \
21 SCHEMA_FILE=$(MRW_SCRATCH)/schema/mrw.xsd \
22 PARSER_PATH=$(STAGING_DIR)/usr/bin \
23 XSL_PATH=$(MRW_SCRATCH)/xslt \
24 OUTPUT_PATH=$(MRW_INSTALL_DIRECTORY)
25
26define HABANERO_XML_BUILD_CMDS
27 # copy the habanero xml where the common lives
28 bash -c 'mkdir -p $(MRW_SCRATCH) && cp -r $(@D)/* $(MRW_SCRATCH)'
29 mkdir -p $(MRW_INSTALL_DIRECTORY)
30
31 # run the mrw parsers
32 $(HABANERO_XML_ENV_VARS) bash -c 'cd $(MRW_SCRATCH) && $(MAKE) habanero'
33
34 # generate the system mrm xml
35 $(MRW_HB_TOOLS)/genHwsvMrwXml.pl \
36 --system=$(BR2_OPENPOWER_CONFIG_NAME) \
37 --mrwdir=$(MRW_INSTALL_DIRECTORY) \
38 --build=hb > $(MRW_INSTALL_DIRECTORY)/$(BR2_HABANERO_MRW_XML_FILENAME)
39endef
40
41define HABANERO_XML_INSTALL_IMAGES_CMDS
42
43 # merge in any system specific attributes, hostboot attributes
44 $(MRW_HB_TOOLS)/mergexml.sh $(@D)/$(BR2_HABANERO_SYSTEM_XML_FILENAME) \
45 $(MRW_HB_TOOLS)/attribute_types.xml \
46 $(MRW_HB_TOOLS)/attribute_types_hb.xml \
47 $(MRW_HB_TOOLS)/target_types_merged.xml \
48 $(MRW_HB_TOOLS)/target_types_hb.xml \
49 $(MRW_INSTALL_DIRECTORY)/$(BR2_HABANERO_MRW_XML_FILENAME) > $(MRW_HB_TOOLS)/temporary_hb.hb.xml;
50
51 # creating the targeting binary
52 $(MRW_HB_TOOLS)/xmltohb.pl \
53 --hb-xml-file=$(MRW_HB_TOOLS)/temporary_hb.hb.xml \
54 --fapi-attributes-xml-file=$(MRW_HB_TOOLS)/fapiattrs.xml \
55 --src-output-dir=none \
56 --img-output-dir=$(MRW_HB_TOOLS)/ \
57 --vmm-consts-file=$(MRW_HB_TOOLS)/vmmconst.h --noshort-enums
58
59 mv $(MRW_HB_TOOLS)/targeting.bin $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME)
60endef
61
62$(eval $(generic-package))