diff --git a/.gitignore b/.gitignore index e4bc8a84648fe95450e4ee3d47cfa189d3bb4674..9df9018c8c85387c8ebace5789fded624f09ce81 100644 --- a/.gitignore +++ b/.gitignore @@ -62,7 +62,6 @@ CMakeCache.txt CMakeFiles CMakeScripts Testing -Makefile cmake_install.cmake install_manifest.txt compile_commands.json diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..a13c90df453d1f6af52b406ca25b96e2584520d3 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +CMAKE_BUILD_DIR = build + +BINARY_DIR = /usr/bin +SYSTEMD_DIR = /etc/systemd/system + +DAEMON = daemon +CLIENTS = dummy cpu_temp + +SYSTEM_NAME = sibyl + +all: build install + +build: + mkdir -p $(CMAKE_BUILD_DIR) + cd $(CMAKE_BUILD_DIR) && cmake .. + cd $(CMAKE_BUILD_DIR) && make + +install: + install -m 755 $(CMAKE_BUILD_DIR)/$(DAEMON)/$(DAEMON) $(BINARY_DIR)/$(SYSTEM_NAME)-$(DAEMON) + + $(foreach client, $(CLIENTS), install -m 755 $(CMAKE_BUILD_DIR)/clients/$(client)/$(client) $(BINARY_DIR)/$(SYSTEM_NAME)-$(subst _,-,$(client));) + + install -m 644 systemd/$(SYSTEM_NAME)-$(DAEMON).service $(SYSTEMD_DIR)/$(SYSTEM_NAME)-$(DAEMON).service + + $(foreach client, $(CLIENTS), install -m 644 systemd/clients/$(SYSTEM_NAME)-$(subst _,-,$(client)).service $(SYSTEMD_DIR)/$(SYSTEM_NAME)-$(subst _,-,$(client)).service;) + +uninstall: + rm -f $(BINARY_DIR)/$(SYSTEM_NAME)-$(DAEMON) + + $(foreach client, $(CLIENTS), rm -f $(BINARY_DIR)/$(SYSTEM_NAME)-$(subst _,-,$(client));) + + rm -f $(SYSTEMD_DIR)/$(SYSTEM_NAME)-$(DAEMON).service + + $(foreach client, $(CLIENTS), rm -f $(SYSTEMD_DIR)/$(SYSTEM_NAME)-$(subst _,-,$(client)).service;) + +clean: + rm -rf $(CMAKE_BUILD_DIR) diff --git a/README.md b/README.md index 541e574dcd87c251e091a89c4ecea420ce504d92..0c3368d9f690bd5ae0585797b3072d02f77a30c0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Embedded Linux Project (sibyl) +# Embedded Linux Project (Sibyl) ## Building diff --git a/systemd/clients/cpu-temp.service b/systemd/clients/cpu-temp.service deleted file mode 100644 index 139256679e82c9466d6d7fa537a702c935b89dcc..0000000000000000000000000000000000000000 --- a/systemd/clients/cpu-temp.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=CPU Temp -After=daemon.service - -[Service] -ExecStart=/usr/bin/cpu-temp 2 250 -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/systemd/clients/dummy.service b/systemd/clients/dummy.service deleted file mode 100644 index 9c75c1d7ef47426ee174adf4fa459227258a0e37..0000000000000000000000000000000000000000 --- a/systemd/clients/dummy.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Dummy -After=daemon.service - -[Service] -ExecStart=/usr/bin/dummy 1 250 -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/systemd/clients/sibyl-cpu-temp.service b/systemd/clients/sibyl-cpu-temp.service new file mode 100644 index 0000000000000000000000000000000000000000..bd55b4e906b4fd540216b70d3f66abbe6cb1ced8 --- /dev/null +++ b/systemd/clients/sibyl-cpu-temp.service @@ -0,0 +1,11 @@ +[Unit] +Description=Sibyl Client CPU Temperature +Wants=sibyl-daemon.service +After=sibyl-daemon.service + +[Service] +ExecStart=/usr/bin/sibyl-cpu-temp 2 250 +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/systemd/clients/sibyl-dummy.service b/systemd/clients/sibyl-dummy.service new file mode 100644 index 0000000000000000000000000000000000000000..fc17eb2f192cd5d6fe1ca4d5d3f990ee5fd2888b --- /dev/null +++ b/systemd/clients/sibyl-dummy.service @@ -0,0 +1,11 @@ +[Unit] +Description=Sibyl Client Dummy +Wants=sibyl-daemon.service +After=sibyl-daemon.service + +[Service] +ExecStart=/usr/bin/sibyl-dummy 1 250 +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/systemd/daemon.service b/systemd/sibyl-daemon.service similarity index 61% rename from systemd/daemon.service rename to systemd/sibyl-daemon.service index d8e294a6e549c141c8b464543c94d80195c072a7..75ed27db6bd8a92f175bbc7325194eec8aff661f 100644 --- a/systemd/daemon.service +++ b/systemd/sibyl-daemon.service @@ -1,9 +1,9 @@ [Unit] -Description=Daemon +Description=Sibyl Daemon After=network.target [Service] -ExecStart=/usr/bin/daemon +ExecStart=/usr/bin/sibyl-daemon Restart=always [Install]