xref: /aosp_15_r20/external/arm-trusted-firmware/docs/resources/diagrams/Makefile (revision 54fd6939e177f8ff529b10183254802c76df6d08)
1*54fd6939SJiyong Park#
2*54fd6939SJiyong Park# Copyright (c) 2015-2019, Arm Limited and Contributors. All rights reserved.
3*54fd6939SJiyong Park#
4*54fd6939SJiyong Park# SPDX-License-Identifier: BSD-3-Clause
5*54fd6939SJiyong Park#
6*54fd6939SJiyong Park#
7*54fd6939SJiyong Park# This Makefile generates the image files used in the Trusted Firmware-A
8*54fd6939SJiyong Park# document from the dia file.
9*54fd6939SJiyong Park#
10*54fd6939SJiyong Park# The PNG files in the present directory have been generated using Dia version
11*54fd6939SJiyong Park# 0.97.2, which can be obtained from https://wiki.gnome.org/Apps/Dia/Download
12*54fd6939SJiyong Park#
13*54fd6939SJiyong Park
14*54fd6939SJiyong Park# generate_image use the tool dia generate png from dia file
15*54fd6939SJiyong Park#    $(1) = layers
16*54fd6939SJiyong Park#    $(2) = image file name
17*54fd6939SJiyong Park#    $(3) = image file format
18*54fd6939SJiyong Park#    $(4) = addition opts
19*54fd6939SJiyong Park#    $(5) = dia source file
20*54fd6939SJiyong Parkdefine generate_image
21*54fd6939SJiyong Park	dia --show-layers=$(1) --filter=$(3) --export=$(2) $(4) $(5)
22*54fd6939SJiyong Parkendef
23*54fd6939SJiyong Park
24*54fd6939SJiyong ParkRESET_DIA							= reset_code_flow.dia
25*54fd6939SJiyong ParkRESET_PNGS							=		\
26*54fd6939SJiyong Park		default_reset_code.png 				\
27*54fd6939SJiyong Park		reset_code_no_cpu_check.png			\
28*54fd6939SJiyong Park		reset_code_no_boot_type_check.png 	\
29*54fd6939SJiyong Park		reset_code_no_checks.png			\
30*54fd6939SJiyong Park
31*54fd6939SJiyong Park# The $(RESET_DIA) file is organized in several layers.
32*54fd6939SJiyong Park# Each image is generated by combining and exporting the appropriate set of
33*54fd6939SJiyong Park# layers.
34*54fd6939SJiyong Parkdefault_reset_code_layers			= "Frontground,Background,cpu_type_check,boot_type_check"
35*54fd6939SJiyong Parkreset_code_no_cpu_check_layers		= "Frontground,Background,no_cpu_type_check,boot_type_check"
36*54fd6939SJiyong Parkreset_code_no_boot_type_check_layers= "Frontground,Background,cpu_type_check,no_boot_type_check"
37*54fd6939SJiyong Parkreset_code_no_checks_layers			= "Frontground,Background,no_cpu_type_check,no_boot_type_check"
38*54fd6939SJiyong Park
39*54fd6939SJiyong Parkdefault_reset_code_opts          	=
40*54fd6939SJiyong Parkreset_code_no_cpu_check_opts     	=
41*54fd6939SJiyong Parkreset_code_no_boot_type_check_opts	=
42*54fd6939SJiyong Parkreset_code_no_checks_opts			=
43*54fd6939SJiyong Park
44*54fd6939SJiyong ParkINT_DIA								= int_handling.dia
45*54fd6939SJiyong ParkINT_PNGS							=		\
46*54fd6939SJiyong Park		sec-int-handling.png				\
47*54fd6939SJiyong Park		non-sec-int-handling.png
48*54fd6939SJiyong Park
49*54fd6939SJiyong Park# The $(INT_DIA) file is organized in several layers.
50*54fd6939SJiyong Park# Each image is generated by combining and exporting the appropriate set of
51*54fd6939SJiyong Park# layers.
52*54fd6939SJiyong Parknon-sec-int-handling_layers			= "non_sec_int_bg,legend,non_sec_int_note,non_sec_int_handling"
53*54fd6939SJiyong Parksec-int-handling_layers				= "sec_int_bg,legend,sec_int_note,sec_int_handling"
54*54fd6939SJiyong Park
55*54fd6939SJiyong Parknon-sec-int-handling_opts			= --size=1692x
56*54fd6939SJiyong Parksec-int-handling_opts				= --size=1570x
57*54fd6939SJiyong Park
58*54fd6939SJiyong ParkXLAT_DIA 							= xlat_align.dia
59*54fd6939SJiyong ParkXLAT_PNG 							= xlat_align.png
60*54fd6939SJiyong Park
61*54fd6939SJiyong Parkxlat_align_layers					= "bg,translations"
62*54fd6939SJiyong Parkxlat_align_opts						=
63*54fd6939SJiyong Park
64*54fd6939SJiyong Parkall:$(RESET_PNGS) $(INT_PNGS) $(XLAT_PNG)
65*54fd6939SJiyong Park
66*54fd6939SJiyong Park$(RESET_PNGS):$(RESET_DIA)
67*54fd6939SJiyong Park	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)
68*54fd6939SJiyong Park
69*54fd6939SJiyong Park$(INT_PNGS):$(INT_DIA)
70*54fd6939SJiyong Park	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)
71*54fd6939SJiyong Park
72*54fd6939SJiyong Park$(XLAT_PNG):$(XLAT_DIA)
73*54fd6939SJiyong Park	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$(patsubst %.png,%.svg,$@),svg,$($(patsubst %.png,%_opts,$@)),$<)
74*54fd6939SJiyong Park	inkscape -z $(patsubst %.png,%.svg,$@) -e $@ -d 45
75