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