proc_mgmt: fixed several dependency issues
[barrelfish] / usr / monitor / Hakefile
1 --------------------------------------------------------------------------
2 -- Copyright (c) 2007-2010, ETH Zurich.
3 -- All rights reserved.
4 --
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.
8 --
9 -- Hakefile for /usr/monitor
10 --
11 --------------------------------------------------------------------------
12
13 [(let
14      arch_dir = "arch" </> archFamily arch
15
16      arch_dirs "x86_32" = [ arch_dir, "arch/x86" ]
17      arch_dirs "x86_64" = [ arch_dir, "arch/x86" ]
18      arch_dirs "k1om"   = [ arch_dir, "arch/x86" ]
19      arch_dirs _        = [ arch_dir ]
20
21      common_srcs = [ "trace_support.c", "bfscope_support.c", "ram_alloc.c", "inter.c", "spawn.c", "invocations.c", "iref.c",
22                      "main.c", "monitor_server.c", "monitor_rpc_server.c",
23                      "boot.c", "queue.c", "domain.c", "intermon_bindings.c",
24                      "resource_ctrl.c", "timing.c", "send_cap.c", "octopus_client.c",
25                      "capops/capsend.c", "capops/capqueue.c", "capops/internal.c",
26                      "capops/caplock.c", "capops/copy.c", "capops/move.c",
27                      "capops/retrieve.c", "capops/delete.c", "capops/revoke.c",
28                      "capops/retype.c", "capops/init.c", "capops/deletestep.c" ]
29
30      arch_srcs "x86_32"  = [ "arch/x86/boot.c", "arch/x86/inter.c", "arch/x86/monitor_server.c", "arch/x86/notify_ipi.c" ]
31      arch_srcs "x86_64"  = [ "arch/x86/boot.c", "arch/x86/inter.c", "arch/x86/monitor_server.c", "arch/x86/notify_ipi.c" ]
32      arch_srcs "k1om"    = [ "arch/x86/boot.c", "arch/x86/inter.c", "arch/x86/monitor_server.c", "arch/x86/notify_ipi.c" ]
33      arch_srcs "armv7"   = [ "arch/armv7/boot.c", "arch/armv7/inter.c", "arch/armv7/monitor_server.c", "arch/armv7/notify_ipi.c" ]
34      arch_srcs "armv8"   = [ "arch/armv8/boot.c", "arch/armv8/inter.c", "arch/armv8/monitor_server.c", "arch/armv8/notify_ipi.c" ]
35      arch_srcs _         = []
36
37      idc_srcs = concat $ map getsrcs $ optInterconnectDrivers $ options arch
38           where
39             getsrcs "ump" = [ "ump_support.c" ]
40             getsrcs "multihop" = [ "multihop_support.c" ]
41             getsrcs _     = []
42             
43      idc_libraries = concat $ map getsrcs $ optInterconnectDrivers $ options arch
44           where
45             getsrcs "multihop" = [ "collections" ]
46             getsrcs _     = []
47                      
48   in
49     build application { target = "monitor",
50                         architectures = [arch],
51                         cFiles = common_srcs ++ arch_srcs arch ++ idc_srcs,
52                         flounderDefs = [ "mem", "monitor", "monitor_blocking", "proc_mgmt" ],
53                         flounderBindings = [ "monitor_mem", "intermon" ],
54                         flounderExtraBindings = [ ("monitor", ["loopback"]),
55                                                   ("monitor_mem", ["rpcclient"]),
56                                                   ("mem", ["rpcclient"]),
57                                                   ("proc_mgmt", ["rpcclient"]),
58                                                   ("octopus", ["rpcclient"]) ],
59                         addLinkFlags = [ "-e _start_init" ],
60                         addIncludes = "include" : [ "include" </> a | a <- arch_dirs arch ],
61                         addLibraries = (
62                             [ "spawndomain", "bench", "trace", "elf", "cap_predicates" ]
63                             ++ idc_libraries)
64                       }
65  ) | arch <- allArchitectures ]