From c9fa92e6674f93244f2268e0073aceab4f92e2b5 Mon Sep 17 00:00:00 2001 From: Nicholay Shestakov Date: Thu, 11 Dec 2025 14:05:03 +0300 Subject: [PATCH 1/9] Add hello world --- src/hello_world/hello_world.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/hello_world/hello_world.c diff --git a/src/hello_world/hello_world.c b/src/hello_world/hello_world.c new file mode 100644 index 0000000..88682ec --- /dev/null +++ b/src/hello_world/hello_world.c @@ -0,0 +1,8 @@ +#include + +int main() +{ + printf("Hello, World!\n"); + + return 0; +} From acf84a29a96d8f69c27858ed88b70d509b7b1669 Mon Sep 17 00:00:00 2001 From: Nicholay Shestakov Date: Thu, 11 Dec 2025 14:05:34 +0300 Subject: [PATCH 2/9] Add CMakeLists for hello world build --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..37cb1cd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.25) + +# Hello World +project(hello_world C) + +add_executable(hello_world src/hello_world/hello_world.c) +target_compile_options(hello_world PRIVATE -Wall -Wextra -pedantic) From 2283baaad27cd11ad54fbbc58dc9643897f83259 Mon Sep 17 00:00:00 2001 From: Nicholay Shestakov Date: Thu, 11 Dec 2025 14:06:01 +0300 Subject: [PATCH 3/9] Add build folder in gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b48d248..af47ed6 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,7 @@ Module.symvers Mkfile.old dkms.conf +#CMake +build + # End of https://www.toptal.com/developers/gitignore/api/c From 8b35d38716cbf2385bb6b380d61d36b54d5d4b32 Mon Sep 17 00:00:00 2001 From: Nicholay Shestakov Date: Thu, 11 Dec 2025 14:06:21 +0300 Subject: [PATCH 4/9] Add build instruction for hello world --- src/hello_world/build_instruction.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/hello_world/build_instruction.md diff --git a/src/hello_world/build_instruction.md b/src/hello_world/build_instruction.md new file mode 100644 index 0000000..80089c4 --- /dev/null +++ b/src/hello_world/build_instruction.md @@ -0,0 +1,5 @@ +# Build instruction +```console +$ cmake . -B build +$ cmake --build build +``` From fed30ea17a79859ca46217a4752ec9b09ce95079 Mon Sep 17 00:00:00 2001 From: Nicholay Shestakov Date: Thu, 11 Dec 2025 14:12:50 +0300 Subject: [PATCH 5/9] Delete build instruction --- src/hello_world/build_instruction.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 src/hello_world/build_instruction.md diff --git a/src/hello_world/build_instruction.md b/src/hello_world/build_instruction.md deleted file mode 100644 index 80089c4..0000000 --- a/src/hello_world/build_instruction.md +++ /dev/null @@ -1,5 +0,0 @@ -# Build instruction -```console -$ cmake . -B build -$ cmake --build build -``` From 07cdc76c6a2b9a102cfb4ca7bd284be53bda7466 Mon Sep 17 00:00:00 2001 From: Nicholay Shestakov Date: Thu, 11 Dec 2025 14:13:22 +0300 Subject: [PATCH 6/9] Add build instruction in README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 8d586e5..ab05d77 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,9 @@ Основная почта: nicholas.shestakov@gmail.com Телеграм: @Kolya_shesterka + +## Инструкции по сборке: +```console +$ cmake . -B build +$ cmake --build build +``` From bd5f8ffd79bdfa8a040d41b0135bbdb4175e429f Mon Sep 17 00:00:00 2001 From: Nicholay Shestakov Date: Thu, 11 Dec 2025 14:22:18 +0300 Subject: [PATCH 7/9] Add CMakeLists for hw 2 build --- CMakeLists.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37cb1cd..0170f6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,3 +5,27 @@ project(hello_world C) add_executable(hello_world src/hello_world/hello_world.c) target_compile_options(hello_world PRIVATE -Wall -Wextra -pedantic) + +# Fast calculation of polynomial +project(fast_calc_of_polynom C) + +add_executable(fast_calc_of_polynom src/homework_deadline_25_sep/fast_calculation_of_polynomial/fast_calculation_of_polynomial.c) +target_compile_options(fast_calc_of_polynom PRIVATE -Wall -Wextra -pedantic) + +# Incomplete quotient +project(incomplete_quotient C) + +add_executable(incomplete_quotient src/homework_deadline_25_sep/incomplete_quotient/incomplete_quotient.c) +target_compile_options(incomplete_quotient PRIVATE -Wall -Wextra -pedantic) + +# Lucky tickets +project(lucky_tickets C) + +add_executable(lucky_tickets src/homework_deadline_25_sep/lucky_tickets/lucky_tickets.c) +target_compile_options(lucky_tickets PRIVATE -Wall -Wextra -pedantic) + +# Massive reroll +project(massive_reroll C) + +add_executable(massive_reroll src/homework_deadline_25_sep/massive_reroll/massive_reroll.c) +target_compile_options(massive_reroll PRIVATE -Wall -Wextra -pedantic) From 3f48d549957b1f8ebb10cf8f9988c7f0c884f894 Mon Sep 17 00:00:00 2001 From: Nicholay Shestakov Date: Thu, 18 Dec 2025 16:20:11 +0300 Subject: [PATCH 8/9] Update CMakeLists --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37cb1cd..6e24d33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.25) +project(C_homework C) +add_compile_options(-Wall -Wextra -pedantic) -# Hello World -project(hello_world C) +# Libraries +# Executables and links with libraries add_executable(hello_world src/hello_world/hello_world.c) -target_compile_options(hello_world PRIVATE -Wall -Wextra -pedantic) From d88c955ae90d79b27da0830e91e46b5f4a92d1dd Mon Sep 17 00:00:00 2001 From: Nicholay Shestakov Date: Thu, 18 Dec 2025 16:20:11 +0300 Subject: [PATCH 9/9] Update CMakeLists --- CMakeLists.txt | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0170f6c..64688db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,31 +1,16 @@ cmake_minimum_required(VERSION 3.25) +project(C_homework C) +add_compile_options(-Wall -Wextra -pedantic) -# Hello World -project(hello_world C) +# Libraries +# Executables and links with libraries add_executable(hello_world src/hello_world/hello_world.c) -target_compile_options(hello_world PRIVATE -Wall -Wextra -pedantic) - -# Fast calculation of polynomial -project(fast_calc_of_polynom C) add_executable(fast_calc_of_polynom src/homework_deadline_25_sep/fast_calculation_of_polynomial/fast_calculation_of_polynomial.c) -target_compile_options(fast_calc_of_polynom PRIVATE -Wall -Wextra -pedantic) - -# Incomplete quotient -project(incomplete_quotient C) add_executable(incomplete_quotient src/homework_deadline_25_sep/incomplete_quotient/incomplete_quotient.c) -target_compile_options(incomplete_quotient PRIVATE -Wall -Wextra -pedantic) - -# Lucky tickets -project(lucky_tickets C) add_executable(lucky_tickets src/homework_deadline_25_sep/lucky_tickets/lucky_tickets.c) -target_compile_options(lucky_tickets PRIVATE -Wall -Wextra -pedantic) - -# Massive reroll -project(massive_reroll C) add_executable(massive_reroll src/homework_deadline_25_sep/massive_reroll/massive_reroll.c) -target_compile_options(massive_reroll PRIVATE -Wall -Wextra -pedantic)