Re: Checking file generation for a test script

2017-06-20 Thread SF Markus Elfring
>> My pattern example does not work with the current make software in the
>> way I hoped would be occasionally convenient.
> 
> No it does not. Did you read my entire previous answer?

Yes. - I replied to it twice with different information.

Regards,
Markus

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Checking file generation for a test script

2017-06-19 Thread Henrik Carlqvist
On Mon, 19 Jun 2017 13:20:23 +0200
SF Markus Elfring  wrote:

> > It would have been generated if you would have called make with a
> > command like:
> 
> elfring@Sonne:~/Projekte/Bau> LANG=C make --no-builtin-rules -f
> ../rule-check2.make MOTD.log make: *** No rule to make target
> 'MOTD.log'.  Stop.
> 
> My pattern example does not work with the current make software in the
> way I hoped would be occasionally convenient.

No it does not. Did you read my entire previous answer?

>>> and if you had a rule to build MOTD.log
...
>>> In fact, there is no rule at all for MOTD.txt as your rule for
>>> MOTD%.txt has a pattern which must match a none empty string.

regards Henrik

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Checking file generation for a test script

2017-06-19 Thread SF Markus Elfring
> It would have been generated if you would have called make with a command 
> like:

elfring@Sonne:~/Projekte/Bau> LANG=C make --no-builtin-rules -f 
../rule-check2.make MOTD.log
make: *** No rule to make target 'MOTD.log'.  Stop.


> LANG=C make --no-builtin-rules -f ../rule-check2.make MOTD.log
> and if you had a rule to build MOTD.log

My pattern example does not work with the current make software in the way
I hoped would be occasionally convenient.

Regards,
Markus

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Checking file generation for a test script

2017-06-18 Thread Paul Smith
On Sun, 2017-06-18 at 17:14 +0200, SF Markus Elfring wrote:
> > It would have been generated if you would have called make with a
> > command like:
> > LANG=C make --no-builtin-rules -f ../rule-check2.make MOTD.log
> 
> I hoped that I do not need to specify another file name for such command 
> variant
> just to test a special default setting.
> 
> > and if you had a rule to build MOTD.log
> 
> I thought that the shown pattern rule should be sufficient.

You must tell make specifically which targets you want to build.  You
can do that either by listing specific targets in the makefile, or else
by specifying specific targets on the make command line.

Make won't go looking for any way to build any possible target that
might match any pattern rule that is defined in the makefile or by
default rule.

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Checking file generation for a test script

2017-06-18 Thread SF Markus Elfring
> It would have been generated if you would have called make with a
> command like:
> LANG=C make --no-builtin-rules -f ../rule-check2.make MOTD.log

I hoped that I do not need to specify another file name for such command variant
just to test a special default setting.


> and if you had a rule to build MOTD.log

I thought that the shown pattern rule should be sufficient.


> In the documentation at
> https://www.gnu.org/software/make/manual/html_node/Rules.html it says:
> 
> "a target that defines a pattern rule has no effect on the default goal."

Thanks for your link.

My expectations for the test example did not fit to this information then.

Regards,
Markus

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: Checking file generation for a test script

2017-06-18 Thread Henrik Carlqvist
On Sun, 18 Jun 2017 13:03:10 +0200
SF Markus Elfring  wrote:

> I have tried the following small script out together with the program
> “GNU Make 4.2.1-1.7” on my openSUSE Tumbleweed system.

That "script" seems like a makefile to me.
 
> my_compilation?=echo
> my_preparation?=cat
> footer?=MOTD.txt
> prepared_file?=MOTD.in
> 
> MOTD%.log: MOTD%.txt MOTD%.in
>   ${my_compilation} "$<: $$(cat ${prepared_file} ${footer})" > $@
> 
> ${prepared_file}: MOTD.draft
>   ${my_preparation} $< > $@
> 
> 
> elfring@Sonne:~/Projekte/Bau> my_message=MOTD.log && rm -f
> ${my_message}; touch MOTD.draft MOTD.txt && LANG=C make
> --no-builtin-rules -f ../rule-check2.make && LANG=C ls -l MOTD.in
> ${my_message} cat MOTD.draft > MOTD.in
> ls: cannot access 'MOTD.log': No such file or directory
> -rw-r--r-- 1 elfring users 6 Jun 18 12:56 MOTD.in
> 
> 
> Now I wonder why the log file is not generated by this build approach at
> the end. Where is my knowledge and understanding incomplete for this
> software situation?

Your MOTD.log is not generated because you did not tell make to generate
it. It would have been generated if you would have called make with a
command like:
LANG=C make --no-builtin-rules -f ../rule-check2.make MOTD.log
and if you had a rule to build MOTD.log

It would also have been generated if your makefile would have contained a
default rule which caused that file to be generated. 

The default rule in your makefile is ${prepared_file} which in this case
is MOTD.in gets generated.

There is no default rule for MOTD.txt, your makefile know how to generate
every MOTD?*.txt but it does not know if any of them should be generated
by default. In the documentation at
https://www.gnu.org/software/make/manual/html_node/Rules.html it says:

"a target that defines a pattern rule has no effect on the default goal."

In fact, there is no rule at all for MOTD.txt as your rule for MOTD%.txt
has a pattern which must match a none empty string.

regards Henrik

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Checking file generation for a test script

2017-06-18 Thread SF Markus Elfring
Hello,

I have tried the following small script out together with the program
“GNU Make 4.2.1-1.7” on my openSUSE Tumbleweed system.


my_compilation?=echo
my_preparation?=cat
footer?=MOTD.txt
prepared_file?=MOTD.in

MOTD%.log: MOTD%.txt MOTD%.in
${my_compilation} "$<: $$(cat ${prepared_file} ${footer})" > $@

${prepared_file}: MOTD.draft
${my_preparation} $< > $@


elfring@Sonne:~/Projekte/Bau> my_message=MOTD.log && rm -f ${my_message}; touch 
MOTD.draft MOTD.txt && LANG=C make --no-builtin-rules -f ../rule-check2.make && 
LANG=C ls -l MOTD.in ${my_message}
cat MOTD.draft > MOTD.in
ls: cannot access 'MOTD.log': No such file or directory
-rw-r--r-- 1 elfring users 6 Jun 18 12:56 MOTD.in


Now I wonder why the log file is not generated by this build approach at the 
end.
Where is my knowledge and understanding incomplete for this software situation?

Regards,
Markus

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make