I am trying to add a patch so that a software can compile and run correctly, unfortunately in order to add the change I am trying I always run into an annoying code style check error. Is there any way to skip this step?
If the makefile looks like this:
code-style-check: source.c tool-you-dont-have myprogram: code-style-check source.c compile source.c -o myprogram
then you can avoid running
tool-you-dont-have by creating a file called
Make will see that
code-style-check is newer than
source.c and won't try to rebuild it.
This doesn't work if
code-style-check is a phony target declared with
.PHONY: code-style-check: phony targets aren't file names.
Note that if
code-style-check has dependencies, they won't count anymore for the sake of deciding whether to rebuild
myprogram. It doesn't matter in the example above because
code-style-check doesn't have any dependencies that
myprogram doesn't have.
An alternative solution with GNU make that works even for a phony target is to run
make -o code-style-check …
-o tells make to consider
code-style-check to be older than anything that's already there (unlike the
touch approach which makes the file newer than anything that's already there), and also not to try to rebuild it. Once again, if dependencies of
code-style-check were also needed for
myprogram, they won't be built.