For my project, I automatically generate makefiles and including them, for example:
all: @echo 'SUCCESS is $(SUCCESS)' clean: rm depend.mk depend.mk: @echo 'Creating $@ ' @echo 'SUCCESS := 1' > $@ .PHONY: all clean include depend.mk
This works, but the include line generates a warning message:
$ make Makefile:13: depend.mk: No such file or directory Creating depend.mk SUCCESS is 1
I would like to disable this first warning line, which says that depend.mk does not exist. I know that this does not exist, because I have a rule written to create it, so a warning is not needed (unless, of course, there is no rule for it). I DO NOT want make to ignore the error when the included file does not exist and there is no rule for it, so the include prefix with - to ignore the error will not work for me. I would like something similar to the bash convention for the stderr pipeline to / dev / null, for example some_cmd 2>/dev/null , but for inclusion in make.
The sample above is a very simplified example of this case. In my actual project, there are a lot of automatically generated makefiles (using the automatic clang dependency generation), which means that a new run of make will lead to the flow of my screen with these warning messages.
Is this possible, or will I just have to deal with annoying warning messages?
makefile gnu-make
C0deH4cker
source share