From 10379fdde9fa5e94a955fe35f14e5b35de2a0e5d Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 11 Feb 2025 06:28:17 +0100 Subject: chore: Makefile --- .gitignore | 6 ++---- CMakeLists.txt | 3 ++- Makefile | 9 +++++++++ README.md | 3 +++ log.c | 2 +- vec.c | 4 ---- 6 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 Makefile create mode 100644 README.md diff --git a/.gitignore b/.gitignore index e7ea508..58c83ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ main -cmake_install.cmake -Makefile -CMakeFiles/ -CMakeCache.txt +Debug/ +Release/ diff --git a/CMakeLists.txt b/CMakeLists.txt index c94bd65..ddba94b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.30.5) project(kagamic VERSION 0.1 LANGUAGES C) +set(CMAKE_C_STANDARD 17) add_executable(main main.c string.h string.c @@ -9,4 +10,4 @@ add_executable(main log.h log.c ) target_link_libraries(main m) -target_compile_options(main PRIVATE -Wall) +target_compile_options(main PRIVATE -Wall -pedantic -Wextra) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..71dea2a --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +debug: + cd Debug; \ + cmake -DCMAKE_BUILD_TYPE=Debug ..; \ + make; + +release: + cd Release; \ + cmake -DCMAKE_BUILD_TYPE=Release ..; \ + make; diff --git a/README.md b/README.md new file mode 100644 index 0000000..431a2d0 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Kagamic + +## TODO diff --git a/log.c b/log.c index 9a3211f..76bee11 100644 --- a/log.c +++ b/log.c @@ -8,4 +8,4 @@ void info(Logger l, const char *name, const char *str, ...) { printf(str); printf("\n"); } -}; +} diff --git a/vec.c b/vec.c index 6962d03..58977dc 100644 --- a/vec.c +++ b/vec.c @@ -1,4 +1,3 @@ -#include #include #include "vec.h" @@ -14,9 +13,6 @@ Vec *_Vec_new(Arena *a, int size, ptrdiff_t cap, int align) { } Vec *Vec_push(Arena *a, Vec *v, void *data) { - // printf("push: dest=%p, src=%p, size=%d\n", v->data + v->len * v->size, - // data, - // v->size); if (v->len == v->cap) { void *cpy = alloc(a, v->cap * 2, v->size, v->align); memcpy(cpy, v->data, v->len * v->size); -- cgit v1.3