Gbuild explanation

Mat M matm at gmx.fr
Thu May 16 18:08:20 PDT 2013


Hello,

Le Thu, 16 May 2013 06:07:32 +0200, David Tardon <dtardon at redhat.com> a  
écrit:

> Hi,
>
> On Thu, May 16, 2013 at 01:22:10AM +0200, Mat M wrote:
>> Hello
>>
>> I have a GNU make question, actually:
>>
>> How this should be read ?
>> $(dir $(call gb_AutoInstallLibs_get_target,%)).dir :
>> 	$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
>
> We use rules to automatically create directory hierarchies for file
> targets in gbuild. This is the rule for creating the top-level directory
> of the AutoInstallLibs class in $(WORKDIR). There is a line like

So I was right in my reading, ty.

> $(call gb_AutoInstallLibs_get_target,$(1)) :| $(dir $(call  
> gb_AutoInstallLibs_get_target,$(1))).dir
>
> elsewhere in the makefile, that creates the (order-only) dependency.
>
> Note that $(dir $(call gb_AutoInstallLibs_get_target,%)).dir expands to
> $(WORKDIR)/AutoInstallLibs/.dir , so this is not a pattern rule. If
> there were any hierarchy needed in the directory, the rule would be
> accompanied by
>
> $(dir $(call gb_AutoInstallLibs_get_target,%))%/.dir :
> 	$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))

Then what is the purpose of the % in the $(call and the $(1) btw, since  
get_target already knows until AIL ?
Is it just so all get_target vars are built in the same way ? Even if this  
is the case the % is a mystery for me.

Regards

-- 
Mat M


More information about the LibreOffice mailing list