diff --git a/userspace/CMakeLists.txt b/userspace/CMakeLists.txt index 31fdebaea6..ad24eafe7e 100644 --- a/userspace/CMakeLists.txt +++ b/userspace/CMakeLists.txt @@ -39,6 +39,8 @@ endforeach() add_custom_target(userspace) add_custom_target(userspace-install DEPENDS userspace) +add_subdirectory(aoc2023) + foreach(USERSPACE_PROJECT ${USERSPACE_PROJECTS}) target_compile_options(${USERSPACE_PROJECT} PRIVATE -g) add_dependencies(${USERSPACE_PROJECT} libc-install ban-install) diff --git a/userspace/aoc2023/CMakeLists.txt b/userspace/aoc2023/CMakeLists.txt new file mode 100644 index 0000000000..da6ee4ff09 --- /dev/null +++ b/userspace/aoc2023/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.26) + +project(aoc2023 CXX) + +set(AOC2023_PROJECTS + day1 +) + +foreach(AOC2023_PROJECT ${AOC2023_PROJECTS}) + add_subdirectory(${AOC2023_PROJECT}) +endforeach() + +add_custom_target(aoc2023) +add_custom_target(aoc2023-install DEPENDS aoc2023) + +foreach(AOC2023_PROJECT ${AOC2023_PROJECTS}) + target_compile_options(${AOC2023_PROJECT} PRIVATE -g) + add_dependencies(${AOC2023_PROJECT} libc-install ban-install ) + add_dependencies(aoc2023 ${AOC2023_PROJECT}) + add_dependencies(aoc2023-install ${AOC2023_PROJECT}-install) +endforeach() + +add_dependencies(userspace aoc2023) +add_dependencies(userspace-install aoc2023-install) diff --git a/userspace/aoc2023/day1/CMakeLists.txt b/userspace/aoc2023/day1/CMakeLists.txt new file mode 100644 index 0000000000..6290e90a20 --- /dev/null +++ b/userspace/aoc2023/day1/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.26) + +project(day1 CXX) + +set(SOURCES + main.cpp +) + +add_executable(day1 ${SOURCES}) +target_compile_options(day1 PUBLIC -O2 -g) +target_link_libraries(day1 PUBLIC libc) + +add_custom_target(day1-install + COMMAND ${CMAKE_COMMAND} -E make_directory ${BANAN_BIN}/aoc2023 + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/day1 ${BANAN_BIN}/aoc2023/ + DEPENDS day1 +) diff --git a/userspace/aoc2023/day1/main.cpp b/userspace/aoc2023/day1/main.cpp new file mode 100644 index 0000000000..a34d318387 --- /dev/null +++ b/userspace/aoc2023/day1/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() +{ + printf("hello world\n"); +}