on 2023/8/16 10:31, Kewen.Lin via Gcc-patches wrote: > Hi, > > As PR111021 shows, the below ${port}-protos.h include tree.h > for code_helper and tree_code: > > arm/arm-protos.h:#include "tree.h" > cris/cris-protos.h:#include "tree.h" (H-P removed this in r14-3218) > microblaze/microblaze-protos.h:#include "tree.h" > rl78/rl78-protos.h:#include "tree.h" > stormy16/stormy16-protos.h:#include "tree.h" > > , when compiling build/gencondmd.cc, the include hierarchy > makes it depend on tm_p.h -> ${port}-protos.h -> tree.h, > which further includes (depends on) some files that are > generated during the building, such as: all-tree.def, > tree-check.h and so on. The previous commit r14-3215 > should already force build/gencondmd.cc to depend on > ${TREE_H}, so the reported build failure should be gone. > > But for a long term maintenance, especially one day some > build/xxx.cc requires tm_p.h but not recog.h, the ${TREE_H} > dependence could be missed and a build failure will show > up. So this patch is to add one variable under section > "# Shorthand variables for dependency lists.", to explicit > indicate tm_p.h which includes ${port}-protos.h should > depend on ${TREE_H}. Then any new build/xxx.cc depending > on tm_p.h will be able to consider ${TREE_H}. > > Note that the existing ${TM_P_H} variable is also used for > "generated_files", it isn't dedicated for dependencies, so > a variable named ${TM_P_H2} is proposed and put under the > "# Shorthand variables for dependency lists.", also the > only use as dependence is updated accordingly.
I did some more checkings and found that not all files in $(generated_files) are **generated**, some of them actually sit in source directory, I misinterpreted it from its name, I think we can just update the existing ${TM_P_H} instead of adding a new variable. I'll post a new patch after some testings, sorry for noise! BR, Kewen