From 762d575d70bcb56bbd10ebab93816c62c360c1c5 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 23 Dec 2023 18:45:40 +0200 Subject: [PATCH] AOC2023: Add program to run all days --- userspace/aoc2023/CMakeLists.txt | 1 + userspace/aoc2023/full/CMakeLists.txt | 20 ++++++++++++++++++++ userspace/aoc2023/full/main.cpp | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 userspace/aoc2023/full/CMakeLists.txt create mode 100644 userspace/aoc2023/full/main.cpp diff --git a/userspace/aoc2023/CMakeLists.txt b/userspace/aoc2023/CMakeLists.txt index cfadf996..f10e8d4f 100644 --- a/userspace/aoc2023/CMakeLists.txt +++ b/userspace/aoc2023/CMakeLists.txt @@ -19,6 +19,7 @@ set(AOC2023_PROJECTS day14 day15 day16 + full ) set(BANAN_AOC2023_BIN ${BANAN_BIN}/aoc2023) diff --git a/userspace/aoc2023/full/CMakeLists.txt b/userspace/aoc2023/full/CMakeLists.txt new file mode 100644 index 00000000..b202e739 --- /dev/null +++ b/userspace/aoc2023/full/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.26) + +project(aoc2023-full CXX) + +set(SOURCES + main.cpp +) + +add_executable(aoc2023-full ${SOURCES}) +target_compile_options(aoc2023-full PUBLIC -O2 -g) +target_link_libraries(aoc2023-full PUBLIC libc) + +add_custom_target(aoc2023-full-install + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/aoc2023-full ${BANAN_AOC2023_BIN}/full + DEPENDS aoc2023-full + DEPENDS aoc2023_always +) + +add_dependencies(aoc2023 aoc2023-full) +add_dependencies(aoc2023-install aoc2023-full-install) diff --git a/userspace/aoc2023/full/main.cpp b/userspace/aoc2023/full/main.cpp new file mode 100644 index 00000000..e27f1f6b --- /dev/null +++ b/userspace/aoc2023/full/main.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +int main() +{ + for (int i = 1; i <= 16; i++) + { + printf("day %d:\n", i); + + char command[128]; + sprintf(command, "/bin/aoc2023/day%d", i); + + system(command); + } + + return 0; +}