help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:


From: Kaz Kylheku (gmake)
Subject: Re:
Date: Tue, 16 Jun 2020 18:46:37 -0700
User-agent: Roundcube Webmail/0.9.2

On 2020-06-16 17:34, Budi wrote:
like was said

How can we have make's 'include' command in makefile not to precede
the first/default target in the actual processes in

https://github.com/mcostalba/Stockfish/blob/master/src/Makefile
the famous chess engine

I only see one include and it's at the bottom, for including
dependency makefiles.

Include directives are processed when a makefile is read. Execution
of rules happens after a makefile is read, so of course the effect
of inclusion is settled before any target is updated.

it'll include what make's 'include' is given always at the earliest
I need Help target must be earlier than it if Help is really intended
i.e. by default behavior; the first target of others must be the
first processs, in here case is simply if user type "make"

The above chess engine's Makefile takes care of this problem
by using -include (dash include) rather than include. The -include
directive does not produce an error if the file does not exist.

This is commonly used for dependency makefiles, which do not
exist yet if nothing has been built; they only exist after a build,
in order to help with incremental rebuilds.

So if nothing has been built and the user runs "make help", there
is no error arising from "-include .depend", if .depend
does not exist.  The situation is silently ignored and the
help target will execute.

If you would like to add your own include to this Makefile which
behaves the same way, use -include.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]