From 7fc37dcff084460410a5ad7a3ac57f5d8bb9757f Mon Sep 17 00:00:00 2001 From: twells46 Date: Sun, 25 Jan 2026 11:05:06 -0600 Subject: Cleanup --- .gitignore | 1 - README.md | 6 ++++++ main.c | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 11 deletions(-) mode change 100644 => 100755 .gitignore create mode 100644 README.md diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 3fff87f..9ef3f39 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ bin tmp.c a.out .cache -compile_commands.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..5e93067 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Carp + +My attempt at creating a tool like Rust's `cargo` for C. +I called it `carp` because it kind of sounds like "cargo" and because carp live in the "sea" (C). + +It probably had more value as a fun and educational project than it ever did as an actual tool. diff --git a/main.c b/main.c index 13ae3ee..d40244a 100644 --- a/main.c +++ b/main.c @@ -40,7 +40,7 @@ void *create_template(void *arg) { int fd = creat(path, 00644); FILE *file = fdopen(fd, "w"); switch(path[2]) { - case 'i': + case 'i': fprintf(file, "#include \n\nint main() {\n\tprintf(\"Hello world\\n\");\n}"); break; case 'k': @@ -82,11 +82,11 @@ int main(int argc, char *argv[]) { if (argc > 1) { switch(argv[1][0]) { case 'r': break; - case 'b': - if (argc > 2) { - mode = BUILD_RELEASE; + case 'b': + if (argc > 2) { + mode = BUILD_RELEASE; files.f2 = "./bin/release"; - break; + break; } mode = BUILD; break; case 'n': @@ -120,13 +120,13 @@ int main(int argc, char *argv[]) { printf("Compiling with: \n"); switch (mode) { case BUILD_RELEASE: - execl("/usr/bin/make", "make", "release", NULL); + execl("/usr/bin/make", "make", "release", NULL); break; - case BUILD: - execl("/usr/bin/make", "make", "debug", NULL); + case BUILD: + execl("/usr/bin/make", "make", "debug", NULL); break; - default: - execl("/usr/bin/make", "make", "debug", NULL); + default: + execl("/usr/bin/make", "make", "debug", NULL); } } if (mode == RUN) printf("\n"); -- cgit v1.2.3