manager: move code to subdirectory
The root has become pretty cluttered. Move code for the primary
manager application to a subdirectory.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I8503cf08c72750c88a5ce94a4d94671d6b59aafb
diff --git a/group.cpp b/manager/group.cpp
similarity index 100%
rename from group.cpp
rename to manager/group.cpp
diff --git a/group.hpp b/manager/group.hpp
similarity index 100%
rename from group.hpp
rename to manager/group.hpp
diff --git a/json-config.hpp b/manager/json-config.hpp
similarity index 100%
rename from json-config.hpp
rename to manager/json-config.hpp
diff --git a/json-parser.hpp b/manager/json-parser.hpp
similarity index 100%
rename from json-parser.hpp
rename to manager/json-parser.hpp
diff --git a/lamptest.cpp b/manager/lamptest/lamptest.cpp
similarity index 100%
rename from lamptest.cpp
rename to manager/lamptest/lamptest.cpp
diff --git a/lamptest.hpp b/manager/lamptest/lamptest.hpp
similarity index 100%
rename from lamptest.hpp
rename to manager/lamptest/lamptest.hpp
diff --git a/led-main.cpp b/manager/led-main.cpp
similarity index 98%
rename from led-main.cpp
rename to manager/led-main.cpp
index bebe5dd..c3b2cea 100644
--- a/led-main.cpp
+++ b/manager/led-main.cpp
@@ -11,7 +11,7 @@
#include "serialize.hpp"
#include "utils.hpp"
#ifdef USE_LAMP_TEST
-#include "lamptest.hpp"
+#include "lamptest/lamptest.hpp"
#endif
#include <sdeventplus/event.hpp>
diff --git a/ledlayout.hpp b/manager/ledlayout.hpp
similarity index 100%
rename from ledlayout.hpp
rename to manager/ledlayout.hpp
diff --git a/manager.cpp b/manager/manager.cpp
similarity index 100%
rename from manager.cpp
rename to manager/manager.cpp
diff --git a/manager.hpp b/manager/manager.hpp
similarity index 100%
rename from manager.hpp
rename to manager/manager.hpp
diff --git a/manager/meson.build b/manager/meson.build
new file mode 100644
index 0000000..b3eddeb
--- /dev/null
+++ b/manager/meson.build
@@ -0,0 +1,38 @@
+sources = [
+ 'group.cpp',
+ 'led-main.cpp',
+ 'manager.cpp',
+ 'serialize.cpp',
+ '../utils.cpp',
+]
+
+if get_option('use-json').disabled()
+ led_gen_hpp = custom_target(
+ 'led-gen.hpp',
+ command : [
+ prog_python,
+ meson.project_source_root() + '/scripts/parse_led.py',
+ '-i', meson.project_source_root(),
+ '-o', meson.current_build_dir(),
+ ],
+ output : 'led-gen.hpp')
+ sources += [led_gen_hpp]
+endif
+
+if get_option('use-lamp-test').enabled()
+ conf_data.set_quoted('LAMP_TEST_OBJECT', '/xyz/openbmc_project/led/groups/lamp_test')
+ conf_data.set_quoted('HOST_LAMP_TEST_OBJECT', '/xyz/openbmc_project/led/groups/host_lamp_test')
+ conf_data.set_quoted('LAMP_TEST_LED_OVERRIDES_JSON', '/usr/share/phosphor-led-manager/lamp-test-led-overrides.json')
+ conf_data.set('LAMP_TEST_TIMEOUT_IN_SECS', 240)
+
+ sources += ['lamptest/lamptest.cpp']
+endif
+
+executable(
+ 'phosphor-ledmanager',
+ sources,
+ include_directories: ['..'],
+ dependencies: deps,
+ install: true,
+ install_dir: get_option('bindir')
+)
diff --git a/serialize.cpp b/manager/serialize.cpp
similarity index 100%
rename from serialize.cpp
rename to manager/serialize.cpp
diff --git a/serialize.hpp b/manager/serialize.hpp
similarity index 100%
rename from serialize.hpp
rename to manager/serialize.hpp
diff --git a/meson.build b/meson.build
index 9e7990a..84cb8dc 100644
--- a/meson.build
+++ b/meson.build
@@ -91,35 +91,8 @@
cereal_dep,
]
-sources = [
- 'group.cpp',
- 'led-main.cpp',
- 'manager.cpp',
- 'serialize.cpp',
- 'utils.cpp',
-]
-
-if get_option('use-json').disabled()
- led_gen_hpp = custom_target(
- 'led-gen.hpp',
- command : [
- prog_python,
- meson.project_source_root() + '/scripts/parse_led.py',
- '-i', meson.project_source_root(),
- '-o', meson.current_build_dir(),
- ],
- output : 'led-gen.hpp')
- sources += [led_gen_hpp]
-endif
-
-if get_option('use-lamp-test').enabled()
- conf_data.set_quoted('LAMP_TEST_OBJECT', '/xyz/openbmc_project/led/groups/lamp_test')
- conf_data.set_quoted('HOST_LAMP_TEST_OBJECT', '/xyz/openbmc_project/led/groups/host_lamp_test')
- conf_data.set_quoted('LAMP_TEST_LED_OVERRIDES_JSON', '/usr/share/phosphor-led-manager/lamp-test-led-overrides.json')
- conf_data.set('LAMP_TEST_TIMEOUT_IN_SECS', 240)
-
- sources += ['lamptest.cpp']
-endif
+subdir('manager')
+subdir('fault-monitor')
configure_file(output: 'config.h',
configuration: conf_data
@@ -130,16 +103,6 @@
install_dir: get_option('bindir')
)
-executable(
- 'phosphor-ledmanager',
- sources,
- implicit_include_directories: true,
- dependencies: deps,
- install: true,
- install_dir: get_option('bindir')
-)
-subdir('fault-monitor')
-
build_tests = get_option('tests')
if not build_tests.disabled()
subdir('test')
diff --git a/test/meson.build b/test/meson.build
index ee3abfc..18c1192 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -20,8 +20,8 @@
endif
test_sources = [
- '../manager.cpp',
- '../serialize.cpp',
+ '../manager/manager.cpp',
+ '../manager/serialize.cpp',
'../utils.cpp'
]
@@ -34,11 +34,11 @@
foreach t : tests
test(t, executable(t.underscorify(), t,
test_sources,
- include_directories: ['..'],
+ include_directories: ['..', '../manager'],
dependencies: [
gtest_dep,
gmock_dep,
deps
]),
workdir: meson.current_source_dir())
-endforeach
\ No newline at end of file
+endforeach