libbarrelfish: Refactor Hakefile to allow building multiple versions of libbf with different #defines
@@ -31,8 +31,8 @@ let common_srcs = [ "capabilities.c", "init.c", "dispatch.c", "threads.c",
"inthandler.c", "deferred.c", "syscalls.c", "sys_debug.c", "systime.c",
"notificator.c"
]
-in
-[(let arch_dir = "arch" </> archFamily arch
+ build_libbf libname arch extraDefines =
+ (let arch_dir = "arch" </> archFamily arch
idc_srcs = concat $ map getsrcs $ optInterconnectDrivers $ options arch
where
getsrcs "lmp" = [ "lmp_chan.c", "lmp_endpoints.c" ]
@@ -50,7 +50,6 @@ in
_ -> "BASE_PAGE_SIZE"
morecore_pagesize _ = "BASE_PAGE_SIZE"
-
-- sources specific to the architecture family
archfam_srcs "x86_32" = [ "arch/x86_32/debug.c" ,
"arch/x86_32/dispatch.c" , "arch/x86_32/syscalls.c" ,
@@ -128,7 +127,7 @@ in
pmap_includes _ _ = [ ]
in
- build library { target = "barrelfish",
+ build library { target = libname,
architectures = [arch],
cFiles = arch_srcs arch ++ archfam_srcs (archFamily arch)
++ common_srcs ++ idc_srcs ++ pmap_srcs (archFamily arch) Config.pmap_datastructure,
@@ -146,13 +145,19 @@ in
("spawn", ["rpcclient"]),
("proc_mgmt", ["rpcclient"]),
("arrakis", ["rpcclient"])],
- addCFlags = [ "-DMORECORE_PAGESIZE="++(morecore_pagesize arch) ],
+ addCFlags = [ "-DMORECORE_PAGESIZE="++(morecore_pagesize arch) ] ++
+ -- extra #defines provided by specialization calls below
+ [ "-D"++def | def <- extraDefines ],
addIncludes = [ "include", "include" </> arch_dir, (arch_include arch) ]
++ (pmap_includes (archFamily arch) Config.pmap_datastructure),
addGeneratedDependencies = [ "/include/asmoffsets.h" ],
addLibraries = ["cap_predicates"]
}
- ) | arch <- allArchitectures ] ++
+ )
+in
+[ (build_libbf "barrelfish" arch []) | arch <- allArchitectures ] ++
+[ (build_libbf "barrelfish_mcn" arch ["GLOBAL_MCN"]) | arch <- allArchitectures ] ++
+--[ build_libbf arch "GLOBAL_MCN" | arch <- allArchitectures ] ++
[(let arch_dir = "arch" </> archFamily arch
idc_srcs = concat $ map getsrcs $ optInterconnectDrivers $ options arch
where
