10
10
11
11
SCRIPT_DIR = os .path .dirname (os .path .abspath (__file__ ))
12
12
TEMPLATES_DIR = path_join (SCRIPT_DIR , 'templates' )
13
+ MANIFEST_TEMPLATES = filter (
14
+ lambda filename : '_NAME_' in filename ,
15
+ glob .glob (path_join (TEMPLATES_DIR , '*.tpl' ))
16
+ )
17
+ COMMON_TEMPLATES = filter (
18
+ lambda filename : '_NAME_' not in filename ,
19
+ glob .glob (path_join (TEMPLATES_DIR , '*.tpl' ))
20
+ )
13
21
14
22
15
23
def assert_int (num ):
@@ -611,11 +619,6 @@ def generate_partitions_sources(manifest_files, extra_filters=None):
611
619
:return: List of paths to the generated files
612
620
"""
613
621
614
- partition_template_files = filter (
615
- lambda filename : '_NAME_' in filename ,
616
- glob .glob (path_join (TEMPLATES_DIR , '*.tpl' ))
617
- )
618
-
619
622
# Construct a list of all the manifests and sfids.
620
623
manifests = []
621
624
for manifest_file in manifest_files :
@@ -628,13 +631,13 @@ def generate_partitions_sources(manifest_files, extra_filters=None):
628
631
generated_folders = []
629
632
for manifest in manifests :
630
633
manifest_output_folder = manifest .autogen_folder
631
- if not manifest .is_up_to_date (partition_template_files ):
634
+ if not manifest .is_up_to_date (MANIFEST_TEMPLATES ):
632
635
render_args = {
633
636
'partition' : manifest ,
634
637
'dependent_partitions' : manifest .find_dependencies (manifests )
635
638
}
636
639
manifest_output_folder = generate_source_files (
637
- manifest .templates_to_files (partition_template_files ,
640
+ manifest .templates_to_files (MANIFEST_TEMPLATES ,
638
641
manifest_output_folder ),
639
642
render_args ,
640
643
manifest_output_folder ,
@@ -656,27 +659,32 @@ def generate_spm_data(manifest_files, output_dir, extra_filters=None):
656
659
:return: List of paths to the generated files
657
660
"""
658
661
autogen_folder = path_join (output_dir , 'psa_autogen' )
659
- template_files = filter (
660
- lambda filename : '_NAME_' not in filename ,
661
- glob .glob (path_join (TEMPLATES_DIR , '*.tpl' ))
662
- )
663
-
664
662
templates_dict = {
665
663
t : path_join (autogen_folder , os .path .basename (os .path .splitext (t )[0 ]))
666
- for t in template_files
664
+ for t in COMMON_TEMPLATES
667
665
}
668
666
669
- if is_up_to_date (manifest_files , template_files , templates_dict .values ()):
670
- return autogen_folder
667
+ complete_source_list = templates_dict .values ()
671
668
672
669
# Construct lists of all the manifests and mmio_regions.
673
670
region_list = []
674
671
manifests = []
675
672
for manifest_file in manifest_files :
676
- manifest_obj = Manifest .from_json (manifest_file , skip_src = True )
673
+ manifest_obj = Manifest .from_json (manifest_file )
674
+ manifests .append (manifest_obj )
677
675
for region in manifest_obj .mmio_regions :
678
676
region_list .append (region )
679
- manifests .append (manifest_obj )
677
+ complete_source_list .extend (
678
+ manifest_obj .templates_to_files (
679
+ MANIFEST_TEMPLATES ,
680
+ manifest_obj .autogen_folder ).values ()
681
+ )
682
+
683
+ if is_up_to_date (
684
+ manifest_files ,
685
+ MANIFEST_TEMPLATES + COMMON_TEMPLATES ,
686
+ complete_source_list ):
687
+ return autogen_folder
680
688
681
689
render_args = {
682
690
'partitions' : manifests ,
0 commit comments