-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathArgs.hs
140 lines (130 loc) · 5.15 KB
/
Args.hs
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
--------------------------------------------------------------------------
-- Copyright (c) 2007-2015 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, Universitaetstasse 6, CH-8092 Zurich. Attn: Systems Group.
--
-- Arguments to major Hake targets
--
--------------------------------------------------------------------------
module Args where
import HakeTypes
import TreeDB
import Data.Maybe as Maybe
data Args = Args {
buildFunction :: TreeDB -> String -> Args -> HRule,
target :: String,
driverType :: String,
cFiles :: [String],
generatedCFiles :: [String],
cxxFiles :: [String],
generatedCxxFiles :: [String],
assemblyFiles :: [String],
flounderDefs :: [String],
flounderBindings :: [String], -- built stubs for all enabled backends
flounderExtraDefs :: [(String, [String])],
flounderExtraBindings :: [(String, [String])], -- build stubs for specific backends
flounderTHCDefs :: [String], -- TODO: this can probably be subsumed into the above?
flounderTHCStubs :: [String], -- TODO: this can probably be subsumed into the above?
mackerelDevices :: [String],
addCFlags :: [String],
addCxxFlags :: [String],
omitCFlags :: [String],
omitCxxFlags :: [String],
addIncludes :: [String],
addGeneratedIncludes :: [String],
omitIncludes :: [String],
addLinkFlags :: [String],
addLibraries :: [String],
addModules :: [String],
addGeneratedDependencies :: [String],
architectures :: [String],
skateSchemaDefs :: [String], -- just the Skate Schema headers
skateSchemas :: [String], -- Schema headers and functions
installDirs :: InstallDirs,
libraryOs :: Maybe Args -- Select a library OS
}
data InstallDirs = InstallDirs {
bindir :: String,
libdir :: String
}
defaultArgs = Args {
buildFunction = defaultBuildFn,
target = "",
driverType = "",
cFiles = [],
generatedCFiles = [],
cxxFiles = [],
generatedCxxFiles = [],
assemblyFiles = [],
flounderDefs = [],
flounderBindings = [],
flounderExtraDefs = [],
flounderExtraBindings = [],
flounderTHCDefs = [],
flounderTHCStubs = [],
mackerelDevices = [],
addCFlags = [],
addCxxFlags = [],
omitCFlags = [],
omitCxxFlags = [],
addIncludes = [],
addGeneratedIncludes = [],
omitIncludes = [],
addLinkFlags = [],
addLibraries = [],
addModules = [],
addGeneratedDependencies = [],
architectures = allArchitectures,
skateSchemaDefs = [],
skateSchemas = [],
installDirs = InstallDirs {
bindir = "/sbin",
libdir = "/lib"
},
-- default libos needs to be selected in application macro!
libraryOs = Maybe.Nothing
}
makeTarget :: Maybe Args -> String
makeTarget args = Args.target (Maybe.fromJust args)
allArchitectures = [ "armv8" ]
allArchitectureFamilies = [ "arm" ]
-- architectures that currently support THC
thcArchitectures = [ ]
-- all known flounder backends that we might want to generate defs for
allFlounderBackends
= [ "lmp", "ump", "ump_ipi", "loopback", "rpcclient", "msgbuf", "multihop", "ahci", "local" ]
defaultBuildFn :: TreeDB -> String -> Args -> HRule
defaultBuildFn _ f _ =
Error ("Bad use of default Args in " ++ f)
showArgs :: String -> Args -> String
showArgs prefix a =
prefix ++ "Args:"
++ "\n target: " ++ (show $ target a)
++ "\n cFiles: " ++ (show $ cFiles a)
++ "\n generatedCFiles: " ++ (show $ generatedCFiles a)
++ "\n cxxFiles: " ++ (show $ cxxFiles a)
++ "\n generatedCxxFiles " ++ (show $ generatedCxxFiles a)
++ "\n assemblyFiles: " ++ (show $ assemblyFiles a)
++ "\n flounderDefs: " ++ (show $ flounderDefs a)
++ "\n flounderBindings: " ++ (show $ flounderBindings a)
++ "\n flounderExtraDefs: " ++ (show $ flounderExtraDefs a)
++ "\n flounderExtraBindings: " ++ (show $ flounderExtraBindings a)
++ "\n flounderTHCDefs: " ++ (show $ flounderTHCDefs a)
++ "\n flounderTHCStubs: " ++ (show $ flounderTHCStubs a)
++ "\n addCFlags: " ++ (show $ addCFlags a)
++ "\n addCxxFlags: " ++ (show $ addCxxFlags a)
++ "\n omitCFlags: " ++ (show $ omitCFlags a)
++ "\n omitCxxFlags: " ++ (show $ omitCxxFlags a)
++ "\n addIncludes: " ++ (show $ addIncludes a)
++ "\n omitIncludes: " ++ (show $ omitIncludes a)
++ "\n addLinkFlags: " ++ (show $ addLinkFlags a)
++ "\n addLibraries: " ++ (show $ addLibraries a)
++ "\n addModules: " ++ (show $ addModules a)
++ "\n addDeps: " ++ (show $ addGeneratedDependencies a)
++ "\n architectures: " ++ (show $ architectures a)
++ "\n skateSchemaDefs: " ++ (show $ skateSchemaDefs a)
++ "\n skateSchemas: " ++ (show $ skateSchemas a)
++ "\n"