When making bindists, check that we know where we are
[ghc-hetmet.git] / docs / Makefile
1 TOP = ..
2 include $(TOP)/mk/boilerplate.mk
3
4 SUBDIRS = man docbook-cheat-sheet users_guide
5 ifneq "$(DOING_BIN_DIST)" "YES"
6 SUBDIRS += ext-core storage-mgt
7 endif
8
9 PAGE = index.html
10
11 install-docs :: $(PAGE)
12         $(INSTALL_DIR)                          $(DESTDIR)$(htmldir)
13         $(INSTALL_DATA) $(INSTALL_OPTS) $(PAGE) $(DESTDIR)$(htmldir)
14
15 .PHONY: binary-dist binary-dist.doc.%
16
17 binary-dist: $(foreach SUBDIR,$(SUBDIRS),binary-dist.doc.$(SUBDIR))
18 ifeq "$(WHERE_AM_I)" ""
19         echo "I don't know where I am" >&2
20         exit 1
21 endif
22         echo $(WHERE_AM_I)/Makefile >> $(BIN_DIST_LIST)
23         echo $(WHERE_AM_I)/$(PAGE)  >> $(BIN_DIST_LIST)
24
25 $(foreach SUBDIR,$(SUBDIRS),binary-dist.doc.$(SUBDIR)): \
26 binary-dist.doc.%:
27         $(MAKE) -C $* binary-dist WHERE_AM_I=$(WHERE_AM_I)/$*
28
29 include $(TOP)/mk/target.mk