Skip to content

Commit 6ec56ee

Browse files
committed
ocxl_info cleanup
- Add patch level to the version string - Clean libocxl_info.h - Don't leak build machine hostname in ocxl_info() - Remove stray newline from the end of ocxl_info Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
1 parent 62c15c6 commit 6ec56ee

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ endif
3535

3636
src/libocxl_info.h: version.pl
3737
VERSION_MAJOR=${VERSION_MAJOR} VERSION_MINOR=${VERSION_MINOR} \
38-
CC="${CC}" CFLAGS="${CFLAGS}" \
38+
VERSION_PATCH=${VERSION_PATCH} CC="${CC}" CFLAGS="${CFLAGS}" \
3939
./version.pl > src/libocxl_info.h
4040

4141
obj:
@@ -97,7 +97,7 @@ docs:
9797
$(call Q,DOCS-HTML, doxygen Doxyfile-html,)
9898

9999
clean:
100-
rm -rf obj testobj sampleobj docs
100+
rm -rf obj testobj sampleobj docs src/libocxl_info.h
101101

102102
install: all docs
103103
mkdir -p $(DESTDIR)$(libdir)

Makefile.vars

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ VERSION_MAJOR = 1
88
# Change VERSION_MINOR on new features
99
VERSION_MINOR = 0
1010

11+
# Change VERSION_PATCH on each tag
12+
VERSION_PATCH = 0
13+
1114
AR = $(CROSS_COMPILE)ar
1215
AS = $(CROSS_COMPILE)as
1316
LD = $(CROSS_COMPILE)ld

src/internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void libocxl_init()
6666

6767
val = getenv("LIBOCXL_INFO");
6868
if (val && (!strcasecmp(val, "yes") || !strcmp(val, "1"))) {
69-
fprintf(stderr, "%s", libocxl_info);
69+
fprintf(stderr, "%s\n", libocxl_info);
7070
}
7171

7272
val = getenv("LIBOCXL_TRACE_ALL");

version.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
$gitHash = "\"Git hash: $hash$dirty\\n\"";
2525
}
2626

27-
my $platform = `uname -a`;
27+
my $platform = `uname -srvmpio`;
2828
chomp $platform;
2929

3030
print <<"EOF";
3131
const char *libocxl_info =
32-
"LibOCXL Version: $ENV{VERSION_MAJOR}.$ENV{VERSION_MINOR}\\n"
32+
"LibOCXL Version: $ENV{VERSION_MAJOR}.$ENV{VERSION_MINOR}.$ENV{VERSION_PATCH}\\n"
3333
"CC: $ENV{CC}\\n"
3434
"Compiler Version: $compilerLines[0]\\n"
3535
"CFLAGS: $ENV{CFLAGS}\\n"
3636
$gitHash
37-
"Platform: $platform\\n\\n";
37+
"Build platform: $platform\\n";
3838
EOF

0 commit comments

Comments
 (0)