Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
83
Issues
83
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit Switch - Software
Commits
98ab45ee
Commit
98ab45ee
authored
Mar 22, 2012
by
Benoit Rat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the git version inside the flasher
parent
91a0b560
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
.gitignore
usb-loader/.gitignore
+1
-0
Makefile
usb-loader/Makefile
+14
-6
mch_flasher.c
usb-loader/mch_flasher.c
+8
-1
No files found.
usb-loader/.gitignore
View file @
98ab45ee
version.c
mch_flasher
usb-loader/Makefile
View file @
98ab45ee
OBJS
=
mch_flasher.o serial_linux.o version.o
OUTPUT
=
mch_flasher
OBJS
=
mch_flasher.o serial_linux.o
FLASHER
=
mch_flasher
all
:
$(OBJS)
${
CC
}
-o
$(OUTPUT)
$(OBJS)
all
:
$(FLASHER)
$(FLASHER)
:
$(OBJS)
${
CC
}
-o
$@
$(OBJS)
version.c
:
../.git/HEAD ../.git/index
echo
"/**"
>
$@
echo
" * File automatically generated by Makefile (DO NOT MODIFIED)
\n
*
\n
* To use this you in a c code just add the following lines:
\n
* "
>>
$@
echo
"
\t
extern const char build_time[];
\n\t
extern const char git_user[];
\n\t
extren const char git_revision[];
\n
* "
>>
$@
echo
"**/"
>>
$@
echo
'const char build_time[] = __DATE__ " @ " __TIME__ ;'
>>
$@
echo
"const char git_user[] =
\"
$(
shell
git config --get user.name
)
\"
;"
>>
$@
echo
"const char git_revision[] =
\"
$(
shell
git rev-parse HEAD
)
\"
;"
>>
$@
echo
""
>>
$@
clean
:
rm
-f
$(OBJS)
$(FLASHER)
*
~
rm
-f
version.c
$(OBJS)
$(OUTPUT)
:q:q
usb-loader/mch_flasher.c
View file @
98ab45ee
...
...
@@ -42,6 +42,11 @@
#define PORT_SPEED 115200
//External variable from version.c
extern
const
char
build_time
[];
extern
const
char
git_user
[];
extern
const
char
git_revision
[];
char
*
program_path
;
int
applet_silent_mode
=
1
;
...
...
@@ -418,6 +423,8 @@ main(int argc, char *argv[])
if
(
argc
>
2
)
serial_port
=
argv
[
2
];
//Print line to know the version of software for testing purpose
fprintf
(
stderr
,
"
\n
Compiled by %s (%s)
\n
git rev:%s
\n\n
"
,
git_user
,
build_time
,
git_revision
);
program_path
=
dirname
(
argv
[
0
]);
...
...
@@ -437,4 +444,4 @@ main(int argc, char *argv[])
serial_close
();
return
0
;
}
\ No newline at end of file
}
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