[PATCH][V3][weston] build: mkdir target weston.ini directories before writing

Jon A. Cruz jonc at osg.samsung.com
Fri Jul 17 07:59:08 PDT 2015


On 07/17/2015 04:33 AM, Ross Burton wrote:
> In parallel out-of-tree builds it is possible for e.g. ivi-shell/weston.ini to
> be written before ivi-shell/ exists.  Solve this by creating the target
> directory first.
> 
> Signed-off-by: Ross Burton <ross.burton at intel.com>
> ---
>  Makefile.am | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index a3590c0..76ab546 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -20,7 +20,7 @@ weston.ini : $(srcdir)/weston.ini.in
>  		$< > $@
>  
>  ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in
> -	$(AM_V_GEN)$(SED) \
> +	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
>  		-e 's|@bindir[@]|$(bindir)|g' \
>  		-e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
>  		-e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \

Instead of adding to a shell command, had you considered making the
directory a target?

A general solution might look similar to

APPROPRIATE_NAME += $(srcdir)/ivi-shell
...

$(APPROPRIATE_NAME):
	$(AM_V_GEN)$(MKDIR_P) $@
...
ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in |
$(srcdir)/ivi-shell
...
tests/weston-ivi.ini : $(srcdir)/ivi-shell/weston.ini.in |
$(srcdir)/ivi-shell/


> @@ -29,7 +29,7 @@ ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in
>  		$< > $@
>  
>  tests/weston-ivi.ini : $(srcdir)/ivi-shell/weston.ini.in
> -	$(AM_V_GEN)$(SED) \
> +	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
>  		-e 's|@bindir[@]|$(bindir)|g' \
>  		-e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
>  		-e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
> 

-- 
Jon A. Cruz - Senior Open Source Developer
Samsung Open Source Group
jonc at osg.samsung.com


More information about the wayland-devel mailing list