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