bug-make
[Top][All Lists]
Advanced

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

Re: Checking alternatives for a dynamic make rule construction


From: SF Markus Elfring
Subject: Re: Checking alternatives for a dynamic make rule construction
Date: Sat, 17 Jun 2017 16:05:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

> What Philip is saying (and I agree 100%) is that you provide the above
> example which is excellent and helpful and allows us to see exactly what
> you're doing.  Thank you for that.

I was also curious in this case how the interest will evolve to clarify
the shown construction of make rules.


> But then, you ask questions which are abstract and require a lot of
> effort on our part to understand.

I can follow this concern to some degree.


> For example:
> 
>> 2. The specification “$$(name)” is working. Would it make sense to avoid
>>    such a variable reference there?
>>    Unfortunately, the simple specification “$(1)” does not work in the way
>>    I would expect for the selection of a single file as a dependency.
>>    Would you like to explain this software behaviour?
> 
> This seems to say that when you tried to use something different than
> the $$(name) reference above, it didn't work the way you expected.

This interpretation is correct.


> However, you provide no information on what the "something different"
> that you tried was, how it worked, or how you expected it to work.

It seems then I chose a wording from which you would not pick
the essential information up directly.


> In programming (and makefiles) everything is about the details.

I am used to this view as I am trying to be a professional software
developer for a while.


> The statement "I would expect for the selection of a single file as a
> dependency" is, at best, hard to understand (personally I didn't
> understand it).

So I try again to express my needs a bit more in make code.


Example MOTD.make:

my_test_command?=cat

define my_rule=
${1:.in=.txt}: ${1}
        $${my_test_command} $$< > $$@
endef

$(eval $(call my_rule,MOTD.in))


address@hidden:~/Projekte/Bau> rm MOTD.txt; echo 'Test!' > MOTD.in && make -f 
../MOTD.make && cat MOTD.txt
cat MOTD.in > MOTD.txt
Test!


This result is fine. Please try the following approach out again.


Example MOTD2.make:

my_test_command?=cat

define my_broken_rule=
name::=${1}
${name:.in=.txt}: ${1}
        $${my_test_command} $$< > $$@
endef

$(eval $(call my_broken_rule,MOTD.in))


address@hidden:~/Projekte/Bau> rm MOTD.txt && LANG=C make -f 
~/Projekte/MOTD2.make
make: *** No targets.  Stop.


How do you think about this test result?

Regards,
Markus



reply via email to

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