From ca7e8e5e44bca2aa89e8a5abda08daaf98a72cc9 Mon Sep 17 00:00:00 2001 From: Yuki Joou Date: Thu, 13 Jul 2023 14:22:52 +0200 Subject: [PATCH] meta: Refactoring to make room for other parts of the project --- .gitignore | 6 +++--- build.sh | 10 +++++++--- accel_monitor.c => daemon/accel_monitor.c | 0 accel_monitor.h => daemon/accel_monitor.h | 0 main.c => daemon/main.c | 0 output_manager.c => daemon/output_manager.c | 2 +- output_manager.h => daemon/output_manager.h | 2 +- .../usb_device_detection.c | 0 .../usb_device_detection.h | 0 {protocol => wayland-protos}/codegen.sh | 0 {protocol => wayland-protos}/download_protocols.sh | 0 11 files changed, 12 insertions(+), 8 deletions(-) rename accel_monitor.c => daemon/accel_monitor.c (100%) rename accel_monitor.h => daemon/accel_monitor.h (100%) rename main.c => daemon/main.c (100%) rename output_manager.c => daemon/output_manager.c (99%) rename output_manager.h => daemon/output_manager.h (93%) rename usb_device_detection.c => daemon/usb_device_detection.c (100%) rename usb_device_detection.h => daemon/usb_device_detection.h (100%) rename {protocol => wayland-protos}/codegen.sh (100%) rename {protocol => wayland-protos}/download_protocols.sh (100%) diff --git a/.gitignore b/.gitignore index 7f9f9b6..18998d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -protocol/*.c -protocol/*.h -protocol/*.xml +wayland-protos/*.c +wayland-protos/*.h +wayland-protos/*.xml *~ convertablet \ No newline at end of file diff --git a/build.sh b/build.sh index 807d201..cd124ea 100755 --- a/build.sh +++ b/build.sh @@ -2,9 +2,13 @@ set -ex; +PROTOCOL_IMPLEMENTATIONS="wayland-protos/wlr-output-management-unstable-v1.c" SOURCES="main.c output_manager.c accel_monitor.c usb_device_detection.c" -CFLAGS="-std=c2x -Wall -Wextra -pedantic $CFLAGS" -LIBS="-lwayland-client -lusb-1.0 protocol/wlr-output-management-unstable-v1.c" +CFLAGS="-std=c2x -Wall -Wextra -pedantic $CFLAGS -Iwayland-protos" +LIBS="-lwayland-client -lusb-1.0 $PROTOCOL_IMPLEMENTATIONS" OUTPUT=convertablet -clang $CFLAGS $LIBS $SOURCES -o $OUTPUT +SOURCES_PATH="" +for file in $SOURCES; do SOURCES_PATH="$SOURCES_PATH daemon/$file"; done; + +clang $CFLAGS $LIBS $SOURCES_PATH -o $OUTPUT diff --git a/accel_monitor.c b/daemon/accel_monitor.c similarity index 100% rename from accel_monitor.c rename to daemon/accel_monitor.c diff --git a/accel_monitor.h b/daemon/accel_monitor.h similarity index 100% rename from accel_monitor.h rename to daemon/accel_monitor.h diff --git a/main.c b/daemon/main.c similarity index 100% rename from main.c rename to daemon/main.c diff --git a/output_manager.c b/daemon/output_manager.c similarity index 99% rename from output_manager.c rename to daemon/output_manager.c index 120b6c6..00da816 100644 --- a/output_manager.c +++ b/daemon/output_manager.c @@ -9,7 +9,7 @@ #include #include -#include "protocol/wlr-output-management-unstable-v1.h" +#include "wlr-output-management-unstable-v1.h" static void head_handle_name(void* data, struct zwlr_output_head_v1*, diff --git a/output_manager.h b/daemon/output_manager.h similarity index 93% rename from output_manager.h rename to daemon/output_manager.h index 97ae92d..d034e7d 100644 --- a/output_manager.h +++ b/daemon/output_manager.h @@ -4,7 +4,7 @@ #include -#include "protocol/wlr-output-management-unstable-v1.h" +#include "wlr-output-management-unstable-v1.h" struct miix_wlr_head { struct zwlr_output_head_v1* wlr_head; diff --git a/usb_device_detection.c b/daemon/usb_device_detection.c similarity index 100% rename from usb_device_detection.c rename to daemon/usb_device_detection.c diff --git a/usb_device_detection.h b/daemon/usb_device_detection.h similarity index 100% rename from usb_device_detection.h rename to daemon/usb_device_detection.h diff --git a/protocol/codegen.sh b/wayland-protos/codegen.sh similarity index 100% rename from protocol/codegen.sh rename to wayland-protos/codegen.sh diff --git a/protocol/download_protocols.sh b/wayland-protos/download_protocols.sh similarity index 100% rename from protocol/download_protocols.sh rename to wayland-protos/download_protocols.sh