xref: /rk3399_ARM-atf/docs/resources/diagrams/Makefile (revision bd97f83a62382633468034db1e81381c5990b62a)
1a2c320a8SPaul Beesley#
2*bd97f83aSJohn Tsichritzis# Copyright (c) 2015-2019, Arm Limited and Contributors. All rights reserved.
3a2c320a8SPaul Beesley#
4a2c320a8SPaul Beesley# SPDX-License-Identifier: BSD-3-Clause
5a2c320a8SPaul Beesley#
6a2c320a8SPaul Beesley#
7*bd97f83aSJohn Tsichritzis# This Makefile generates the image files used in the Trusted Firmware-A
8a2c320a8SPaul Beesley# document from the dia file.
9a2c320a8SPaul Beesley#
10a2c320a8SPaul Beesley# The PNG files in the present directory have been generated using Dia version
11a2c320a8SPaul Beesley# 0.97.2, which can be obtained from https://wiki.gnome.org/Apps/Dia/Download
12a2c320a8SPaul Beesley#
13a2c320a8SPaul Beesley
14a2c320a8SPaul Beesley# generate_image use the tool dia generate png from dia file
15a2c320a8SPaul Beesley#    $(1) = layers
16a2c320a8SPaul Beesley#    $(2) = image file name
17a2c320a8SPaul Beesley#    $(3) = image file format
18a2c320a8SPaul Beesley#    $(4) = addition opts
19a2c320a8SPaul Beesley#    $(5) = dia source file
20a2c320a8SPaul Beesleydefine generate_image
21a2c320a8SPaul Beesley	dia --show-layers=$(1) --filter=$(3) --export=$(2) $(4) $(5)
22a2c320a8SPaul Beesleyendef
23a2c320a8SPaul Beesley
24a2c320a8SPaul BeesleyRESET_DIA							= reset_code_flow.dia
25a2c320a8SPaul BeesleyRESET_PNGS							=		\
26a2c320a8SPaul Beesley		default_reset_code.png 				\
27a2c320a8SPaul Beesley		reset_code_no_cpu_check.png			\
28a2c320a8SPaul Beesley		reset_code_no_boot_type_check.png 	\
29a2c320a8SPaul Beesley		reset_code_no_checks.png			\
30a2c320a8SPaul Beesley
31a2c320a8SPaul Beesley# The $(RESET_DIA) file is organized in several layers.
32a2c320a8SPaul Beesley# Each image is generated by combining and exporting the appropriate set of
33a2c320a8SPaul Beesley# layers.
34a2c320a8SPaul Beesleydefault_reset_code_layers			= "Frontground,Background,cpu_type_check,boot_type_check"
35a2c320a8SPaul Beesleyreset_code_no_cpu_check_layers		= "Frontground,Background,no_cpu_type_check,boot_type_check"
36a2c320a8SPaul Beesleyreset_code_no_boot_type_check_layers= "Frontground,Background,cpu_type_check,no_boot_type_check"
37a2c320a8SPaul Beesleyreset_code_no_checks_layers			= "Frontground,Background,no_cpu_type_check,no_boot_type_check"
38a2c320a8SPaul Beesley
39a2c320a8SPaul Beesleydefault_reset_code_opts          	=
40a2c320a8SPaul Beesleyreset_code_no_cpu_check_opts     	=
41a2c320a8SPaul Beesleyreset_code_no_boot_type_check_opts	=
42a2c320a8SPaul Beesleyreset_code_no_checks_opts			=
43a2c320a8SPaul Beesley
44a2c320a8SPaul BeesleyINT_DIA								= int_handling.dia
45a2c320a8SPaul BeesleyINT_PNGS							=		\
46a2c320a8SPaul Beesley		sec-int-handling.png				\
47a2c320a8SPaul Beesley		non-sec-int-handling.png
48a2c320a8SPaul Beesley
49a2c320a8SPaul Beesley# The $(INT_DIA) file is organized in several layers.
50a2c320a8SPaul Beesley# Each image is generated by combining and exporting the appropriate set of
51a2c320a8SPaul Beesley# layers.
52a2c320a8SPaul Beesleynon-sec-int-handling_layers			= "non_sec_int_bg,legend,non_sec_int_note,non_sec_int_handling"
53a2c320a8SPaul Beesleysec-int-handling_layers				= "sec_int_bg,legend,sec_int_note,sec_int_handling"
54a2c320a8SPaul Beesley
55a2c320a8SPaul Beesleynon-sec-int-handling_opts			= --size=1692x
56a2c320a8SPaul Beesleysec-int-handling_opts				= --size=1570x
57a2c320a8SPaul Beesley
58a2c320a8SPaul BeesleyXLAT_DIA 							= xlat_align.dia
59a2c320a8SPaul BeesleyXLAT_PNG 							= xlat_align.png
60a2c320a8SPaul Beesley
61a2c320a8SPaul Beesleyxlat_align_layers					= "bg,translations"
62a2c320a8SPaul Beesleyxlat_align_opts						=
63a2c320a8SPaul Beesley
64a2c320a8SPaul Beesleyall:$(RESET_PNGS) $(INT_PNGS) $(XLAT_PNG)
65a2c320a8SPaul Beesley
66a2c320a8SPaul Beesley$(RESET_PNGS):$(RESET_DIA)
67a2c320a8SPaul Beesley	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)
68a2c320a8SPaul Beesley
69a2c320a8SPaul Beesley$(INT_PNGS):$(INT_DIA)
70a2c320a8SPaul Beesley	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$@,png,$($(patsubst %.png,%_opts,$@)),$<)
71a2c320a8SPaul Beesley
72a2c320a8SPaul Beesley$(XLAT_PNG):$(XLAT_DIA)
73a2c320a8SPaul Beesley	$(call generate_image,$($(patsubst %.png,%_layers,$@)),$(patsubst %.png,%.svg,$@),svg,$($(patsubst %.png,%_opts,$@)),$<)
74a2c320a8SPaul Beesley	inkscape -z $(patsubst %.png,%.svg,$@) -e $@ -d 45
75