[project @ 1996-11-21 16:45:53 by simonm]
[ghc.git] / ghc / Makefile
1 #-----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.2 1996/11/21 16:46:26 simonm Exp $
3
4 TOP=..
5 include $(TOP)/ghc/mk/ghc.mk
6
7 line = @echo "------------------------------------------------------------------------------"
8
9 define BuildLibs
10 $(line)
11 @echo "Building Libraries"
12 $(line)
13 @$(MAKE) -C lib depend all
14 endef
15
16 define BuildCompiler
17 $(line)
18 @echo "Building Compiler"
19 $(line)
20 @$(MAKE) -C compiler depend all
21 endef
22
23 # dependencies:
24 # everything needs utils
25 # includes needs driver (for mkNativeGen.c)
26 # make depend except in {utils,driver} needs includes
27 # RTS and compiler need includes
28
29 boot ::
30 $(line)
31 @echo "Building Utils"
32 $(line)
33 @$(MAKE) -C utils depend all
34
35 $(line)
36 @echo "Building Driver"
37 $(line)
38 @$(MAKE) -C driver all
39
40 $(line)
41 @echo "Building Includes"
42 $(line)
43 @$(MAKE) -C includes all
44
45 $(line)
46 @echo "Building Runtime System"
47 $(line)
48 @$(MAKE) -C runtime depend all
49
50 $(line)
51 @echo "Building Docs"
52 $(line)
53 @$(MAKE) -C docs depend all
54
55 ifeq ($(HaskellCompilerType), HC_USE_HC_FILES)
56 $(BuildLibs)
57 $(BuildCompiler)
58 else
59 $(BuildCompiler)
60 $(BuildLibs)
61 endif
62
63 # "CONTRIB" is also a SUBDIR, but there is nothing to build there.
64 SUBDIRS = utils driver includes runtime docs compiler lib
65
66 # Make the required directories for install.
67
68 install_dirs ::
69 $(MKDIRHIER) $(INSTBINDIR_GHC)
70 $(MKDIRHIER) $(INSTSCRIPTDIR_GHC)
71 $(MKDIRHIER) $(INSTLIBDIR_GHC)
72 $(MKDIRHIER) $(INSTLIBDIR_GHC)/includes
73 $(MKDIRHIER) $(INSTDATADIR_GHC)
74 $(MKDIRHIER) $(INSTDATADIR_GHC)/includes
75 $(MKDIRHIER) $(INSTDATADIR_GHC)/imports
76
77 install :: install_dirs
78
79 include $(TOP)/mk/subdir.mk