aboutsummaryrefslogtreecommitdiff
path: root/ghc.mk
blob: d1dbd2dd330a29d6ddeadd2bf6119fa6f0ceea0f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
utils/haddock_USES_CABAL = YES
utils/haddock_PACKAGE = haddock
utils/haddock_CONFIGURE_OPTS = --flag in-ghc-tree
utils/haddock_HC_OPTS += -DNEW_GHC_LAYOUT
utils/haddock_dist_SHELL_WRAPPER = YES
utils/haddock_dist_INSTALL_SHELL_WRAPPER = YES
utils/haddock_dist_INSTALL_SHELL_WRAPPER_NAME = haddock-$(ProjectVersion)
utils/haddock_dist_PROG = haddock$(exeext)

ifneq "$(BINDIST)" "YES"

$(INPLACE_BIN)/$(utils/haddock_dist_PROG): $(INPLACE_LIB)/html $(INPLACE_LIB)/latex

$(INPLACE_LIB)/html:
	"$(RM)" $(RM_OPTS_REC) $@
	"$(CP)" -R utils/haddock/html $@

$(INPLACE_LIB)/latex:
	"$(RM)" $(RM_OPTS_REC) $@
	"$(CP)" -R utils/haddock/latex $@

endif

$(eval $(call build-prog,utils/haddock,dist,2))

utils/haddock_dist_MODULES += Paths_haddock

install: install_utils/haddock_html
.PHONY: install_utils/haddock_html
install_utils/haddock_html:
	$(INSTALL_DIR) "$(DESTDIR)$(docdir)/html"
	"$(CP)" -R utils/haddock/html "$(DESTDIR)$(docdir)/html"

install: install_utils/haddock_data
.PHONY: install_utils/haddock_data
install_utils/haddock_data:
	$(foreach i,$(sort $(dir $(utils/haddock_dist_DATA_FILES))), \
	    $(call make-command,$(INSTALL_DIR) "$(DESTDIR)$(ghclibdir)/$i"))
	$(foreach i,$(utils/haddock_dist_DATA_FILES), \
	    $(call make-command,$(INSTALL_DATA) $(INSTALL_OPTS) utils/haddock/$i "$(DESTDIR)$(ghclibdir)/$(dir $i)"))

ifeq "$(Windows)" "NO"
install: install_haddock_link
.PNONY: install_haddock_link
install_haddock_link:
	"$(RM)" $(RM_OPTS) "$(DESTDIR)$(bindir)/haddock"
	$(LN_S) haddock-$(ProjectVersion) "$(DESTDIR)$(bindir)/haddock"
endif

BINDIST_EXTRAS += $(addprefix utils/haddock/,$(utils/haddock_dist_DATA_FILES))