--- a/Makefile Sun Dec 04 18:43:51 2011 +0200
+++ b/Makefile Sun Dec 04 18:45:24 2011 +0200
@@ -10,8 +10,8 @@
# Default target.
.DEFAULT_GOAL = help
-.PHONY: all
-all:
+################################################################
+# Platform definition.
ifeq '' '$(HOME)'
$(error HOME env var not set!)
@@ -19,7 +19,15 @@
host_os = linux
ifneq '' '$(COMSPEC)'
- host_os = windows
+ host_os = cygwin
+endif
+
+################################################################
+# Build tool definition/switches.
+
+RST2HTML = rst2html
+ifeq '$(host_os)' 'cygwin'
+ RST2HTML = rst2html.py
endif
################################################################
@@ -27,14 +35,23 @@
OVERRIDDEN_ITEMS = \
.inputrc .minttyrc .Xdefaults .xinitrc .xserverrc .screenrc .dircolors \
- .bashrc .bash_completion .zshrc .vimrc .ssh \
- .mailsign .muttrc .tidy \
+ .bashrc .bash_completion .zshrc .vimrc .ssh .pystartup \
+ .signature .muttrc .tidy \
.dictrc \
- .hgrc .hgignore .bazaar .gitconfig .gitignore .cvs \
+ .hgrc .hgignore .hgstyle .bazaar .gitconfig .gitignore .cvs \
.gnupg
MANUALINSTALL_ITEMS = .mc
IFNONEXIST_ITEMS = .wgetrc .subversion
+RST_FILES = $(wildcard *.rst)
+HTML_FILES = $(RST_FILES:.rst=.html)
+
+################################################################
+# Build targets.
+
+.PHONY: all
+all:
+
################################################################
# Install/uninstall targets.
@@ -72,7 +89,7 @@
done
mkdir -p $(HOME)/.mc
install -m 640 .mc/bashrc $(HOME)/.mc
-ifeq '$(host_os)' 'windows'
+ifeq '$(host_os)' 'cygwin'
install -m 640 .mc/bindings.cygwin $(HOME)/.mc/bindings
else
install -m 640 .mc/bindings $(HOME)/.mc/bindings
@@ -98,10 +115,21 @@
rmdir $(HOME)/.mc || :
################################################################
+# Docs targets.
+
+.PHONY: html
+html: $(HTML_FILES)
+
+# --stylesheet=rst.css
+$(HTML_FILES): %.html: %.rst
+ $(RST2HTML) $*.rst $@
+
+################################################################
# Clean targets.
.PHONY: clean
clean:
+ rm -f $(HTML_FILES)
.PHONY: distclean
distclean: clean