diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-01-21 12:05:12 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-01-21 12:05:12 +0100 |
commit | 360d1a1db1521b04b738697e7b13508625248288 (patch) | |
tree | e6e1c395b90596a6faa989ad9f6a5ad632a0ec45 | |
parent | 6781dd8116586b6dbed97d282a05289acce4043e (diff) |
Improve the build system
-rw-r--r-- | make.c | 8 | ||||
-rw-r--r-- | vendor/librune/make.c | 11 |
2 files changed, 8 insertions, 11 deletions
@@ -17,10 +17,8 @@ #include "cbs.h" #include "src/compat.h" -#define CC "cc" -#define CFLAGS \ - "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-pipe", \ - "-Ivendor/librune/include" +#define CC "cc" +#define CFLAGS "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-pipe" #define CFLAGS_DEBUG "-DGRAB_DEBUG", "-g", "-ggdb3" #ifdef __APPLE__ # define CFLAGS_RELEASE "-O3" @@ -118,7 +116,7 @@ main(int argc, char **argv) #ifdef __GLIBC__ cmdadd(&c, "-D_POSIX_C_SOURCE=200809L"); #endif - cmdadd(&c, buf); + cmdadd(&c, "-Ivendor/librune/include", buf); if (!Pflag) { struct strv pc = {0}; cmdadd(&c, "-DGRAB_DO_PCRE=1"); diff --git a/vendor/librune/make.c b/vendor/librune/make.c index 6248f3b..c8a2d4d 100644 --- a/vendor/librune/make.c +++ b/vendor/librune/make.c @@ -10,13 +10,11 @@ #define CC "cc" #ifdef __APPLE__ -# define CFLAGS \ - "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-pipe", "-Iinclude", \ - "-fPIC", "-O3" +# define CFLAGS "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-pipe", "-O3" #else # define CFLAGS \ - "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-pipe", "-Iinclude", \ - "-fPIC", "-O3", "-march=native", "-mtune=native" + "-Wall", "-Wextra", "-Wpedantic", "-Werror", "-pipe", "-O3", \ + "-march=native", "-mtune=native" #endif #define cmdprc(c) \ @@ -85,8 +83,9 @@ work(void *p) dst[strlen(dst) - 1] = 'o'; env_or_default(&sv, "CC", CC); + env_or_default(&sv, "CFLAGS", CFLAGS); cmdaddv(&c, sv.buf, sv.len); - cmdadd(&c, CFLAGS, "-o", dst, "-c", src); + cmdadd(&c, "-Iinclude", "-fPIC", "-o", dst, "-c", src); cmdprc(c); free(dst); |