summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorfbarriere <fbarriere>2005-06-21 20:29:32 +0000
committerfbarriere <fbarriere>2005-06-21 20:29:32 +0000
commite60828f978a9d2ec1233acc32ef7edc9dc015cb2 (patch)
tree42820ff2d9ccb52210cf5da27a0cb9f71fe32721 /Makefile
parent441cf175d89dfdf0ed40601ff3e162695811885c (diff)
downloadsylpheeddoc-doc-e60828f978a9d2ec1233acc32ef7edc9dc015cb2.tar.gz
sylpheeddoc-doc-e60828f978a9d2ec1233acc32ef7edc9dc015cb2.tar.xz
sylpheeddoc-doc-e60828f978a9d2ec1233acc32ef7edc9dc015cb2.zip
Changed the Makefile to the new DocBook version of the doc
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile240
1 files changed, 60 insertions, 180 deletions
diff --git a/Makefile b/Makefile
index f1bfc11..2571ff4 100644
--- a/Makefile
+++ b/Makefile
@@ -2,19 +2,15 @@
# Generate HTML pages from SGML docs.
# ==================================
#
-# You may need to define (if the default location does not
-# correspond to your installation) the SGML_TOOL variable
-# (using SGML_TOOL=<path-to-sgml2html> on the make command
-# line).
+# Edit the setup.mk included file to define your own docbook setup.
+# See the comments in this file for more details...
#
######################################################################
#
-# FILTER_IMAGES is deprecated, use TARGET_TYPE instead. TARGET_TYPE
-# is used to defined the target for the doc to build: either with
-# images and directory names as file prefix for the web site
-# (TARGET_TYPE=WEB) or without any screenshot and with file names to
-# fit the Sylpheed source code file name (to generate the doc to
-# include in the Sylpheed distribution).
+# TARGET_TYPE is used to defined the target for the doc to build:
+# either with images, for the web site (TARGET_TYPE=WEB) or without
+# any screenshot (to generate the doc to include in the Sylpheed
+# distribution).
# TARGET_TYPE can be 'WEB' or any other value (including the null
# string).
# The default is 'WEB', so if you do not provide anything on the make
@@ -22,21 +18,22 @@
#
######################################################################
#
-# To only build one type of doc (manual, faq,...) define the
-# ALL_TYPES list. For example:
-# make ALL_TYPES=manual
-# should only build the HTML pages for the manual.
-# To only build for one language, define the LANGS variable:
-# make LANGS="fr de"
-# should build the french and german docs.
-# Combine the two variables to build one type of doc for
-# selected languages:
-# make ALL_TYPES=faq LANGS=es
-# should only build the spanish faq.
+# Building particular type of doc (manual or faq) or building for
+# one language does not require any variable setting (for those who
+# remember the old sgmltools days). Just define what you want to
+# build in the command line of the make. Examples:
+#
+# 'make manual' => will make the manual in all languages.
+# 'make manual/en' => Will build the english manual.
+# 'make faq/en faq/es' => Will build the english and spanish FAQ.
+# 'make faq/en manual/en' => Will build the english FAQ and manual.
#
######################################################################
#
# $Log: Makefile,v $
+# Revision 1.5 2005/06/21 20:29:32 fbarriere
+# Changed the Makefile to the new DocBook version of the doc
+#
# Revision 1.4 2003/03/12 20:10:26 fbarriere
# Added the use of the zh-sgmltools for the chinese doc.
#
@@ -53,16 +50,6 @@
#
######################################################################
-ifeq ($(LANG1), zh_TW.Big5)
- SGML_TOOL := /usr/local/bin/bg5sgml2html
- SGML_TOOL_OPT :=
- #SGML_TOOL_OPT := --imagebuttons
-else
- SGML_TOOL := /usr/bin/sgml2html
- SGML_TOOL_OPT := --language=$(LANG1)
- #SGML_TOOL_OPT := --imagebuttons
-endif
-
#
# Final result type: WEB (with images and original names),
# or any other value for a version using he file names
@@ -75,21 +62,17 @@ TARGET_TYPE := WEB
#
ifeq ($(TARGET_TYPE), WEB)
FILTER_IMAGES :=
- TARGET_NAME := $(DOC_TYPE)
else
FILTER_IMAGES := YES_MY_LORD
- ifeq ($(DOC_TYPE), manual)
- TARGET_NAME := sylpheed
- else
- ifeq ($(DOC_TYPE), faq)
- TARGET_NAME := sylpheed-faq
- else
- TARGET_NAME := $(DOC_TYPE)
- endif
- endif
endif
#
+# Defines the types of doc and languages to process.
+#
+ALL_TYPES := faq manual
+LANGS := de en es fr zh_TW.Big5
+
+#
# Some usual shell commands with some arguments...
#
REMOVE := /bin/rm -rf
@@ -126,168 +109,65 @@ TODAY := $(shell date "+%d%m%Y")
HERE := $(shell pwd)
ROOT_DIR := $(HERE)
PACKAGE_DIR := $(ROOT_DIR)/../packages
-HTML_DIR := $(ROOT_DIR)/HTML/$(DOC_TYPE)
+HTML_DIR := $(ROOT_DIR)/HTML
SHOTS_DIR := snapshots
-#
-# Sed command file used to filter the images:
-#
-SED_CMD_FILE := $(ROOT_DIR)/tools/filter_images.sed
-
-#
-# Defines the list of languages to process.
-#
-LANG_tmp := $(shell ls)
-FILTER_OUT := CVS Makefile HTML tools packages
+TARGETS := $(foreach TYPE,$(ALL_TYPES), $(foreach LANG1,$(LANGS),$(HTML_DIR)/$(TYPE)/$(LANG1)/$(TYPE).html))
-ALL_TYPES := $(filter-out $(FILTER_OUT), $(LANG_tmp))
-LANGS := $(filter-out $(FILTER_OUT), $(LANG_tmp))
+SCREENSHOTS := $(addprefix $(HTML_DIR)/,$(shell ls */*/$(SHOTS_DIR)/*png))
#
-# List the source files, count the number of sections
-# and generate the sections number sequence. A complicated
-# GNU make + shell part just to count from 1 to the
-# number of sections of the SGML source. Looks like there
-# should be a better solution...
-#
-ifneq ($(LANG1), )
- SOURCE_FILES := $(shell ls $(LANG1)/*.sgml)
- ifneq ($(FILTER_IMAGES), )
- SHOTS_tmp :=
- SCREENSHOTS :=
- else
- SHOTS_tmp := $(shell ls $(LANG1)/$(SHOTS_DIR))
- SCREENSHOTS := $(shell ls $(LANG1)/$(SHOTS_DIR)/*.png)
- endif
-endif
-
-ifneq ($(SOURCE_FILES), )
- SECTION_NUM := $(shell /bin/cat $(SOURCE_FILES) | /bin/grep -c -i "<sect>")
- FILE_PREFIX := $(basename $(notdir $(SOURCE_FILES)))
- NUM_SEQUENCE := $(shell \
- index=1;\
- while [ $$index -le $(SECTION_NUM) ];\
- do\
- printf "%3d" $$index | /bin/sed 's/ /0/g' | /bin/sed 's/^/ /';\
- index=$$[$$index + 1];\
- done;\
- )
- html_doc_TARGETS := $(HTML_DIR)/$(LANG1)/$(TARGET_NAME).sgml $(addprefix $(HTML_DIR)/, $(SCREENSHOTS))
-endif
+# Java and DocBook setup:
+#
+include $(ROOT_DIR)/setup.mk
#
-# Defines the SGML filter: when filtering images, remove them
-# while generating the complete SGML file.
+# XSLT stylesheets:
#
-ifneq ($(FILTER_IMAGES), )
- FILTER := /bin/sed -f $(SED_CMD_FILE) | /bin/sed -e '/<REMOVE_ME>/,/<\/REMOVE_ME>/d'
-else
- FILTER := /usr/bin/tee
-endif
-
+CHUNKS_STYLESHEET := $(ROOT_DIR)/tools/user_guide_chunks.xsl
+SINGLE_STYLESHEET := $(ROOT_DIR)/tools/user_guide.xsl
+FO_PDF_STYLESHEET := $(ROOT_DIR)/tools/user_guide_fo.xsl
+HTML_STYLESHEET := sylpheeddoc.css
#
# Top level targets: then propagate the make for each
# document type (manual, faq,...), then for each language.
#
+.PHONY: $(ALL_TYPES) $(foreach LANG1,$(LANGS), $(foreach TYPE,$(ALL_TYPES),$(TYPE)/$(LANG1)))
-all: all_docs prep
-
-prep:
- @ $(MAKEDIR) $(HTML_DIR) $(PACKAGE_DIR)
-
-all_docs:
- @ for ONE_TYPE in $(ALL_TYPES);\
- do \
- echo "### Making all_langs in $$ONE_TYPE...";\
- $(MAKE) \
- -C $$ONE_TYPE \
- -f $(ROOT_DIR)/Makefile \
- DOC_TYPE=$$ONE_TYPE \
- ROOT_DIR=$(ROOT_DIR) \
- all_langs;\
- done;
+all: $(ALL_TYPES)
-all_langs:
- @ for ONE_LANG in $(LANGS);\
- do \
- echo "###### Making html_doc in $$ONE_LANG...";\
- $(MAKE) \
- -f $(ROOT_DIR)/Makefile \
- LANG1=$$ONE_LANG \
- DOC_TYPE=$(DOC_TYPE) \
- ROOT_DIR=$(ROOT_DIR) \
- html_doc ;\
- done;
+# Foreach document type: manual, faq:
+$(ALL_TYPES):
+ @ echo " *** Document: $@"
+ @ $(MAKE) $(foreach LANG,$(LANGS),$@/$(LANG))
-html_doc: $(html_doc_TARGETS)
+# Foreach type/language pair:
+$(foreach TYPE,$(ALL_TYPES),$(foreach LANG1,$(LANGS),$(TYPE)/$(LANG1))):
+ @ echo " ****** Doc/lang: "$@
+ @ $(MAKE) $(HTML_DIR)/$@/$(subst /,.html,$(dir $@))
-$(HTML_DIR)/$(LANG1)/$(TARGET_NAME).sgml: $(SOURCE_FILES)
- @ echo "######### Building $(HTML_DIR)/$(LANG1)/$(TARGET_NAME).sgml"
- @ $(MAKEDIR) $(HTML_DIR)/$(LANG1)
- @ $(CAT) $(SOURCE_FILES) | $(FILTER) > $(HTML_DIR)/$(LANG1)/$(TARGET_NAME).sgml
- @ echo "######### Building html file..."
- @ cd $(HTML_DIR)/$(LANG1); $(SGML_TOOL) $(SGML_TOOL_OPT) $@; cd $(HERE)
+# Foreach HTML output file:
+$(TARGETS): $(HTML_DIR)/%.html : %.xml
+ @ echo " ********* Creating dir: "$(dir $@)
+ @ $(MAKEDIR) $(dir $@)
+ifeq ($(TARGET_TYPE), WEB)
+ @ echo " ********* Creating dir: "$(dir $@)$(SHOTS_DIR)
+ @ $(MAKEDIR) $(dir $@)$(SHOTS_DIR)
+ @ $(MAKE) $(addprefix $(HTML_DIR)/,$(shell ls $(dir $<)$(SHOTS_DIR)/*png))
+endif
+ @ echo " ********* Creating HTML doc."
+ @ $(HTML_CMD)
-$(addprefix $(HTML_DIR)/, $(SCREENSHOTS)): $(HTML_DIR)/$(LANG1)/$(SHOTS_DIR)/%.png: $(LANG1)/$(SHOTS_DIR)/%.png
- @ if [ ! -d $(HTML_DIR)/$(LANG1)/$(SHOTS_DIR) ];\
- then\
- echo "######### Building $(HTML_DIR)/$(LANG1)/$(SHOTS_DIR)";\
- $(MAKEDIR) $(HTML_DIR)/$(LANG1)/$(SHOTS_DIR);\
- fi;
- @ echo "######### Importing: $<"
+# Foreach PNG screenshot:
+$(SCREENSHOTS): $(HTML_DIR)/%.png : %.png
+ @ echo " ********* Importing: $<"
@ $(COPY) $< $@
-#
-# Build tar packages of the docs:
-#
-
-packages:
- @ for ONE_TYPE in $(ALL_TYPES);\
- do \
- echo "### Making packages for $$ONE_TYPE...";\
- $(MAKE) \
- -f $(ROOT_DIR)/Makefile \
- -C $(HTML_DIR)/$$ONE_TYPE \
- DOC_TYPE=$$ONE_TYPE \
- ROOT_DIR=$(ROOT_DIR) \
- all_package;\
- done;
-
-all_package:
- @ for ONE_LANG in $(LANGS);\
- do \
- echo "###### Making package in $(DOC_TYPE)/$$ONE_LANG...";\
- $(MAKE) \
- -f $(ROOT_DIR)/Makefile \
- -C $(HTML_DIR)/$$ONE_TYPE/$$ONE_LANG \
- LANG1=$$ONE_LANG \
- DOC_TYPE=$(DOC_TYPE) \
- ROOT_DIR=$(ROOT_DIR) \
- package ;\
- done;
-
-package:
- @ echo "######### Building package"
- @ $(TAR_CREATE) $(PACKAGE_DIR)/sylpheeddoc_$(DOC_TYPE)_$(LANG1)_$(TODAY).$(TAR_SUFFIX) -C $(HERE) .
-
-
# ####################################################
#
# Usual clean target:
#
clean:
- @ for ONE_TYPE in $(ALL_TYPES);\
- do \
- echo "### Making html_clean in $$ONE_TYPE...";\
- $(MAKE) \
- -C $$ONE_TYPE \
- -f $(ROOT_DIR)/Makefile \
- DOC_TYPE=$$ONE_TYPE \
- ROOT_DIR=$(ROOT_DIR) \
- html_clean;\
- done;
- - $(REMOVE) $(PACKAGE_DIR)/*
-
-html_clean:
- $(REMOVE) $(HTML_DIR)
+ - $(REMOVE) $(PACKAGE_DIR)/*