]> git.donarmstrong.com Git - lilypond.git/blobdiff - website.make
website.make: Build all languages. Fixes switchability new web site.
[lilypond.git] / website.make
index 465757862073fbb97a870d0bb0e585de2b816131..4f4c449aab955556909e8bfcd382bfe5d7b66fe1 100644 (file)
@@ -6,11 +6,15 @@
 ################################################################
 ifeq ($(WEBSITE_ONLY_BUILD),1)
   ### for lilypond.org
-  top-src-dir=$(HOME)/src/lilypond
+  TOP_SRC_DIR=$(HOME)/src/lilypond
+  TRUSTED_DIR=$(HOME)/lilypond/trusted-scripts
+  top-src-dir=$(TOP_SRC_DIR)
   depth=.
-  trusted-dir=$(HOME)/lilypond/trusted-scripts
+  trusted-dir=$(TRUSTED_DIR)
   script-dir=$(trusted-dir)
   texi2html-init-file=$(trusted-dir)/lilypond-texi2html.init
+  top-htaccess=$(trusted-dir)/lilypond.org.htaccess
+  dir-htaccess=$(trusted-dir)/website-dir.htaccess
   TEXI2HTML_PROGRAM=$(HOME)/usr/bin/texi2html
   EXAMPLES=$(HOME)/media/ly-examples/
   PICTURES=$(HOME)/media/pictures
@@ -18,6 +22,8 @@ else
   ### for normal git
   script-dir=$(top-src-dir)/scripts/build/
   texi2html-init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init
+  top-htaccess=$(top-src-dir)/Documentation/web/server/lilypond.org.htaccess
+  dir-htaccess=$(top-src-dir)/Documentation/web/server/website-dir.htaccess
   include $(config_make)
   # I assume this is run from top-build-dir
   EXAMPLES=Documentation/web/ly-examples/out-www/
@@ -27,8 +33,7 @@ endif
 
 ################################################################
 OUT=out-website
-WEB_LANGS=es
-
+WEB_LANGS=$(shell PYTHONPATH=$(top-src-dir)/python python $(top-src-dir)/python/langdefs.py)
 
 TEXI2HTML=ONLY_WEB=1 TOP_SRC_DIR=$(top-src-dir) DEPTH=$(depth) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM)
 
@@ -56,18 +61,38 @@ website-xrefs: website-version
        $(EXTRACT_TEXI_FILENAMES) -I $(top-src-dir)/Documentation/ \
                -I $(OUT) -o $(OUT) --split=node \
                $(top-src-dir)/Documentation/web.texi
-       $(foreach manual, $(MANUALS), \
-               $(EXTRACT_TEXI_FILENAMES) -I $(top-src-dir)/Documentation/ \
-               -I $(OUT) -o $(OUT) $(manual) && ) :
+       # normal manuals
+       for m in $(MANUALS); do \
+               b=`basename "$$m" .texi`; \
+               d=`basename "$$b" .tely`; \
+               $(EXTRACT_TEXI_FILENAMES) \
+                       -I $(top-src-dir)/Documentation/ \
+                       -I $(top-src-dir)/Documentation/"$$d"/ \
+                       -I $(OUT) -o $(OUT) "$$m" ; \
+       done
        # translations
        for l in $(WEB_LANGS); do \
                $(EXTRACT_TEXI_FILENAMES) \
+                       -I $(top-src-dir)/Documentation/ \
                        -I $(top-src-dir)/Documentation/"$$l" \
                        -I $(OUT) -o $(OUT) --split=node \
                        $(top-src-dir)/Documentation/"$$l"/web.texi ;\
+               for m in $(MANUALS); do \
+                       n=`echo "$$m" | sed 's/Documentation/Documentation\/'$$l'/'` ; \
+                       b=`basename "$$n" .texi`; \
+                       d=`basename "$$b" .tely`; \
+                       if [ -e "$$n" ] ; then \
+                               $(EXTRACT_TEXI_FILENAMES) \
+                               -I $(top-src-dir)/Documentation/ \
+                               -I $(top-src-dir)/Documentation/"$$l" \
+                               -I $(top-src-dir)/Documentation/"$$l"/"$$d"/ \
+                               -I $(OUT) -o $(OUT) "$$n" ; \
+                       fi ; \
+               done; \
        done;
 
 
+
 website-texinfo: website-version website-xrefs
        $(TEXI2HTML) --prefix=index \
                --split=section \
@@ -110,7 +135,8 @@ web-post:
 
 website: website-texinfo website-css website-pictures website-examples web-post
        cp $(SERVER_FILES)/favicon.ico $(OUT)/website/
-       cp $(SERVER_FILES)/lilypond.org.htaccess $(OUT)/website/.htaccess
        cp $(SERVER_FILES)/robots.txt $(OUT)/website/
+       cp $(top-htaccess) $(OUT)/.htaccess
+       cp $(dir-htaccess) $(OUT)/website/.htaccess