diff --git a/Makefile.in b/Makefile.in index 0957e32..d8ae066 100644 --- a/Makefile.in +++ b/Makefile.in @@ -86,10 +86,10 @@ include $(PROJECT_DIR)/project/overrides.mk $(APP_SRCS:%.c=%.o): version.tag $(APP_SRCS:%.c=%.o): CFLAGS_STATIC = $(CFLAGS_APP) -src/%.lo: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag +src/%.lo: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag version.tag $(CC) -c -o $@ $< $(CFLAGS_SHARED) -src/%.o: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag +src/%.o: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag version.tag $(CC) -c -o $@ $< $(CFLAGS_STATIC) lib/%$(OS_LIB_SUFFIX)$(VER_XYZ): diff --git a/include/perk/perk.h b/include/perk/perk.h index a99c8f4..d6f69ec 100644 --- a/include/perk/perk.h +++ b/include/perk/perk.h @@ -46,6 +46,13 @@ extern "C" { /* unit action flags */ #define PERK_ACTION_MAP_READWRITE 0x0001 +struct pe_source_version { + int major; + int minor; + int revision; + const char * commit; +}; + struct pe_raw_image { void * addr; size_t size; @@ -149,6 +156,9 @@ struct pe_unit_ctx { int nerrors; }; +/* package info */ +perk_api const struct pe_source_version * pe_source_version(void); + /* driver api */ perk_api int pe_get_driver_ctx (char ** argv, char ** envp, uint32_t flags, struct pe_driver_ctx **); perk_api void pe_free_driver_ctx (struct pe_driver_ctx *); diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c index c580ca7..59e5c35 100644 --- a/src/driver/pe_driver_ctx.c +++ b/src/driver/pe_driver_ctx.c @@ -12,9 +12,18 @@ #include #include +#include "perk_version.h" #include "perk_driver_impl.h" #include "argv/argv.h" +/* package info */ +static const struct pe_source_version pe_src_version = { + PERK_TAG_VER_MAJOR, + PERK_TAG_VER_MINOR, + PERK_TAG_VER_PATCH, + PERK_GIT_VERSION +}; + struct pe_driver_ctx_alloc { struct argv_meta * meta; struct pe_driver_ctx_impl ctx; @@ -228,3 +237,8 @@ void pe_free_driver_ctx(struct pe_driver_ctx * ctx) pe_free_driver_ctx_impl(ictx); } } + +const struct pe_source_version * pe_source_version(void) +{ + return &pe_src_version; +}