1 --------------------------------------------------------------------------
2 -- Copyright (c) 2007-2012, ETH Zurich
3 -- All rights reserved.
5 -- This file is distributed under the terms in the attached LICENSE file.
6 -- If you do not find this file, copies can be found by writing to:
7 -- ETH Zurich D-INFK, CAB F.78, Universitaetstr. 6, CH-8092 Zurich,
8 -- Attn: Systems Group.
10 -- Hakefile for lib/barrelfish
12 --------------------------------------------------------------------------
14 [(let arch_dir = "arch" ./. archFamily arch
15 common_srcs = [ "capabilities.c", "init.c", "dispatch.c", "threads.c",
16 "thread_sync.c", "slab.c", "domain.c", "idc.c",
17 "waitset.c", "event_queue.c", "event_mutex.c",
18 "idc_export.c", "nameservice_client.c", "msgbuf.c",
19 "monitor_client.c", "flounder_support.c", "flounder_glue_binding.c",
20 "morecore.c", "debug.c", "heap.c", "ram_alloc.c",
21 "terminal.c", "spawn_client.c", "vspace/vspace.c",
22 "vspace/vregion.c", "vspace/memobj_one_frame.c",
23 "vspace/memobj_one_frame_lazy.c",
25 "vspace/memobj_one_frame_one_map.c", "vspace/mmu_aware.c",
26 "slot_alloc/single_slot_alloc.c", "slot_alloc/multi_slot_alloc.c",
27 "slot_alloc/slot_alloc.c", "slot_alloc/range_slot_alloc.c",
28 "bulk_transfer.c", "trace.c", "resource_ctrl.c", "coreset.c",
29 "inthandler.c", "deferred.c"
32 idc_srcs = concat $ map getsrcs $ optInterconnectDrivers $ options arch
34 getsrcs "lmp" = [ "lmp_chan.c", "lmp_endpoints.c" ]
35 getsrcs "ump" = [ "ump_chan.c", "ump_endpoint.c" ]
36 getsrcs "multihop" = [ "multihop_chan.c" ]
39 -- sources specific to the architecture family
40 archfam_srcs "x86_32" = [ "arch/x86_32/debug.c" ,
41 "arch/x86_32/dispatch.c" , "arch/x86_32/syscalls.c" ,
42 "arch/x86_32/sys_debug.c", "target/x86_32/pmap_target.c",
43 "target/x86/pmap_x86.c",
44 "vspace/arch/x86_32/layout.c" , "vspace/memobj_pinned.c" ,
45 "vspace/pinned.c", "vspace/memobj_anon.c",
46 "arch/x86/perfmon.c", "arch/x86/tls.c"]
47 archfam_srcs "x86_64" = [ "arch/x86_64/debug.c", "arch/x86_64/dispatch.c" ,
48 "arch/x86_64/syscalls.c", "arch/x86_64/sys_debug.c",
50 "target/x86_64/pmap_target.c", "target/x86/pmap_x86.c",
51 "vspace/arch/x86_64/layout.c",
52 "vspace/memobj_pinned.c", "vspace/pinned.c", "vspace/memobj_anon.c",
53 "arch/x86/perfmon.c", "arch/x86/tls.c"]
54 archfam_srcs "arm" = [ "arch/arm/debug.c", "arch/arm/dispatch.c",
55 "arch/arm/pmap_arch.c", "arch/arm/sys_debug.c",
56 "arch/arm/syscalls.c", "vspace/memobj_pinned.c" ,
57 "vspace/pinned.c", "vspace/memobj_anon.c",
58 "vspace/arch/arm/layout.c" ]
61 -- sources specific to the architecture
62 arch_srcs "scc" = [ "arch/x86/ipi_notify.c" ]
63 arch_srcs "x86_32" = [ "arch/x86/ipi_notify.c" ]
64 arch_srcs "x86_64" = [ "arch/x86/ipi_notify.c" ]
67 arch_assembly "x86_32" = [ "arch/x86_32/entry.S" ]
68 arch_assembly "x86_64" = [ "arch/x86_64/entry.S" ]
69 arch_assembly "arm" = [ "arch/arm/entry.S", "arch/arm/syscall.S" ]
73 build library { target = "barrelfish",
74 architectures = [arch],
75 cFiles = arch_srcs arch ++ archfam_srcs (archFamily arch)
76 ++ common_srcs ++ idc_srcs,
77 assemblyFiles = arch_assembly (archFamily arch),
78 flounderBindings = [ "mem", "octopus", "interdisp", "spawn",
80 -- only makes sense to compile monitor binding for lmp
81 flounderTHCStubs = [ "octopus" ],
82 flounderExtraBindings = [ ("monitor", ["lmp"]),
83 ("monitor_blocking", ["lmp", "rpcclient"]),
84 ("mem", ["rpcclient"]),
85 ("octopus", ["rpcclient"]),
86 ("spawn", ["rpcclient"])],
87 addIncludes = [ "include", "include" ./. arch_dir ],
88 addGeneratedDependencies = [ "/include/asmoffsets.h" ]
90 ) | arch <- allArchitectures ]