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++;