-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
137 lines (118 loc) · 4.25 KB
/
Makefile
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# The DDC build system.
# -----------------------------------------------------------------------------
# (Build targets)
# all -- build the compiler and libs (default)
# war -- as above, but also run regression tests.
# total -- as above, but also build docs.
# cleantotal -- as above, but do a full clean first.
#
# deps -- build dependencies.
# docs -- build Haddock docs.
# runtime -- build the runtime system.
#
# bin/ddc -- build the compiler binary.
# bin/ddci-core -- build the interactive shell for the Core languages.
# bin/ddci-tetra -- build the interactive shell for the Tetra language.
# bin/war -- build the test driver.
#
# (Running just the regression tests)
# (interactive versions)
# llvmwar -- llvm backend only version of the 'war' target.
# totalwar -- run tests in all possible ways.
#
# (non-interactive versions)
# logwar -- same as above, logging failures to war.failed.
# batchwar -- run all tests in all ways.
#
# (Working with Cabal)
# packages -- build and install all the Cabal packages.
# packages-unregister -- unregister all the Cabal packages.
#
# (Cleaning up)
# clean -- clean everything.
# clean-war -- clean libraries and tests.
# clean-runtime -- clean the runtime system.
# clean-libs -- clean the libraries
#
# -- Meta Targets -------------------------------------------------------------
# These may recursively invoke make to do several things.
# These are the ONLY instances of recursive makes in the system.
# -- Build the compiler and libs
.PHONY : all
all :
@$(MAKE) allWithConfig
# Include all the configuration.
# These need to come before all the rules after this point in the Makefile.
include make/build.mk
# Build everything related to alpha and new compiler.
# now that we have the configuration included above.
.PHONY : allWithConfig
allWithConfig :
@$(MAKE) deps
@$(MAKE) bin/ddc bin/ddci-core bin/ddci-tetra \
bin/war -j $(THREADS)
@$(MAKE) src/s2/ddc-runtime/build/libddc-runtime.a
@$(MAKE) bin/smr
# -- Build the compiler, libs, docs, and run all the tests in all ways (slow)
.PHONY : total
total :
@$(MAKE) allWithConfig
@$(MAKE) docs
@$(MAKE) batchwar
# -- Build all dependencies
.PHONY : deps
deps : make/deps/Makefile-ddc-main.deps \
make/deps/Makefile-ddci-core.deps \
make/deps/Makefile-ddci-tetra.deps \
make/deps/Makefile-war.deps
# -- What to do during the nightly builds
.PHONY : nightly
nightly :
@date
@echo
@echo " DDC Nightly build"
@echo "------------------------------------------------------------------------------------"
@$(MAKE) --version
@echo
@gcc --version
@echo
@$(GHC) --version
@echo
@alex --version
@echo
@ghc-pkg list | grep "QuickCheck\|regex-base\|regex-posix\|regex-compat\|haskell-src\|parsec\|buildbox\|text"
@echo
@sh -c 'llc --version || exit 0'
@echo
@echo "------------------------------------------------------------------------------------"
@$(MAKE) cleantotal
# -- Real Targets -------------------------------------------------------------
# These don't recursively invoke make.
#
include make/targets/bin-ddc-main.mk
include make/targets/bin-ddci-core.mk
include make/targets/bin-ddci-tetra.mk
include make/targets/bin-smr.mk
include make/targets/runtime.mk
include make/targets/docs.mk
include make/targets/war.mk
include make/targets/tarball.mk
include make/targets/clean.mk
include make/targets/libs.mk
include make/targets/setup.mk
include make/targets/packages.mk
# -- Include magic ------------------------------------------------------------
include make/rules.mk
-include runtime/*.dep
# We include Makefile.deps.inc here instead of Makefile.deps directly.
# Stupid GNU make treats missing files as dependencies, and if they are
# missing it tries to build them. This causes dependencies to be built
# even when we do a "make clean"
#
# This behavior is different to the documentation which says
# that missing -included files should be ignored.
#
-include make/deps/Makefile-ddc-main.deps.inc
-include make/deps/Makefile-ddci-core.deps.inc
-include make/deps/Makefile-ddci-tetra.deps.inc
-include make/deps/Makefile-war.deps.inc