On Fri, Mar 31, 2017 at 09:46:19AM -0600, Stephen Warren wrote: > On 03/31/2017 09:01 AM, Nikolaus Schulz wrote: > > Creating the emmc image requires creating the bct file and the > > bootloader image first. These dependencies are written to a makefile > > snippet that is created by the gen-image-deps.sh script. But that > > script is only invoked when the rule that creates the emmc image is run, > > which is too late for creating the dependencies makefile. > > > > Add a rule to post.mk that tells make how to create the dependencies > > makefile; with that in place, make automatically makes the dependency > > makefile before executing any other rules. > > I don't think this change is correct, or at least necessary. > > The concept here is that: > > - If an output file does not exist at all, it will be built for the first > time, and a dependency file will be generated for the next time. > > - If an output file does exist, the related dependency file is also expected > to exist, and specify the dependencies, so that if they change, a rebuild > will occur. > > In particular, the dependency file is/should-no-be necessary in the case > where an output file is to be generated for the first time. > > If a known dependency specification is missing, we should specify it > directly in the makefile itself. The generated dependency files are intended > to represent unknown/unknowable dependencies. > > Is it possible to fix this problem that way instead? Well, the dependencies in question are hard dependencies: creating the emmc image has the bct file and the bootloader image as prerequisites. I just noticed though that specifying the dependency on the bct file need not use gen-image-deps.sh at all, since the bct filename is already known to make. I'll send an alternate, trivial patch. Note that the dependency on the bootloader image can be added to the makefiles in a similar way by simply adding a variable for the filename to the per-soc Makefiles and make that a prerequisite of the emmc image. With that there is no need for a dynamically generated dependency file at all, at the slight expense of some (more) duplication of filenames. I'll send a separate patch doing that as an RFC. Regards, Nikolaus -- Avionic Design GmbH Nikolaus Schulz Wragekamp 10 D-22397 Hamburg Germany Tel.: +49 40 88187-163 Fax: +49 40 88187-150 Email: nikolaus.schulz@xxxxxxxxxxxxxxxxx Avionic Design GmbH Amtsgericht Hamburg HRB 82598 Geschäftsführung: Cornelis Broers Ust.-Ident-Nr.: DE813378254 -- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html