Skip to content

Commit

Permalink
-Use git tag and latest commit as version value
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-gomez-windhover committed Oct 17, 2024
1 parent ed160db commit 4b03cbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ UT_SRC_32 := $(wildcard $(UT_SRC_DIR)/test_file*.cpp)
UT_OBJ_32 := $(UT_SRC_32:$(UT_SRC_DIR)/test_file%.cpp=$(UT_OBJ_32BIT_DIR)/test_file%.o)
UT_OBJ_32 := $(UT_OBJ_32:$(UT_SRC_DIR)/test_file%.cpp=$(UT_OBJ_32BIT_DIR)/test_file%.o)

GIT_VERSION := "$(shell git describe --tags --abbrev=0)($(shell git rev-parse --short HEAD))"


# Set target flags
CPPFLAGS := -MMD -MP -std=c++17 -fmessage-length=0 $(INCLUDES)
CFLAGS := -Wall -g3
CFLAGS := -Wall -g3 -DJUICER_VERSION=\"$(GIT_VERSION)\"
CFLAGS_32BIT := -Wall -g3 -m32
LDFLAGS := -Llib
LDLIBS := -lm -ldwarf -lsqlite3 -lelf -lcrypto
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include "TestSymbolsA.h"
#include "TestSymbolsB.h"

const char *argp_program_version = "juicer 0.1";
const char *argp_program_version = JUICER_VERSION; // JUICER_VERSION macro is generated by build
const char *argp_program_bug_address = "<mbenson@windhoverlabs.com>";

/* Program documentation. */
Expand All @@ -56,7 +56,7 @@ static char doc[] =
/* A description of the arguments we accept. */
static char args_doc[] =
"--input <FILE> --mode <MODE> (--output <FILE> | "
"(--address <ADDR> --port <PORT> --project <PROJ>)) -x -g";
"(--address <ADDR> --port <PORT> --project <PROJ>)) -x -g --version";

/* The options we understand. */
static struct argp_option options[] = {{"input", 'i', "FILE", 0, "Input ELF file"},
Expand Down

0 comments on commit 4b03cbd

Please sign in to comment.