-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathHakefile
128 lines (126 loc) · 4.8 KB
/
Hakefile
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
----------------------------------------------------------------------
-- Copyright (c) 2009, 2011, 2012, ETH Zurich.
-- All rights reserved.
--
-- This file is distributed under the terms in the attached LICENSE file.
-- If you do not find this file, copies can be found by writing to:
-- ETH Zurich D-INFK CAB F.78, Universitaetstr 6, CH-8092 Zurich.
-- Attn: Systems Group.
--
-- Hakefile for /hake
--
----------------------------------------------------------------------
let
hsInDir af tf dir = inDir af tf dir ".hs"
hakesrc = find hsInDir "."
hake_rtsopts = "-H128M -A4M -N4"
in
[ Rule ([ Str "ghc -O --make",
Str "-XDeriveDataTypeable",
Str "-XStandaloneDeriving",
Str "-XScopedTypeVariables",
Str "-package ghc",
Str "-package ghc-mtl",
Str "-package ghc-paths",
Str "-package bytestring-trie",
Str "-o", Out "hake" "/hake",
Str "-outputdir", NoDep BuildTree "root" "/hake",
NStr "-i", NoDep SrcTree "src" "",
NStr "-i", NoDep BuildTree "hake" "/",
Str "-rtsopts=all",
Str ("-with-rtsopts=\"" ++ hake_rtsopts ++ "\""),
Str "-threaded",
In SrcTree "src" "Main.hs",
Dep InstallTree "" "Config.hs",
Str "$(LDFLAGS)"
]
++ [Dep SrcTree "src" f | f <- hakesrc]),
-- Copy files required for interpreting Hakefiles
includeFile [
"ArchDefaults.hs",
"Args.hs",
"HakeTypes.hs",
"RuleDefs.hs",
"Tools.hs",
"TreeDB.hs",
"ARMv7.hs",
"ARMv8.hs",
"K1om.hs",
"X86_64.hs"
],
Phony "help" False $ concat [ [Str "@echo", Str ("\"" ++ x ++ "\""), NL] | x <- [
"------------------------------------------------------------------"
,"This is the 'help' target for the Barrelfish Makefile. This Makefile"
,"has been generated by hake in the top-level directory of your build tree."
,"See the Hake documentation for more information."
,""
,"This Makefile contains build targets for the following architectures:"
,""
, (Data.List.intercalate ", " Config.architectures)
,""
,"To change configuration options, edit the Config.hs file in the hake"
,"subdirectory of this directory and run 'make Makefile'."
,""
,"Useful make targets:"
," - <file>: any file which can be built in the Barrelfish tree"
," - 'help': show this help text"
," - 'help-platforms': show the platforms (file collections) which can be built"
," - 'help-boot': show the boot sequences which can be initiated"
," - 'help-tests': show the available tests"
," - 'clean': remove most generated files"
," - 'realclean': remove all generated files (clears the build tree)"
," - 'Documentation': build all Technical Notes"
," - 'Makefile': attempt to re-run hake"
,""
] ],
Phony "help-platforms-header" False $ concat [ [Str "@echo", Str ("\"" ++ x ++ "\""), NL] | x <- [
"------------------------------------------------------------------"
,"Platforms supported by this Makefile. Use 'make <platform name>':"
," (these are the platforms available with your architecture choices)"
] ],
Phony "help-boot-header" False $ concat [ [Str "@echo", Str ("\"" ++ x ++ "\""), NL] | x <- [
"------------------------------------------------------------------"
,"Boot instructions supported by this Makefile. Use 'make <boot name>':"
," (these are the targets available with your architecture choices)"
,""
] ],
Phony "clean" False (
[ Str "$(RM)", Str "-r", Str "tools", Str "docs" ] ++
(map Str Config.architectures) ++
[ Dep BuildTree "root" "/clean-platform" ]),
-- Legacy target for scalebench to install modules
Phony "install" False ([
Dep BuildTree "root" "/$(MODULES)",
Str "@echo \"\";",
Str "echo \"Installing modules...\" ;",
Str "if [ $${#MODULES[@]} -eq 0 ]; then",
Str " echo \" > Modules is empty, did you mean install_X86_64_Basic? \" ;",
Str " exit 0;",
Str "fi;",
Str "for m in ${MODULES}; do",
Str " if [ ! -f ${INSTALL_PREFIX}/$$m ] ||",
Str " [ $$(stat -c%Y $$m) -ne $$(stat -c%Y ${INSTALL_PREFIX}/$$m) ]; then",
Str " do_update=1;",
Str " echo \" > Installing $$m\" ;",
Str " mkdir -p ${INSTALL_PREFIX}/$$(dirname $$m);",
Str " install -p $$m ${INSTALL_PREFIX}/$$m;",
Str " fi;",
Str "done;",
Str "if [ ! $$do_update ]; then",
Str " echo \" > All up to date\" ;",
Str "fi;",
Str "echo \"\";",
Str "echo \"done.\" ;"
]),
Rule ([
Str "sed -r",
Str "'s#@CMAKE_SOURCE_DIR@#${SRCDIR}#g'",
In SrcTree "root" "/doc/Doxyfile.cmake",
Str ">",
Out "root" "/Doxyfile"
]),
Phony "doxygen" False ([
Str "doxygen",
In BuildTree "root" "/Doxyfile"
])
]