Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioping
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ioping
Commits
a01558fe
Commit
a01558fe
authored
Sep 05, 2015
by
Konstantin Khlebnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ioping: keep VERSION right in ioping.c
Signed-off-by:
Konstantin Khlebnikov
<
koct9i@gmail.com
>
parent
522fd2cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
15 deletions
+19
-15
Makefile
Makefile
+9
-8
ioping.c
ioping.c
+9
-6
ioping.spec
ioping.spec
+1
-1
No files found.
Makefile
View file @
a01558fe
...
...
@@ -13,7 +13,8 @@ DOCS=README LICENSE changelog
SPEC
=
ioping.spec
PACKAGE
=
ioping
VERSION
=
$(
shell
cat
version
)
EXTRA_VERSION
:=
$(
shell
test
-d
.git
&&
git describe
--tags
--dirty
=
+ |
sed
's/^v[^-]*//;s/-/./g'
)
VERSION
:=
$(
shell
sed
-ne
's/\# define VERSION \"\(.*\)\"/\1/p'
ioping.c
)
${EXTRA_VERSION}
DISTDIR
=
$(PACKAGE)
-
$(VERSION)
DISTFILES
=
$(SRCS)
$(MANS)
$(DOCS)
$(SPEC)
Makefile
PACKFILES
=
$(BINS)
$(MANS)
$(MANS_F)
$(DOCS)
...
...
@@ -28,10 +29,10 @@ TARGET=win32
BINS
:=
$(BINS:=.exe)
endif
all
:
version
$(BINS)
all
:
$(BINS)
version
:
$(DISTFILES)
test
!
-d
.git
||
git describe
--tags
--dirty
=
+ |
sed
's/^v//;s/-/./g'
>
$@
version
:
@
echo
${VERSION}
clean
:
$(RM)
-f
$(OBJS)
$(BINS)
$(MANS_F)
...
...
@@ -45,8 +46,8 @@ install: $(BINS) $(MANS)
mkdir
-p
$(DESTDIR)$(MAN1DIR)
install
-m
644
$(MANS)
$(DESTDIR)$(MAN1DIR)
%.o
:
%.c
version
$(CC)
$(CFLAGS)
-D
VERSION
=
\"
${
VERSION}
\"
-c
-o
$@
$<
%.o
:
%.c
$(CC)
$(CFLAGS)
-D
EXTRA_VERSION
=
\"
${EXTRA_
VERSION}
\"
-c
-o
$@
$<
%.ps
:
%.1
man
-t
./
$<
>
$@
...
...
@@ -60,7 +61,7 @@ install: $(BINS) $(MANS)
$(BINS)
:
$(OBJS)
$(CC)
-o
$@
$^
$(CFLAGS)
$(LDFLAGS)
$(LIBS)
dist
:
version
$(DISTFILES)
dist
:
$(DISTFILES)
tar
-cz
--transform
=
's,^,
$(DISTDIR)
/,S'
$^
-f
$(DISTDIR)
.tar.gz
binary-tgz
:
$(PACKFILES)
...
...
@@ -71,4 +72,4 @@ binary-zip: $(PACKFILES)
${STRIP}
${BINS}
zip
${PACKAGE}
-
${VERSION}
-
${TARGET}
.zip
$^
.PHONY
:
all clean install dist
.PHONY
:
all clean install dist
version
ioping.c
View file @
a01558fe
...
...
@@ -18,6 +18,14 @@
*
*/
#ifndef VERSION
# define VERSION "0.9"
#endif
#ifndef EXTRA_VERSION
# define EXTRA_VERSION ""
#endif
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
...
...
@@ -249,14 +257,9 @@ void usage(void)
);
}
#ifndef VERSION
# warning ioping version undefined
# define VERSION ""
#endif
void
version
(
void
)
{
fprintf
(
stderr
,
"ioping %s
\n
"
,
VERSION
);
fprintf
(
stderr
,
"ioping %s
\n
"
,
VERSION
EXTRA_VERSION
);
}
struct
suffix
{
...
...
ioping.spec
View file @
a01558fe
Name: ioping
Version: %(
cat
version)
Version: %(
make
version)
Release: 1%{?dist}
Summary: simple disk I/O latency monitoring tool
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment