From 061810a88cfaafe8e2491da8bc369e6c5da15483 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Mon, 20 Nov 2006 20:49:45 +0100
Subject: [PATCH] Language makefile tweaks.

---
 Documentation/GNUmakefile                         | 11 +++++------
 make/doc-lang/root.make                           |  4 ----
 make/doclang-rules.make                           |  0
 make/{doc-lang/user.make => doclang-targets.make} | 10 ++--------
 make/doclang-vars.make                            |  0
 5 files changed, 7 insertions(+), 18 deletions(-)
 delete mode 100644 make/doc-lang/root.make
 create mode 100644 make/doclang-rules.make
 rename make/{doc-lang/user.make => doclang-targets.make} (79%)
 create mode 100644 make/doclang-vars.make

diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile
index e85f61dd03..d500c09ea6 100644
--- a/Documentation/GNUmakefile
+++ b/Documentation/GNUmakefile
@@ -29,19 +29,18 @@ OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
 txt-to-html:
 	$(PYTHON) $(step-bindir)/text2html.py $(OUT_TXT_FILES)
 
+ifneq ($(ISOLANG),)
 new-lang:
 	@if (( $$(file -b $(ISOLANG)) == directory )) 2>/dev/null; \
 	then echo "Error: $(ISOLANG) directory already exists. Exiting." ; \
 	exit 3 ; \
 	fi
 	mkdir -p $(ISOLANG)/user
-	echo "ISOLANG = $(ISOLANG)" > $(ISOLANG)/GNUmakefile
-	echo "depth = ../$(depth)" >> $(ISOLANG)/GNUmakefile
-	echo -e "\ninclude \$$(depth)/make/doc-lang/root.make\n" >> $(ISOLANG)/GNUmakefile
-	echo "ISOLANG = $(ISOLANG)" > $(ISOLANG)/user/GNUmakefile
-	echo "depth = ../../$(depth)" >> $(ISOLANG)/user/GNUmakefile
-	echo -e "\ninclude \$$(depth)/make/doc-lang/user.make\n" >> $(ISOLANG)/user/GNUmakefile
+	cp fr/GNUmakefile $(ISOLANG)
+	cp fr/user/GNUmakefile $(ISOLANG)/user
+	sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/user/GNUmakefile
 	$(PYTHON) $(depth)/buildscripts/texi-langutils.py -d $(outdir) -b "UNTRANSLATED NODE: IGNORE ME" -o doc.pot --skeleton --gettext ../user/lilypond.tely
 	mv $(outdir)/*.*tely $(ISOLANG)/user
 	msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot
 	cp po/lilypond-doc.pot po/$(ISOLANG).po
+endif
\ No newline at end of file
diff --git a/make/doc-lang/root.make b/make/doc-lang/root.make
deleted file mode 100644
index 22000df0ce..0000000000
--- a/make/doc-lang/root.make
+++ /dev/null
@@ -1,4 +0,0 @@
-SUBDIRS = user
-STEPMAKE_TEMPLATES = documentation
-
-include $(depth)/make/stepmake.make
diff --git a/make/doclang-rules.make b/make/doclang-rules.make
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/make/doc-lang/user.make b/make/doclang-targets.make
similarity index 79%
rename from make/doc-lang/user.make
rename to make/doclang-targets.make
index b1689b16ad..ae01f34b44 100644
--- a/make/doc-lang/user.make
+++ b/make/doclang-targets.make
@@ -2,12 +2,6 @@
 
 OUT_ITEXI_FILES = $(ITELY_FILES:%.itely=$(outdir)/%.itexi)
 
-
-STEPMAKE_TEMPLATES = texinfo
-LOCALSTEPMAKE_TEMPLATES = lilypond ly
-
-include $(depth)/make/stepmake.make
-
 LILYPOND_BOOK_INCLUDES += \
   -I$(depth)/Documentation/$(ISOLANG) \
   -I$(depth)/Documentation/user \
@@ -36,8 +30,8 @@ png-ln:
 	mkdir -p $(outdir)/lilypond
 	# makeinfo is broken, it MUST have PNGs in output dir
 	# symlinking PNGs...
-	@$(foreach i, $(shell find $(depth)/Documentation/user/$(outdir) -maxdepth 1 -name '*.png'), ln -sf ../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true
-	@$(foreach i, $(shell find $(depth)/Documentation/user/$(outdir)/lilypond -name '*.png'), ln -sf ../../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true
+	$(foreach i, $(shell find $(depth)/Documentation/user/$(outdir) -maxdepth 1 -name '*.png'), ln -sf ../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true
+	$(foreach i, $(shell find $(depth)/Documentation/user/$(outdir)/lilypond -name '*.png'), ln -sf ../../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true
 
 # Links referred to by Documentation index
 # BROKEN: the following makes broken symlinks
diff --git a/make/doclang-vars.make b/make/doclang-vars.make
new file mode 100644
index 0000000000..e69de29bb2
-- 
2.39.5