aboutsummaryrefslogtreecommitdiff
path: root/make.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-21 03:03:58 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-21 03:03:58 +0100
commit4f93f935dc7a981ca073a322425c3f5929ffb644 (patch)
tree4460586408ec7fdfcecf3ba4584f0435067125a6 /make.c
parent72ea25a4d73e3e026366d4165f5bc4ec9e7418cb (diff)
Support line- & column-based match locations
Diffstat (limited to 'make.c')
-rw-r--r--make.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/make.c b/make.c
index 4e854dc..26a8680 100644
--- a/make.c
+++ b/make.c
@@ -17,8 +17,10 @@
#include "cbs.h"
#include "src/compat.h"
-#define CC "cc"
-#define CFLAGS "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-pipe"
+#define CC "cc"
+#define CFLAGS \
+ "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-pipe", \
+ "-Ivendor/librune/include"
#define CFLAGS_DEBUG "-DGRAB_DEBUG", "-g", "-ggdb3"
#ifdef __APPLE__
# define CFLAGS_RELEASE "-O3"
@@ -88,8 +90,20 @@ main(int argc, char **argv)
cmdprc(c);
}
} else {
+ cmd_t c = {0};
struct strv sv = {0};
+ if (chdir("./vendor/librune/") == -1)
+ die("chdir: ./vendor/librune/");
+
+ cmdadd(&c, CC, "-lpthread", "-o", "make", "make.c");
+ cmdprc(c);
+ cmdadd(&c, "./make");
+ cmdprc(c);
+
+ if (chdir("../../") == -1)
+ die("chdir: ../../");
+
env_or_default(&sv, "CC", CC);
if (dflag)
env_or_default(&sv, "CFLAGS", CFLAGS, CFLAGS_DEBUG);
@@ -114,7 +128,8 @@ main(int argc, char **argv)
cmdadd(&c, "-lpcre2-posix");
strvfree(&pc);
}
- cmdadd(&c, "-o", i == 0 ? "grab" : "git-grab", "src/grab.c");
+ cmdadd(&c, "-o", i == 0 ? "grab" : "git-grab", "src/grab.c",
+ "vendor/librune/librune.a");
cmdprc(c);
}