forked from discus-lang/ddc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
170 lines (146 loc) · 5.57 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# The DDC build system.
# (Build targets)
# all -- build the compiler and libs (default)
#
# total -- build the compiler, libs, docs and run all the tests in all ways (slow)
# cleantotal -- same as above, but do a full clean first (slowest)
#
# deps -- build dependencies (should be automatic with the 'all' target)
# 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
# bin/plate -- build the boilerplate generator
# runtime -- build the runtime system
# external -- build external libraries
# libs -- build base libraries
# docs -- build Haddock docks
#
# (Running just the quickcheck and regression tests)
# war -- run the minimal testing required before pushing patches (interactive)
# llvmwar -- llvm backend only version of the 'war' target, (interactive)
# totalwar -- run tests in all possible ways (slow, interactive)
# logwar -- same as above, logging failures to war.failed (non-interative)
# batchwar -- run all tests in all ways (slow, non-interactive)
#
# (Running code quality tools)
# hlint -- run hlint
#
# (Working with Cabal)
# packages -- build and install all the Cabal packages
# packages-unregister -- unregister all the Cabal packages.
#
# (Cleaning up)
# clean -- clean everything
# cleanWar -- clean libraries and tests
# cleanRuntime -- clean the runtime system
# cleanLibrary -- clean out 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) packages/ddc-alpha/src/Source/Lexer.hs
@$(MAKE) deps
@$(MAKE) bin/ddc-alpha bin/ddc bin/ddc-check bin/ddci-core bin/ddci-tetra \
runtime external libs bin/war -j $(THREADS)
# Build everything related to the new compiler,
# now that we have the configuration included above.
.PHONY : newWithConfig
newWithConfig :
@$(MAKE) deps-new
@$(MAKE) bin/ddc bin/ddc-check bin/ddci-core bin/ddci-tetra \
runtime-new bin/war -j $(THREADS)
# -- Build the compiler, libs, docs, and run all the tests in all ways (slow)
.PHONY : total
total :
@$(MAKE) allWithConfig
@$(MAKE) docs
@$(MAKE) batchwar
# -- Same as 'total', but do a full clean first
.PHONY : cleantotal
cleantotal :
@$(MAKE) clean
@$(MAKE) total
# -- Build all dependencies
.PHONY : deps
deps : make/deps/Makefile-ddc-alpha.deps \
make/deps/Makefile-ddc-check.deps \
make/deps/Makefile-ddc-main.deps \
make/deps/Makefile-ddci-core.deps \
make/deps/Makefile-ddci-tetra.deps \
make/deps/Makefile-war.deps
# -- Build all dependencies related to the new compiler
.PHONY : deps-new
deps-new : make/deps/Makefile-ddc-check.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/plate.mk
include make/targets/external.mk
include make/targets/runtime.mk
include make/targets/libs.mk
include make/targets/docs.mk
include make/targets/war.mk
include make/targets/lint.mk
include make/targets/tarball.mk
include make/targets/clean.mk
include make/targets/ddc-alpha.mk
include make/targets/ddc-check.mk
include make/targets/ddc-main.mk
include make/targets/ddci-core.mk
include make/targets/ddci-tetra.mk
include make/targets/helper.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-alpha.deps.inc
-include make/deps/Makefile-ddc-check.deps.inc
-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