MAINTAINER_CLEAN_FILES += configure
+ifeq "$(ProjectsToBuild)" ""
+Projects = $(AllProjects)
+else
+Projects = $(filter $(ProjectsToBuild), $(AllProjects))
+endif
+
+all ::
+ @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
+ for i in $(Projects); do \
+ if [ -d $$i ]; then \
+ $(MAKE) -C $$i boot all; \
+ if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
+ fi; \
+ done
+
+boot ::
+ @echo "Please use \`make all' only from the top-level, or \`make boot' followed"
+ @echo "by \`make all' in an individual project subdirectory (ghc, hslibs etc.)."
+
+install ::
+ @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
+ for i in $(filter-out $(ProjectsDontInstall), $(AllProjects)); do \
+ if [ -d $$i ]; then \
+ $(MAKE) -C $$i boot all; \
+ if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
+ fi; \
+ done
+
+NO_ALL_TARGETS=YES
include $(TOP)/mk/target.mk
+# -----------------------------------------------------------------------------
+
Quick start: the following is *supposed* to work
$ ./configure
- $ make boot
$ make
$ make install
#
################################################################################
-#
-# What parts to build: An fptools build tree does not have to be built
-# all in one go. By setting the list of ProjectsToBuild in build.mk you can
-# control which projects are built.
-#
-# Caution: the projects are built in the order given here, so if some
-# projects use others you must list them in the correct order.
-#
-# Generally: * glafp-utils should be first
-# * happy next
-# * ghc next
-# then it's up to you
-
+# build the libs first if we're bootstrapping from .hc files
ifeq "$(GhcWithHscBuiltViaC)" "YES"
-# need hslibs/lang first if we're bootstrapping
-ProjectsToBuild = glafp-utils hslibs ghc
+AllProjects = glafp-utils hslibs ghc green-card happy hdirect hood nofib
else
-ProjectsToBuild = glafp-utils ghc hslibs
+AllProjects = glafp-utils ghc hslibs green-card happy hdirect hood nofib
endif
+
+#
+# (OPTIONAL) set ProjectsToBuild to a list of projects to be built. If this
+# list is empty, then all projects present in the source tree will be built.
+#
+ProjectsToBuild =
+
#
-# Make a distinction between building and installing
+# set ProjectsDontInstall to a list of projects which are normally built but
+# not installed.
#
-ProjectsToInstall = glafp-utils ghc hslibs
+ProjectsDontInstall = glafp-utils nofib
#
# Should the various project tests directories be built?
ifneq "$(SUBDIRS)" ""
-all docs runtests boot TAGS clean distclean mostlyclean maintainer-clean install html ps dvi txt::
+# we override the boot & all targets in the top level Makefile
+ifneq "$(NO_ALL_TARGETS)" "YES"
+ALL = all
+BOOT = boot
+INSTALL = install
+endif
+
+$(ALL) docs runtests $(BOOT) TAGS clean distclean mostlyclean maintainer-clean $(INSTALL) html ps dvi txt::
@echo "------------------------------------------------------------------------"
@echo "===fptools== Recursively making \`$@' in $(SUBDIRS) ..."
@echo "PWD = $(shell pwd)"