Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC DEL 1ns 4cha - Software
Commits
a611ee27
Commit
a611ee27
authored
Nov 30, 2015
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: add printing version of repo
with -V switch Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
fe6c90a5
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
55 additions
and
9 deletions
+55
-9
Makefile
tools/Makefile
+4
-3
fmc-fdelay-board-time.c
tools/fmc-fdelay-board-time.c
+6
-1
fmc-fdelay-input.c
tools/fmc-fdelay-input.c
+6
-1
fmc-fdelay-list.c
tools/fmc-fdelay-list.c
+7
-1
fmc-fdelay-pulse.c
tools/fmc-fdelay-pulse.c
+6
-1
fmc-fdelay-status.c
tools/fmc-fdelay-status.c
+6
-1
fmc-fdelay-term.c
tools/fmc-fdelay-term.c
+6
-1
tools-common.h
tools/tools-common.h
+2
-0
tools-util.c
tools/tools-util.c
+12
-0
No files found.
tools/Makefile
View file @
a611ee27
...
...
@@ -9,11 +9,12 @@
REPO_PARENT
=
../..
-include
$(REPO_PARENT)/parent_common.mk
M
=
$(
shell
/bin/pwd
)
/../kernel
DESTDIR
?=
/usr/local
CFLAGS
+=
-I
$(M)
-I
../lib
-Wno-trigraphs
-Wall
-ggdb
$(EXTRACFLAGS)
GIT_VERSION
:=
$(
shell
git describe
--dirty
--long
--tags
)
CFLAGS
+=
-I
../kernel
-I
../lib
-Wno-trigraphs
-Wall
-ggdb
$(EXTRACFLAGS)
CFLAGS
+=
-DGIT_VERSION
=
"
\"
$(GIT_VERSION)
\"
"
LDFLAGS
=
-L
../lib
LDLIBS
=
-lfdelay
...
...
tools/fmc-fdelay-board-time.c
View file @
a611ee27
...
...
@@ -8,11 +8,13 @@
#include "tools-common.h"
char
git_version
[]
=
"git version: "
GIT_VERSION
;
void
help
(
char
*
name
)
{
fprintf
(
stderr
,
"fmc-fdelay-board-time: a tool for manipulating the FMC Fine Delay time base.
\n
"
);
fprintf
(
stderr
,
"Use:
\"
%s [-i <index>] [-d <dev>] <command>
\"\n
"
,
fprintf
(
stderr
,
"Use:
\"
%s [-
V] [-
i <index>] [-d <dev>] <command>
\"\n
"
,
name
);
fprintf
(
stderr
,
" where the <command> can be:
\n
"
" get - shows current time and White Rabbit status.
\n
"
...
...
@@ -37,6 +39,9 @@ int main(int argc, char **argv)
if
(
tools_need_help
(
argc
,
argv
))
help
(
argv
[
0
]);
/* print versions if needed */
print_version
(
argc
,
argv
);
nboards
=
fdelay_init
();
if
(
nboards
<
0
)
{
...
...
tools/fmc-fdelay-input.c
View file @
a611ee27
...
...
@@ -11,9 +11,11 @@
#include "tools-common.h"
char
git_version
[]
=
"git version: "
GIT_VERSION
;
void
help
(
char
*
name
)
{
fprintf
(
stderr
,
"%s: Use
\"
%s [-i <index>] [-d <dev>] [<opts>]
\n
"
,
fprintf
(
stderr
,
"%s: Use
\"
%s [-
V] [-
i <index>] [-d <dev>] [<opts>]
\n
"
,
name
,
name
);
fprintf
(
stderr
,
" options:
\n
"
" -c <count> default is 0 and means forever
\n
"
...
...
@@ -49,6 +51,9 @@ int main(int argc, char **argv)
if
(
tools_need_help
(
argc
,
argv
))
help
(
argv
[
0
]);
/* print versions if needed */
print_version
(
argc
,
argv
);
nboards
=
fdelay_init
();
if
(
nboards
<
0
)
{
...
...
tools/fmc-fdelay-list.c
View file @
a611ee27
...
...
@@ -9,9 +9,12 @@
#include "tools-common.h"
char
git_version
[]
=
"git version: "
GIT_VERSION
;
void
help
(
char
*
name
)
{
fprintf
(
stderr
,
"%s: Lists boards, takes no arguments
\n
"
,
name
);
fprintf
(
stderr
,
"%s: Lists boards
\n
"
" -V print version
\n
"
,
name
);
exit
(
1
);
}
...
...
@@ -24,6 +27,9 @@ int main(int argc, char **argv)
if
(
tools_need_help
(
argc
,
argv
))
help
(
argv
[
0
]);
/* print versions if needed */
print_version
(
argc
,
argv
);
if
(
argc
>
1
)
{
fprintf
(
stderr
,
"%s: too many arguments (none expected)
\n
"
,
argv
[
0
]);
...
...
tools/fmc-fdelay-pulse.c
View file @
a611ee27
...
...
@@ -13,9 +13,11 @@
#include "tools-common.h"
char
git_version
[]
=
"git version: "
GIT_VERSION
;
void
help
(
char
*
name
)
{
fprintf
(
stderr
,
"%s: Use
\"
%s [-i <index>] [-d <dev>] [<opts>]
\n
"
,
fprintf
(
stderr
,
"%s: Use
\"
%s [-
V] [-
i <index>] [-d <dev>] [<opts>]
\n
"
,
name
,
name
);
fprintf
(
stderr
,
" options:
\n
"
" -o <output> ouput channel: 1..4 (default 1)
\n
"
...
...
@@ -223,6 +225,9 @@ int main(int argc, char **argv)
if
(
tools_need_help
(
argc
,
argv
))
help
(
argv
[
0
]);
/* print versions if needed */
print_version
(
argc
,
argv
);
nboards
=
fdelay_init
();
if
(
nboards
<
0
)
{
...
...
tools/fmc-fdelay-status.c
View file @
a611ee27
...
...
@@ -8,11 +8,13 @@
#include "tools-common.h"
char
git_version
[]
=
"git version: "
GIT_VERSION
;
void
help
(
char
*
name
)
{
fprintf
(
stderr
,
"fmc-fdelay-status: reports channel programming
\n
"
);
fprintf
(
stderr
,
"Use:
\"
%s [-i <index>] [-d <dev>] [-r]
\"\n
"
,
name
);
fprintf
(
stderr
,
"Use:
\"
%s [-
V] [-
i <index>] [-d <dev>] [-r]
\"\n
"
,
name
);
fprintf
(
stderr
,
" -r: display raw hardware configuration"
);
exit
(
1
);
}
...
...
@@ -27,6 +29,9 @@ int main(int argc, char **argv)
if
(
tools_need_help
(
argc
,
argv
))
help
(
argv
[
0
]);
/* print versions if needed */
print_version
(
argc
,
argv
);
nboards
=
fdelay_init
();
if
(
nboards
<
0
)
{
...
...
tools/fmc-fdelay-term.c
View file @
a611ee27
...
...
@@ -8,9 +8,11 @@
#include "tools-common.h"
char
git_version
[]
=
"git version: "
GIT_VERSION
;
void
help
(
char
*
name
)
{
fprintf
(
stderr
,
"%s: Use
\"
%s [-i <index>] [-d <dev>] [on|off]
\n
"
,
fprintf
(
stderr
,
"%s: Use
\"
%s [-
V] [-
i <index>] [-d <dev>] [on|off]
\n
"
,
name
,
name
);
exit
(
1
);
}
...
...
@@ -26,6 +28,9 @@ int main(int argc, char **argv)
if
(
tools_need_help
(
argc
,
argv
))
help
(
argv
[
0
]);
/* print versions if needed */
print_version
(
argc
,
argv
);
nboards
=
fdelay_init
();
if
(
nboards
<
0
)
{
...
...
tools/tools-common.h
View file @
a611ee27
...
...
@@ -14,3 +14,5 @@ extern void tools_report_time(char *name, struct fdelay_time *t, int umode);
extern
void
report_output_config
(
int
channel
,
struct
fdelay_pulse
*
p
,
int
umode
);
extern
void
help
(
char
*
name
);
/* This is mandatory in all tools */
extern
void
print_version
(
int
argc
,
char
**
argv
);
tools/tools-util.c
View file @
a611ee27
...
...
@@ -8,6 +8,18 @@
#include "tools-common.h"
extern
void
help
(
char
*
name
);
/* This is mandatory in all tools */
extern
char
git_version
[];
void
print_version
(
int
argc
,
char
**
argv
)
{
if
((
argc
==
2
)
&&
(
!
strcmp
(
argv
[
1
],
"-V"
)))
{
printf
(
"%s %s
\n
"
,
argv
[
0
],
git_version
);
printf
(
"%s
\n
"
,
libfdelay_version_s
);
printf
(
"%s
\n
"
,
libfdelay_zio_version_s
);
exit
(
0
);
}
}
void
tools_getopt_d_i
(
int
argc
,
char
**
argv
,
int
*
dev
,
int
*
index
)
...
...
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