Add 'make help', displaying a list of useful make targets
authorSimon Marlow <marlowsd@gmail.com>
Mon, 15 Jun 2009 14:00:08 +0000 (14:00 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Mon, 15 Jun 2009 14:00:08 +0000 (14:00 +0000)
MAKEHELP [new file with mode: 0644]
Makefile

diff --git a/MAKEHELP b/MAKEHELP
new file mode 100644 (file)
index 0000000..47db0ab
--- /dev/null
+++ b/MAKEHELP
@@ -0,0 +1,55 @@
+
+Using the GHC build system
+--------------------------
+
+For a "Getting Started" guide, see:
+
+  http://hackage.haskell.org/trac/ghc/wiki/Building/Hacking
+
+Common commands:
+
+  make
+
+     Builds everything: ghc stages 1 and 2, all libraries and tools.
+
+  make -j2
+
+     Parallel build: runs up to 2 commands at a time (use the number of
+     CPUs in your machine in place of '2')
+
+  cd <dir>; make
+
+     Builds everything in the given directory.
+
+  cd compiler; make 2
+
+     Make just the stage2 compiler, ignoring dependencies.  Also "make 1" to
+     build just the stage1 compiler.
+
+  cd libraries; make 1
+
+     Build just those libraries that are built by stage1 (omit the "1" to build
+     all libraries, but that will also update the stage2 compiler).
+
+  make install
+
+     Installs GHC, libraries and tools under $(prefix)
+
+  make sdist
+  make binary-dist
+
+     Builds a source or binary distribution respectively
+
+  make show VALUE=<var>
+
+     Displays the value of make variable <var>
+
+  make clean
+  make distclean
+  make maintainer-clean
+
+     Various levels of cleaning: "clean" restores the tree to the
+     state after "./configure", "distclean" restores to the state
+     after "sh boot", and maintainer-clean restores the tree to the
+     completely clean checked-out state.
+
index f51b9a8..69c419c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,11 @@ else
 default : all
        @:
 
+# For help, type 'make help'
+.PHONY: help
+help :
+       @cat MAKEHELP
+
 ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
 -include mk/config.mk
 else
@@ -44,7 +49,7 @@ endif
 include mk/custom-settings.mk
 
 # No need to update makefiles for these targets:
-REALGOALS=$(filter-out bootstrapping-files framework-pkg clean clean_% distclean maintainer-clean show,$(MAKECMDGOALS))
+REALGOALS=$(filter-out bootstrapping-files framework-pkg clean clean_% distclean maintainer-clean show help,$(MAKECMDGOALS))
 
 # NB. not the same as saying '%: ...', which doesn't do the right thing:
 # it does nothing if we specify a target that already exists.