it's not ended, it's enDEF.

Internet people helped me to find the source of this error.
it happens because I used variable assignments inside target.
Makefiles don't work that way (makefile variables are assigned at global
scope).

On 06/26/2016 03:14 PM, Jay Lawrence wrote:
> Misspelled 'endif' as 'ended'?
>
> Sent from my iPhone
>
>> On Jun 26, 2016, at 1:58 AM, Vsyache Puz <vsyache...@gmail.com> wrote:
>>
>>
>> How to write foreach cycles in Makefile properly?
>>
>> I have read
>>
>> https://www.gnu.org/software/make/manual/html_node/Foreach-Function.html#Foreach-Function
>>
>> https://www.gnu.org/software/make/manual/html_node/Eval-Function.html#Eval-Function
>>
>> https://www.gnu.org/software/make/manual/html_node/Value-Function.html#Value-Function
>>
>>
>> Or what I do wrong here (it says "Makefile:16: *** missing separator. 
>> Stop."):
>>
>>
>>
>> DISTFILES := /dir2/dir3/dir4 /dir2 /dir1 /dir1/file1 /dir1/dir2/file2 
>> /dir1/dir2/file3 /dir1/file4
>>
>> .PHONY: default_target
>>
>> define DISTDIR_PROCESS_FILE_OR_DIRECTORY =
>> current_path=${file_or_dir_name}
>> ifeq ($${current_path},$${prev_path})
>> echo skip $${current_path}
>> else
>> echo mkdir -p $${current_path}
>> endif
>> prev_path:=$${current_path}
>> endef
>>
>> default_target:
>>    $(foreach file_or_dir_name,$(sort ${DISTFILES}),$(info $(value 
>> DISTDIR_PROCESS_FILE_OR_DIRECTORY)))
>>
>>
>>
>> Thanks.
>> _______________________________________________
>> Help-make mailing list
>> Help-make@gnu.org
>> https://lists.gnu.org/mailman/listinfo/help-make


_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to