help-make
[Top][All Lists]
Advanced

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

Re: Change multiple string on a pattern, within a file which will be in


From: Kaz Kylheku (gmake)
Subject: Re: Change multiple string on a pattern, within a file which will be included
Date: Fri, 19 Jun 2020 07:27:01 -0700
User-agent: Roundcube Webmail/0.9.2

On 2020-06-19 03:08, Budi wrote:
Is there a way to change multiple string on a pattern, within a file
which will be included in makefile preferably in one command line
only, so it'll be ready included in makefile in the edited content

Include files are makefiles; they have to contain make syntax. As such,
they can take advantage of make techniques to customize their effective
content: use of variables, ifdef, eval, ...

A makefile can generate the files that it includes. A common example of
this is dependencies, like the -include .depend that appears in the chess
program's Makefile that you linked to earlier.

A makefile can generate an include file not only by executing a rule.
When make syntax is scanned, it's possible to execute external commands
via $(shell ...). Therefore this should be possible:

   DUMMY_VAR := $(shell command generating > foo.mk)

   # ... later

   include foo.mk

I.e. the updated foo.mk can be immediately available in the same make
invocation.





reply via email to

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