On Wed, Jun 20, 2012 at 3:20 PM, Andre Majorel <[email protected]> wrote:
> On 2012-06-19 19:30 +0200, Andre Majorel wrote:
>> define tgt
>> .PHONY: $(1)
>> $(1): destdir-unsafe
>> endef
>>
>> $(eval $(call tgt, target1))
>> do something
>>
>> $(eval $(call tgt, target2))
>> do something else
>>
>> Unfortunately, the splicing of the two lines coming from $(tgt)
>> and the "do something" line does not take place and Make bombs
>> with
>>
>> Makefile:#: *** commands commence before first target. Stop.
>>
>> on the "do something" line. Any way to make it work ? Thanks in
>> advance.
>
> No answers because it's a FAQ or because it's a tough one ?
Or because some of us have paying day jobs. I've other things to do,
so I'll leave it to *you* to figure out why this works:
-----
define tgt
$(eval .PHONY: $(value 1)
$(value 1): destdir-unsafe)$(1):
endef
$(call tgt, target1)
@echo something
$(call tgt, target2)
@echo something2
-----
Philip Guenther
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make