aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--].gitignore1
-rw-r--r--README.md6
-rw-r--r--main.c20
3 files changed, 16 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 3fff87f..9ef3f39 100644..100755
--- 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 <stdio.h>\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");