summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-06 13:28:32 -0500
committermidipix <writeonce@midipix.org>2016-03-08 14:21:07 -0500
commit667ce2f86fd6c3566ed8fdc38bdd66e932cba7da (patch)
treeba03526a9045a33eb882516ce8f89b9ba4fadd5c
parent9496779542d71928e605c09b4f3ffa801cd2a508 (diff)
downloadslibtool-667ce2f86fd6c3566ed8fdc38bdd66e932cba7da.tar.bz2
slibtool-667ce2f86fd6c3566ed8fdc38bdd66e932cba7da.tar.xz
driver: added context initialization for --mode.
-rw-r--r--include/slibtool/slibtool.h1
-rw-r--r--src/driver/slbt_driver_ctx.c23
2 files changed, 24 insertions, 0 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index bbb538e..ed05880 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -59,6 +59,7 @@ struct slbt_common_ctx {
uint64_t drvflags;
uint64_t actflags;
uint64_t fmtflags;
+ enum slbt_mode mode;
};
struct slbt_driver_ctx {
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index dfb8581..d9136fd 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -127,6 +127,29 @@ int slbt_get_driver_ctx(
case TAG_VERSION:
cctx.drvflags |= SLBT_DRIVER_VERSION;
break;
+
+ case TAG_MODE:
+ if (!strcmp("clean",entry->arg))
+ cctx.mode = SLBT_MODE_CLEAN;
+
+ else if (!strcmp("compile",entry->arg))
+ cctx.mode = SLBT_MODE_COMPILE;
+
+ else if (!strcmp("execute",entry->arg))
+ cctx.mode = SLBT_MODE_EXECUTE;
+
+ else if (!strcmp("finish",entry->arg))
+ cctx.mode = SLBT_MODE_FINISH;
+
+ else if (!strcmp("install",entry->arg))
+ cctx.mode = SLBT_MODE_INSTALL;
+
+ else if (!strcmp("link",entry->arg))
+ cctx.mode = SLBT_MODE_LINK;
+
+ else if (!strcmp("uninstall",entry->arg))
+ cctx.mode = SLBT_MODE_UNINSTALL;
+ break;
}
} else
nunits++;