aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-04-11 13:40:31 +0000
committersimonmar <unknown>2002-04-11 13:40:31 +0000
commitfe9b10f8c0758645c680b339b8cc26bfb25697e8 (patch)
treeadfa11682a095eaa758f6c57fedc05b7347e283a /src/Makefile
parent69006c3efae7477ca84fd679f72d6a0a2f500534 (diff)
[haddock @ 2002-04-11 13:40:30 by simonmar]
- copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy).
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile48
1 files changed, 47 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile
index 66c0b0b5..238009e0 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,9 +1,55 @@
TOP = ..
include $(TOP)/mk/boilerplate.mk
+INSTALLING=1
+
SRC_HC_OPTS += -package data -package text -fglasgow-exts -cpp
-HS_PROG = haddock
+HS_PROG = haddock.bin
HsParser_HC_OPTS += -Onot
+HaddockVersion_HC_OPTS = -DHADDOCK_VERSION=$(ProjectVersion)
+
+CSS_FILE = haddock.css
+
+ifeq "$(INSTALLING)" "1"
+ifeq "$(BIN_DIST)" "1"
+HADDOCKCSS=$$\"\"libdir/haddock/$(CSS_FILE)
+HADDOCKBIN=$$\"\"libexecdir/$(HS_PROG)
+else
+HADDOCKCSS=$(libdir)/haddock/$(CSS_FILE)
+HADDOCKBIN=$(libexecdir)/$(HS_PROG)
+endif # BIN_DIST
+else
+HADDOCKCSS=$(FPTOOLS_TOP_ABS)/haddock/html/$(CSS_FILE)
+HADDOCKBIN=$(FPTOOLS_TOP_ABS)/haddock/src/$(HS_PROG)
+endif
+
+INSTALLED_SCRIPT_PROG = haddock-$(ProjectVersion)
+INPLACE_SCRIPT_PROG = haddock-inplace
+
+ifeq "$(INSTALLING)" "1"
+TOP_PWD := $(prefix)
+SCRIPT_PROG = $(INSTALLED_SCRIPT_PROG)
+LINK = haddock
+else
+TOP_PWD := $(FPTOOLS_TOP_ABS)
+SCRIPT_PROG = $(INPLACE_SCRIPT_PROG)
+endif
+
+SCRIPT_OBJS=haddock.sh
+
+INTERP=$(SHELL)
+
+SCRIPT_SUBST_VARS = HADDOCKCSS HADDOCKBIN
+
+INSTALL_SCRIPTS += $(SCRIPT_PROG)
+INSTALL_LIBEXECS = $(HS_PROG)
+
+# don't recurse on 'make install'
+#
+ifeq "$(INSTALLING)" "1"
+all clean distclean maintainer-clean ::
+ $(MAKE) INSTALLING=0 BIN_DIST=0 $(MFLAGS) $@
+endif
include $(TOP)/mk/target.mk