1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/usr/targeting/xmltohb/makefile $
#
# IBM CONFIDENTIAL
#
# COPYRIGHT International Business Machines Corp. 2011,2013
#
# p1
#
# Object Code Only (OCO) source materials
# Licensed Internal Code Source Materials
# IBM HostBoot Licensed Internal Code
#
# The source code for this program is not published or otherwise
# divested of its trade secrets, irrespective of what has been
# deposited with the U.S. Copyright Office.
#
# Origin: 30
#
# IBM_PROLOG_END_TAG
################################################################################
#
# @file targeting/xmltohb/makefile
#
# @brief Makefile for building Hostboot's xmltohb dir
#
################################################################################
ROOTPATH = ../../../..
# Point to the common targeting makefile for xmltohb
COMMON_XMLTOHB_DIR = xmltohb
COMMON_TARGETING_PATH_PREFIX = ../common
COMMON_TARGETING_REL_PATH = \
${COMMON_TARGETING_PATH_PREFIX}/${COMMON_XMLTOHB_DIR}
COMMON_TARGETING_MAKEFILE = \
${COMMON_TARGETING_REL_PATH}/common.mk
# Include the common targeting makefile for xmltohb verbatim
include ${COMMON_TARGETING_MAKEFILE}
VPATH = ${COMMON_TARGETING_REL_PATH}
FAPI_ATTR_SOURCE_DIR = ${ROOTPATH}/src/usr/hwpf/hwp
XMLTOHB_FAPIATTR_SOURCES = \
${addprefix ${FAPI_ATTR_SOURCE_DIR}/, ${FAPI_ATTR_SOURCES}}
XMLTOHB_COMMON_ATTRIBUTE_SOURCES = attribute_types.xml
XMLTOHB_COMMON_TARGET_SOURCES = target_types.xml
XMLTOHB_HB_ATTRIBUTE_SOURCES = attribute_types_hb.xml
XMLTOHB_HB_TARGET_SOURCES = target_types_hb.xml
XMLTOHB_MERGED_COMMON_TARGET_SOURCES = target_types_merged.xml
#Redefine XMLTOHB_GENERIC_SOURCES
XMLTOHB_GENERIC_SOURCES = \
${XMLTOHB_COMMON_ATTRIBUTE_SOURCES} \
${XMLTOHB_HB_ATTRIBUTE_SOURCES} \
${GENDIR}/${XMLTOHB_MERGED_COMMON_TARGET_SOURCES} \
${XMLTOHB_HB_TARGET_SOURCES}
#XML target types merge script
XMLTOHB_TARGET_MERGE_SCRIPT = updatetargetxml.pl
VMM_CONSTS_FILE = \
${ROOTPATH}/src/include/usr/vmmconst.h
GENFILES = ${XMLTOHB_TARGETS}
#debug :
# @echo COMMON_TARGETING_PATH_PREFIX = ${COMMON_TARGETING_PATH_PREFIX}
# @echo COMMON_TARGETING_REL_PATH = ${COMMON_TARGETING_REL_PATH}
# @echo COMMON_TARGETING_MAKEFILE = ${COMMON_TARGETING_MAKEFILE}
# @echo XMLTOHB_HEADER_TARGETS = ${XMLTOHB_HEADER_TARGETS}
# @echo XMLTOHB_SOURCE_TARGETS = ${XMLTOHB_SOURCE_TARGETS}
# @echo XMLTOHB_SYSTEM_BINARIES = ${XMLTOHB_SYSTEM_BINARIES}
# @echo XMLTOHB_TARGETS = ${XMLTOHB_TARGETS}
# @echo XMLTOHB_GENERIC_SOURCES = ${XMLTOHB_GENERIC_SOURCES}
# @echo FAPI_ATTR_SOURCES = ${FAPI_ATTR_SOURCES}
# @echo FAPI_ATTR_SOURCE_DIR = ${FAPI_ATTR_SOURCE_DIR}
# @echo XMLTOHB_FAPIATTR_SOURCES = ${XMLTOHB_FAPIATTR_SOURCES}
# @echo XMLTOHB_COMMON_ATTRIBUTE_SOURCES = ${XMLTOHB_COMMON_ATTRIBUTE_SOURCES}
# @echo XMLTOHB_COMMON_TARGET_SOURCES = ${XMLTOHB_COMMON_TARGET_SOURCES}
# @echo XMLTOHB_HB_ATTRIBUTE_SOURCES = ${XMLTOHB_HB_ATTRIBUTE_SOURCES}
# @echo XMLTOHB_HB_TARGET_SOURCES = ${XMLTOHB_HB_TARGET_SOURCES}
# @echo XMLTOHB_MERGED_COMMON_TARGET_SOURCES = ${XMLTOHB_MERGED_COMMON_TARGET_SOURCES}
# @echo VPATH = ${VPATH}
EXTRA_PARTS = $(addprefix $(IMGDIR)/, $(XMLTOHB_SYSTEM_BINARIES))
CLEAN_TARGETS += $(addprefix $(GENDIR)/, ${XMLTOHB_SYSTEM_BINARIES}) \
$(addprefix $(GENDIR)/, ${XMLTOHB_SYSTEM_BINARIES:.bin=.xml}) \
${GENDIR}/${XMLTOHB_GENERIC_XML} ${GENDIR}/${XMLTOHB_FAPI_XML} \
${GENDIR}/${XMLTOHB_MERGED_COMMON_TARGET_SOURCES} \
${GENDIR}/errl/errludattribute.H \
${GENDIR}/errl/errludtarget.H
GENDIR_ERRL = $(ROOTPATH)/obj/genfiles/errl
.PHONY: make_gendir_errl
make_gendir_errl:
@mkdir -p $(GENDIR_ERRL)
GEN_PASS_PRE += make_gendir_errl
include ${ROOTPATH}/config.mk
# Delete any generated file on error
.DELETE_ON_ERROR:
${EXTRA_PARTS}: ${IMGDIR}/% : ${GENDIR}/%
cp -f $^ $@
# create merged target xml
${GENDIR}/${XMLTOHB_MERGED_COMMON_TARGET_SOURCES}: \
${XMLTOHB_TARGET_MERGE_SCRIPT} ${XMLTOHB_COMMON_TARGET_SOURCES} ${XMLTOHB_HB_TARGET_SOURCES}
./${XMLTOHB_TARGET_MERGE_SCRIPT} $(addprefix --hb=,${COMMON_TARGETING_REL_PATH}/${XMLTOHB_HB_TARGET_SOURCES}) \
$(addprefix --common=,${COMMON_TARGETING_REL_PATH}/${XMLTOHB_COMMON_TARGET_SOURCES}) > $@
# generic XML is created from the generic sources only
${GENDIR}/${XMLTOHB_GENERIC_XML}: \
${XMLTOHB_MERGE_SCRIPT} ${XMLTOHB_GENERIC_SOURCES}
$< $^ > $@
# merge all FAPI attribute files into one
${GENDIR}/${XMLTOHB_FAPI_XML}: ${XMLTOHB_MERGE_SCRIPT} \
${XMLTOHB_FAPIATTR_SOURCES}
$< $^ > $@
# create the header files, only needs generic xml
$(call GENTARGET,$(XMLTOHB_TARGETS)) : call_xmltohb_compiler
.PHONY: call_xmltohb_compiler
call_xmltohb_compiler: ${XMLTOHB_COMPILER_SCRIPT} \
${GENDIR}/${XMLTOHB_GENERIC_XML} ${GENDIR}/${XMLTOHB_FAPI_XML}
$< $(addprefix --hb-xml-file=,${GENDIR}/${XMLTOHB_GENERIC_XML}) \
$(addprefix --fapi-attributes-xml-file=,${GENDIR}/${XMLTOHB_FAPI_XML}) \
--src-output-dir=$(GENDIR) --img-output-dir=none \
--img-output-file=none
cp ${GENDIR_ERRL}/errludattribute.H ${GENDIR_PLUGINS}
cp ${GENDIR_ERRL}/errludtarget.H ${GENDIR_PLUGINS}
# system-specific XML needs the generic plus the xxx.system.xml file + the
# MRW file
${GENDIR}/%.hb.xml: %.system.xml ${XMLTOHB_GENERIC_SOURCES} %.mrw.xml
${COMMON_TARGETING_REL_PATH}/${XMLTOHB_MERGE_SCRIPT} $^ > $@
# create the binary files
${GENDIR}/%_targeting.bin: ${XMLTOHB_COMPILER_SCRIPT} ${GENDIR}/%.hb.xml \
${GENDIR}/${XMLTOHB_FAPI_XML} ${VMM_CONSTS_FILE}
$< $(addprefix --hb-xml-file=,${GENDIR}/$*.hb.xml) \
$(addprefix --fapi-attributes-xml-file=,${GENDIR}/${XMLTOHB_FAPI_XML}) \
--src-output-dir=none --img-output-dir=$(dir $@) \
--img-output-file=$(notdir $@) \
--vmm-consts-file=$(VMM_CONSTS_FILE) --noshort-enums
|