commit fd1ab5879d8137fe79d26f6629aae06fdf5f9775
parent 8dd075e71c00a9d294d6f7ee15923ded6fa7830d
Author: Joris Vink <joris@coders.se>
Date: Wed, 28 Nov 2018 14:24:42 +0100
KODEV_OUTPUT tells kodev the outdir of the binary.
eg:
$ env KODEV_OUTPUT=/tmp kodev build
will place the resulting binary under /tmp/<binary>
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/cli.c b/src/cli.c
@@ -387,6 +387,7 @@ static int cflags_count = 0;
static int cxxflags_count = 0;
static int ldflags_count = 0;
static char *flavor = NULL;
+static char *out_dir = ".";
static char *object_dir = ".objs";
static char *cflags[CFLAGS_MAX];
static char *cxxflags[CXXFLAGS_MAX];
@@ -425,6 +426,9 @@ main(int argc, char **argv)
if ((env = getenv("KORE_OBJDIR")) != NULL)
object_dir = env;
+ if ((env = getenv("KODEV_OUTPUT")) != NULL)
+ out_dir = env;
+
(void)umask(S_IWGRP | S_IWOTH);
for (i = 0; cmds[i].name != NULL; i++) {
@@ -1465,9 +1469,9 @@ cli_link_application(void *arg)
bopt = arg;
if (bopt->single_binary)
- (void)cli_vasprintf(&output, "%s", appl);
+ (void)cli_vasprintf(&output, "%s/%s", out_dir, appl);
else
- (void)cli_vasprintf(&output, "%s.so", appl);
+ (void)cli_vasprintf(&output, "%s/%s.so", out_dir, appl);
idx = 0;
args[idx++] = compiler_ld;