Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
1d345227
Commit
1d345227
authored
10 years ago
by
René Kijewski
Browse files
Options
Downloads
Patches
Plain Diff
make: evaluate the Git SHA only once
parent
9384b243
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile.base
+0
-12
0 additions, 12 deletions
Makefile.base
Makefile.include
+13
-0
13 additions, 0 deletions
Makefile.include
with
13 additions
and
12 deletions
Makefile.base
+
0
−
12
View file @
1d345227
...
...
@@ -21,18 +21,6 @@ endif
OBJ
=
$(
SRC:%.c
=
$(
BINDIR
)$(
MODULE
)
/%.o
)
DEP
=
$(
SRC:%.c
=
$(
BINDIR
)$(
MODULE
)
/%.d
)
GIT_STRING
:=
$(
shell git describe
--always
--abbrev
=
4
--dirty
=
-
`
hostname
`
)
GIT_BRANCH
:=
$(
shell git rev-parse
--abbrev-ref
HEAD
)
ifeq
($(strip $(GIT_BRANCH)),master)
GIT_VERSION
=
$(
GIT_STRING
)
else
GIT_VERSION
=
$(
shell
echo
$(
GIT_STRING
)
$(
GIT_BRANCH
)
|
sed
's/ /-/'
)
endif
ifeq
($(strip $(GIT_VERSION)),)
GIT_VERSION
:=
"UNKNOWN"
endif
export
CFLAGS
+=
-DVERSION
=
\"
$(
GIT_VERSION
)
\"
$(BINDIR)$(MODULE).a
:
$(OBJ) $(ASMOBJ)
$(
AD
)$(
AR
)
-rc
$(
BINDIR
)$(
MODULE
)
.a
$(
OBJ
)
$(
ASMOBJ
)
...
...
This diff is collapsed.
Click to expand it.
Makefile.include
+
13
−
0
View file @
1d345227
...
...
@@ -60,6 +60,19 @@ endif
# Feature test default CFLAGS and LINKFLAGS for the set compiled.
include
$(RIOTBASE)/Makefile.cflags
# make the RIOT version available to the program
GIT_STRING
:=
$(
shell git describe
--always
--abbrev
=
4
--dirty
=
-
`
hostname
`
)
GIT_BRANCH
:=
$(
shell git rev-parse
--abbrev-ref
HEAD
)
ifeq
($(strip $(GIT_BRANCH)),master)
GIT_VERSION
=
$(
GIT_STRING
)
else
GIT_VERSION
=
$(
shell
echo
$(
GIT_STRING
)
$(
GIT_BRANCH
)
|
sed
's/ /-/'
)
endif
ifeq
($(strip $(GIT_VERSION)),)
GIT_VERSION
:=
"UNKNOWN"
endif
export
CFLAGS
+=
-DVERSION
=
\"
$(
GIT_VERSION
)
\"
# the binaries to link
BASELIBS
+=
$(
BINDIR
)$(
BOARD
)
_base.a
BASELIBS
+=
$(
BINDIR
)${
APPLICATION
}
.a
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment