• Masahiro Yamada's avatar
    Build: generate .d file at the same time as object is created · 710ea1d0
    Masahiro Yamada authored
    
    
    Currently, .d files are generated before any objects are built.
    So, IS_ANYTHING_TO_BUILD flag is needed to avoid such processing for
    non-build targets.
    
    There is a cleverer way; just create a .d file simultaneously when
    the corresponding object is created.  No need to have separate rules
    for .d files.
    
    This commit will also fix a bug; -D$(IMAGE) is defined for $(OBJ),
    but not for $(PREREQUISITES).  So, .d files are generated with
    different macro sets from those for .o files, then wrong .d files
    are generated.
    
    For example, in lib/cpus/aarch64/cpu_helpers.S
    
      #if IMAGE_BL31
      #include <cpu_data.h>
      #endif
    
    <cpu_data.h> is parsed for the object when built for BL31, but the
    .d file does not pick up that dependency.
    
    With this commit, the compiler will generate .o and .d at the same
    time, guaranteeing they are generated under the same circumstances.
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    710ea1d0
build_macros.mk 12.4 KB