1 --------------------------------------------------------------------------
2 -- Copyright (c) 2007-2011, 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, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
9 -- Hakefile for lib/barrelfish
11 --------------------------------------------------------------------------
13 [(let arch_dir = "arch" ./. archFamily arch
14 common_srcs = [ "capabilities.c", "init.c", "dispatch.c", "threads.c",
15 "thread_sync.c", "slab.c", "domain.c", "idc.c",
16 "waitset.c", "event_queue.c", "event_mutex.c",
17 "idc_export.c", "nameservice_client.c", "msgbuf.c",
18 "monitor_client.c", "flounder_support.c", "flounder_glue_binding.c",
19 "morecore.c", "debug.c", "heap.c", "ram_alloc.c",
20 "terminal.c", "spawn_client.c", "vspace/vspace.c",
21 "vspace/vregion.c", "vspace/memobj_one_frame.c",
22 "vspace/memobj_one_frame_lazy.c",
24 "vspace/memobj_one_frame_one_map.c", "vspace/mmu_aware.c",
25 "slot_alloc/single_slot_alloc.c", "slot_alloc/multi_slot_alloc.c",
26 "slot_alloc/slot_alloc.c", "slot_alloc/range_slot_alloc.c",
27 "bulk_transfer.c", "trace.c", "resource_ctrl.c", "coreset.c",
28 "inthandler.c", "deferred.c"
31 idc_srcs = concat $ map getsrcs $ optInterconnectDrivers $ options arch
33 getsrcs "lmp" = [ "lmp_chan.c", "lmp_endpoints.c" ]
34 getsrcs "ump" = [ "ump_chan.c", "ump_endpoint.c" ]
35 getsrcs "multihop" = [ "multihop_chan.c" ]
38 -- sources specific to the architecture family
39 archfam_srcs "x86_32" = [ "arch/x86_32/debug.c" ,
40 "arch/x86_32/dispatch.c" , "arch/x86_32/syscalls.c" ,
41 "arch/x86_32/sys_debug.c", "target/x86_32/pmap_target.c",
42 "target/x86/pmap_x86.c",
43 "vspace/arch/x86_32/layout.c" , "vspace/memobj_pinned.c" ,
44 "vspace/pinned.c", "vspace/memobj_anon.c",
45 "arch/x86/perfmon.c", "arch/x86/tls.c"]
46 archfam_srcs "x86_64" = [ "arch/x86_64/debug.c", "arch/x86_64/dispatch.c" ,
47 "arch/x86_64/syscalls.c", "arch/x86_64/sys_debug.c",
49 "target/x86_64/pmap_target.c", "target/x86/pmap_x86.c",
50 "vspace/arch/x86_64/layout.c",
51 "vspace/memobj_pinned.c", "vspace/pinned.c", "vspace/memobj_anon.c",
52 "arch/x86/perfmon.c", "arch/x86/tls.c"]
53 archfam_srcs "arm" = [ "arch/arm/debug.c", "arch/arm/dispatch.c",
54 "arch/arm/pmap_arch.c", "arch/arm/sys_debug.c",
55 "arch/arm/syscalls.c", "vspace/memobj_pinned.c" ,
56 "vspace/pinned.c", "vspace/memobj_anon.c",
57 "vspace/arch/arm/layout.c" ]
60 -- sources specific to the architecture
61 arch_srcs "scc" = [ "arch/x86/ipi_notify.c" ]
62 arch_srcs "x86_32" = [ "arch/x86/ipi_notify.c" ]
63 arch_srcs "x86_64" = [ "arch/x86/ipi_notify.c" ]
66 arch_assembly "x86_32" = [ "arch/x86_32/entry.S" ]
67 arch_assembly "x86_64" = [ "arch/x86_64/entry.S" ]
68 arch_assembly "arm" = [ "arch/arm/entry.S", "arch/arm/syscall.S" ]
72 build library { target = "barrelfish",
73 architectures = [arch],
74 cFiles = arch_srcs arch ++ archfam_srcs (archFamily arch)
75 ++ common_srcs ++ idc_srcs,
76 assemblyFiles = arch_assembly (archFamily arch),
77 flounderBindings = [ "mem", "octopus", "serial",
78 "interdisp", "spawn", "keyboard" ],
79 -- only makes sense to compile monitor binding for lmp
80 flounderTHCStubs = [ "octopus" ],
81 flounderExtraBindings = [ ("monitor", ["lmp"]),
82 ("monitor_blocking", ["lmp", "rpcclient"]),
83 ("mem", ["rpcclient"]),
84 ("octopus", ["rpcclient"]),
85 ("spawn", ["rpcclient"]),
86 ("serial", ["rpcclient"])],
87 addIncludes = [ "include", "include" ./. arch_dir ],
88 addGeneratedDependencies = [ "/include/asmoffsets.h" ]
90 ) | arch <- allArchitectures ]