Am 08.01.2014 13:11, schrieb Niels Grewe:
> In fact it’s very, very easy to switch the documentation to using the
> present (not yet installed) configuration: You just have to set
> GNUSTEP_MAKEFILES=../ at the beginning of Documentation/GNUmakefile.

After evaluating this more closely, it's indeed very good:

- First time I see HTML documentation installed.

- .info documentation is installed again.

- Usage of DESTDIR works fine.

- Unless the documentation installation process is changed drastically,
  makefile fragments in the source dir always share their hierarchy
  with the installed ones. That's how documentation.make works.

- Cleaning works fine.

- Build time for the whole thing almost cut in half (one run of
  configure instead of three).

- About 40 lines of complicated code removed.

The only minor problem not solved is, "make -C Documentation distclean"
_without_ configuring previously errors out (instead of doing
nonsense before).

Patch attached. It adresses Richards concerns in comments.


Markus

-- 
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. (FH) Markus Hitter
http://www.reprap-diy.com/
http://www.jump-ing.de/
>From b4bf5f3df7fec3714f26c9cc42e8cbee076607b2 Mon Sep 17 00:00:00 2001
From: Markus Hitter <m...@jump-ing.de>
Date: Thu, 9 Jan 2014 18:02:05 +0100
Subject: Documentation/GNUmakefile: allow installation without having make
 installed.

The approach is very simple and robust: just use the makefile fragments
in the source tree as-is. The previous one was pretty fragile and not
yet complete, anyways.

Thanks to Niels Grewe for hinting to this excellent solution.
---
 Documentation/GNUmakefile | 66 ++++++++---------------------------------------
 1 file changed, 11 insertions(+), 55 deletions(-)

diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile
index 1766099..21c2ebf 100644
--- a/Documentation/GNUmakefile
+++ b/Documentation/GNUmakefile
@@ -4,63 +4,21 @@
 
 # The GNUmakefile itself is written using gnustep-make.  If we find an
 # existing gnustep-make installation, we use it.  Otherwise, we
-# configure, compile and install gnustep-make into a temporary
-# subdirectory, then we use that copy.
+# use the source tree as-is.  As all makefile fragments in the source tree
+# are placed the same way as they're installed, this works fine.
 
-# In the very unlikely event that gnustep-make does not even install
-# on your machine, please get a pre-generated copy of the
-# documentation from the internet!  Or just read the documentation in
-# source format. :-)
+# If future changes happen to introduce different behaviour between the
+# makefile fragments in the source tree and installed ones (which is not
+# a trivial change), this strategy has to be reviewed.  One possible solution
+# then is to install make into a temporary directory (DESTDIR?) first, then to
+# use these. Nevertheless it's important for packaging and cross-compiling to
+# have documentation installation work without having make installed
+# system-wide previously.
 
 ifeq ($(GNUSTEP_MAKEFILES),)
+  GNUSTEP_MAKEFILES=..
+endif
 
-# We have no gnustep-make installation to use.  We need gnustep-make
-# to generate the documentation.
-
-# To help lazy cows who want to type 'make' and have all work
-# automatically without installating gnustep-make first, if we don't
-# have a gnustep-make installation to use, we create a temporary one
-# in the subdirectory ./tmp-installation, the run make again passing
-# GNUSTEP_MAKEFILES set to point to the new makefile installation
-
-# To execute all, or clean, we first depend on a local
-# temporary installation of gnustep-make; when we have it, we source
-# GNUstep.sh, then we run the make command again.
-all regenerate: ./tmp-installation/System/Library/Makefiles
-	@echo "** Running 'make $@' using the local/temporary gnustep-make installation **"
-	$(MAKE) $@ GNUSTEP_MAKEFILES="$(CURRENT_DIR)/tmp-installation/System/Library/Makefiles"
-	@echo "** Finished local/temporary documentation in $(CURRENT_DIR)/tmp-installation. **"
-	@echo "** Use an installed gnustep-make if you wish to install documentation. **"
-
-clean: ./tmp-installation/System/Library/Makefiles
-	$(MAKE) $@ GNUSTEP_MAKEFILES="$(CURRENT_DIR)/tmp-installation/System/Library/Makefiles"
-
-install:
-	@echo "** To install the documentation you first install/set-up gnustep-make **"
-
-CURRENT_DIR = $(shell pwd)
-
-# This creates a local temporary installation of GNUstep-make
-./tmp-installation/System/Library/Makefiles:
-	@echo "** No gnustep-make installation found, attempting to create a local/temporary one. **"
-	(mkdir tmp-build; \
-	cd tmp-build; \
-	../../configure --prefix="$(CURRENT_DIR)/tmp-installation" \
-			--with-layout=gnustep \
-	                --with-config-file="$(CURRENT_DIR)/tmp-installation/GNUstep.conf"; \
-	make; \
-	make install)
-
-distclean:
-	-(if [ -f ./tmp-installation/System/Library/Makefiles/common.make ]; then \
-	  $(MAKE) $@ GNUSTEP_MAKEFILES="$(CURRENT_DIR)/tmp-installation/System/Library/Makefiles"; \
-	fi)
-	rm -Rf tmp-installation tmp-build
-
-else
-
-# We have a gnustep-make installation to use.  The following is a
-# normal gnustep-make GNUmakefile for documentation.
 
 # We normally install into System
 GNUSTEP_INSTALLATION_DOMAIN = SYSTEM
@@ -172,5 +130,3 @@ after-uninstall::
 
 after-distclean::
 	rm -f version.texi
-
-endif
-- 
1.8.3.2

_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to