| # Hypervisor specific code. |
| source_set("src") { |
| sources = [ |
| "api.c", |
| "cpio.c", |
| "cpu.c", |
| "load.c", |
| "main.c", |
| "vm.c", |
| ] |
| |
| deps = [ |
| ":common", |
| ":fdt", |
| ":fdt_handler", |
| ":memiter", |
| ":mm", |
| ] |
| |
| if (is_debug) { |
| deps += [ ":common_debug" ] |
| } |
| } |
| |
| # Code that is not specific to a certain image so can be shared. |
| source_set("common") { |
| sources = [ |
| "std.c", |
| ] |
| } |
| |
| # Debug code that is not specific to a certain image so can be shared. |
| source_set("common_debug") { |
| sources = [ |
| "dlog.c", |
| ] |
| |
| deps = [ |
| ":common", |
| "//src/arch/${arch}:putchar", |
| ] |
| } |
| |
| source_set("fdt") { |
| sources = [ |
| "fdt.c", |
| ] |
| |
| deps = [ |
| ":common", |
| ":common_debug", |
| ] |
| } |
| |
| source_set("fdt_handler") { |
| sources = [ |
| "fdt_handler.c", |
| ] |
| |
| deps = [ |
| ":common", |
| ":common_debug", |
| ":fdt", |
| ] |
| } |
| |
| source_set("memiter") { |
| sources = [ |
| "memiter.c", |
| ] |
| } |
| |
| source_set("mm") { |
| sources = [ |
| "alloc.c", |
| "mm.c", |
| ] |
| |
| deps = [ |
| ":common_debug", |
| ] |
| } |
| |
| executable("unit_tests") { |
| testonly = true |
| |
| sources = [ |
| "fdt_handler_test.cc", |
| "fdt_test.cc", |
| ] |
| cflags_cc = [ "-Wno-c99-extensions" ] |
| ldflags = [ |
| "-Xlinker", |
| "-defsym=text_begin=0", |
| "-Xlinker", |
| "-defsym=text_end=100", |
| "-Xlinker", |
| "-defsym=rodata_begin=200", |
| "-Xlinker", |
| "-defsym=rodata_end=300", |
| "-Xlinker", |
| "-defsym=data_begin=400", |
| "-Xlinker", |
| "-defsym=data_end=500", |
| ] |
| deps = [ |
| ":fdt", |
| ":fdt_handler", |
| ":mm", |
| "//third_party:gtest_main", |
| ] |
| } |