diff mbox series

[1/5] Makefile: Fix out of tree build for documentation

Message ID 20200205094809.30185-2-ceggers@arri.de
State Accepted
Headers show
Series A bunch of build fixes | expand

Commit Message

Christian Eggers Feb. 5, 2020, 9:48 a.m. UTC
The doc/Makefile expects to be run from the source directory (e.g. with
a given BUILDDIR parameter).

Tested with make targets "help", "clean" and "html" for in-tree and
out-of-tree build.

Fixes: 58a4c02953 ("Build documentation from main Makefile")
Signed-off-by: Christian Eggers <ceggers@arri.de>
---
 Makefile      | 15 ++++++++-------
 Makefile.help |  2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

Comments

Stefano Babic Feb. 5, 2020, 10:01 a.m. UTC | #1
On 05.02.20 10:48, Christian Eggers wrote:
> The doc/Makefile expects to be run from the source directory (e.g. with
> a given BUILDDIR parameter).

Yes, it is.

> 
> Tested with make targets "help", "clean" and "html" for in-tree and
> out-of-tree build.
> 
> Fixes: 58a4c02953 ("Build documentation from main Makefile")
> Signed-off-by: Christian Eggers <ceggers@arri.de>
> ---
>  Makefile      | 15 ++++++++-------
>  Makefile.help |  2 +-
>  2 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 4773d54..9f41235 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -531,7 +531,8 @@ clean: $(clean-dirs)
>  		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
>  		-o -name modules.builtin -o -name '.tmp_*.o.*' \
>  		-o -name '*.gcno' \) -type f -print | xargs rm -f
> -	@$(MAKE) -C doc clean
> +	@pwd
> +	$(Q)$(MAKE) -f $(srctree)/doc/Makefile BUILDDIR=$(CURDIR)/doc/build clean
>  
>  # mrproper - Delete all generated files, including .config
>  #
> @@ -578,17 +579,17 @@ clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
>  endif #ifeq ($(config-targets),1)
>  endif #ifeq ($(mixed-targets),1)
>  
> -endif	# skip-makefile
> -
> -PHONY += FORCE
> -FORCE:
> -
>  # Documentation
>  # run Makefile in doc directory
>  
>  dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub \
>  latex latexpdf text man changes linkcheck html doctest:
> -	@$(MAKE) -C doc $@
> +	$(Q)$(MAKE) -C $(srctree)/doc BUILDDIR=$(CURDIR)/doc/build $@
> +
> +endif	# skip-makefile
> +
> +PHONY += FORCE
> +FORCE:
>  
>  # Declare the contents of the .PHONY variable as phony.  We keep that
>  # information in a variable so we can use it in if_changed and friends.
> diff --git a/Makefile.help b/Makefile.help
> index 067c750..e6f538d 100644
> --- a/Makefile.help
> +++ b/Makefile.help
> @@ -26,5 +26,5 @@ help:
>  	@echo '  randconfig		- generate a random configuration'
>  	@echo
>  	@echo 'Documentation:'
> -	@make -C doc help
> +	@$(MAKE) -f $(srctree)/doc/Makefile help
>  
> 

Looks fine.

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 4773d54..9f41235 100644
--- a/Makefile
+++ b/Makefile
@@ -531,7 +531,8 @@  clean: $(clean-dirs)
 		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
 		-o -name modules.builtin -o -name '.tmp_*.o.*' \
 		-o -name '*.gcno' \) -type f -print | xargs rm -f
-	@$(MAKE) -C doc clean
+	@pwd
+	$(Q)$(MAKE) -f $(srctree)/doc/Makefile BUILDDIR=$(CURDIR)/doc/build clean
 
 # mrproper - Delete all generated files, including .config
 #
@@ -578,17 +579,17 @@  clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
 endif #ifeq ($(config-targets),1)
 endif #ifeq ($(mixed-targets),1)
 
-endif	# skip-makefile
-
-PHONY += FORCE
-FORCE:
-
 # Documentation
 # run Makefile in doc directory
 
 dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub \
 latex latexpdf text man changes linkcheck html doctest:
-	@$(MAKE) -C doc $@
+	$(Q)$(MAKE) -C $(srctree)/doc BUILDDIR=$(CURDIR)/doc/build $@
+
+endif	# skip-makefile
+
+PHONY += FORCE
+FORCE:
 
 # Declare the contents of the .PHONY variable as phony.  We keep that
 # information in a variable so we can use it in if_changed and friends.
diff --git a/Makefile.help b/Makefile.help
index 067c750..e6f538d 100644
--- a/Makefile.help
+++ b/Makefile.help
@@ -26,5 +26,5 @@  help:
 	@echo '  randconfig		- generate a random configuration'
 	@echo
 	@echo 'Documentation:'
-	@make -C doc help
+	@$(MAKE) -f $(srctree)/doc/Makefile help