[MPlayer-DOCS] Makefile.inc fixes? [patch]

Torinthiel torinthiel at wp.pl
Mon Jan 26 12:14:56 CET 2004


On Mon, Jan 26, 2004 at 12:13:15PM +0100, Torinthiel wrote:
> I have created what I believe to be Makefile.inc fixes.
> Namely it adds missing .PHONY for all, html-single and html-chunked,
> makes the xsl dependency creating a bit more readable IMHO and makes
> HTML_DIR and HTML_FILE error checking internal in make. Please comment.

And how about a patch?
Torinthiel

-- 
 Waclaw "Torinthiel" Schiller       GG#: 542916, 3073512
   torinthiel(at)wp(dot)pl
   gpg: B06901F1 fpr: FAA3 559F CAE9 34DE CDC8  7346 2B6E 39F2 B069 01F1
 "No classmates may be used during this examination"
-------------- next part --------------
Index: Makefile.inc
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/xml/Makefile.inc,v
retrieving revision 1.14
diff -u -r1.14 Makefile.inc
--- Makefile.inc	24 Jan 2004 22:31:11 -0000	1.14
+++ Makefile.inc	26 Jan 2004 11:08:10 -0000
@@ -4,13 +4,15 @@
 
 # Use customized html-chunk.xsl and/or html-single.xsl file if they exist...
 # Also add html-common.xsl to depends if it exists.
-ifeq (html-chunk.xsl,$(wildcard html-chunk.xsl))
-HTML_CHUNK_XSL := html-chunk.xsl
 ifeq (html-common.xsl,$(wildcard html-common.xsl))
-CHUNK_XSL_DEPS := $(HTML_CHUNK_XSL) html-common.xsl ../html-chunk.xsl ../html-common.xsl
+COMMON_XSL_DEPS := html-common.xsl ../html-common.xsl
 else
-CHUNK_XSL_DEPS := $(HTML_CHUNK_XSL) ../html-chunk.xsl ../html-common.xsl
+COMMON_XSL_DEPS := ../html-common.xsl
 endif
+
+ifeq (html-chunk.xsl,$(wildcard html-chunk.xsl))
+HTML_CHUNK_XSL := html-chunk.xsl
+CHUNK_XSL_DEPS := $(HTML_CHUNK_XSL) ../html-chunk.xsl $(COMMON_XSL_DEPS)
 else
 HTML_CHUNK_XSL := ../html-chunk.xsl
 CHUNK_XSL_DEPS := $(HTML_CHUNK_XSL) ../html-common.xsl
@@ -18,11 +20,7 @@
 
 ifeq (html-single.xsl,$(wildcard html-single.xsl))
 HTML_SINGLE_XSL := html-single.xsl
-ifeq (html-common.xsl,$(wildcard html-common.xsl))
-XSL_DEPS := $(HTML_SINGLE_XSL) html-common.xsl ../html-single.xsl ../html-common.xsl
-else
-XSL_DEPS := $(HTML_SINGLE_XSL) ../html-single.xsl ../html-common.xsl
-endif
+XSL_DEPS := $(HTML_SINGLE_XSL) ../html-single.xsl $(COMMON_XSL_DEPS)
 else
 HTML_SINGLE_XSL := ../html-single.xsl
 XSL_DEPS := $(HTML_SINGLE_XSL) ../html-common.xsl
@@ -32,17 +30,18 @@
 HTML_STYLESHEET ?= ../default.css
 
 # This is the main target...
+.PHONY: all html-chunked html-single
 all: html-chunked html-single
 html-chunked: $(HTMLDIR)/index.html
 html-single: $(HTMLFILE)
 
-$(HTMLDIR)/index.html: main.xml $(CHUNK_XSL_DEPS)
-	if test "$(HTMLDIR)" = "" ; then \
-		echo "Error: HTMLDIR not set!!!"; \
-		echo "Typically this means, that you've run make from a subdir of DOCS/xml."; \
-		echo "Don't do this!"; \
-		false; \
-	fi
+$(HTMLDIR)/index.html: main.xml $(CHUNK_XSL_DEPS) symlinks
+ifndef HTMLDIR
+	$(warning $(HTMLDIR))
+	$(warning Error: HTMLDIR not set!!!)
+	$(warning Typically this means, that you've run make from a subdir of DOCS/xml.)
+	$(error Don't do this!)
+endif
 	if test "$(USE_SYMLINKS)" = "yes" ; then \
 		for file in ../en/*.xml ; do \
 		if ! test -r `basename $$file` ; then \
@@ -56,12 +55,11 @@
 	../xsltproc.sh $(HTMLDIR)/ $(HTML_CHUNK_XSL) $<
 
 $(HTMLFILE): main.xml $(XSL_DEPS)
-	if test "$(HTMLFILE)" = "" ; then \
-		echo "Error: HTMLFILE not set!!!"; \
-		echo "Typically this means, that you've run make from a subdir of DOCS/xml."; \
-		echo "Don't do this!"; \
-		false; \
-	fi
+ifndef HTMLFILE
+	$(warning Error: HTMLFILE not set!!!)
+	$(warning Typically this means, that you've run make from a subdir of DOCS/xml.)
+	$(error Don't do this!)
+endif
 	if test "$(USE_SYMLINKS)" = "yes" ; then \
 		for file in ../en/*.xml ; do \
 		if ! test -r `basename $$file` ; then \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-docs/attachments/20040126/a44ec4b2/attachment.pgp>


More information about the MPlayer-DOCS mailing list