Re: Change a target within Makefile?
Dmitry Goncharov <[email protected]> Thu, 25 Jul 2024 20:35:30 -0400
| Newsgroups | gmane.comp.gnu.make.general |
|---|---|
| Message-ID | <CAG+Z0CvuT4jjoHuTVGd5-jVi2HvHoX6RBsHasYpB1NdmmHdZtw@mail.gmail.com> |
On Wed, Jul 24, 2024 at 11:18 PM Masahiro Yamada <[email protected]> wrote: > You could do "make .foo.dtb.check" to compile foo.dtb, followed by > the schema checking. > > I do not want to expose the presence of the timestamp file, > as it is an internal implementation detail If the only requirement is that the timestamp file is not exposed, then why don't we introduce a phony target (similar to all, clean, install, etc)? For example we can call the target 'schema'. In our case we need a piece of code to let the user type $ make schema-hello to build hello.dtb and run a schema check. We can do this with something along the lines of # Prevent make from removing *.checked and *.dtb files. .NOTINTERMEDIATE: .%.dtb.checked %.dtb schema-%: .%.dtb.checked; .%.dtb.checked: %.dtb $(info checking the schema of $*) @touch $@ %.dtb: %.dts cp $< $@ regards, Dmitry