Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fzf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
fzf
Commits
3ba7b5cf
Unverified
Commit
3ba7b5cf
authored
4 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
Make Makefile fail when git information is not available
parent
254e9765
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
BUILD.md
+7
-0
7 additions, 0 deletions
BUILD.md
Makefile
+17
-2
17 additions, 2 deletions
Makefile
with
24 additions
and
2 deletions
BUILD.md
+
7
−
0
View file @
3ba7b5cf
...
...
@@ -24,6 +24,13 @@ make build
make release
```
> :warning: Makefile uses git commands to determine the version and the
> revision information for `fzf --version`. So if you're building fzf from an
> environment where its git information is not available, you have to manually
> set `$FZF_VERSION` and `$FZF_REVISION`.
>
> e.g. `FZF_VERSION=0.24.0 FZF_REVISION=tarball make`
Third-party libraries used
--------------------------
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
17
−
2
View file @
3ba7b5cf
...
...
@@ -5,10 +5,25 @@ MAKEFILE := $(realpath $(lastword $(MAKEFILE_LIST)))
ROOT_DIR
:=
$(
shell
dirname
$(
MAKEFILE
))
SOURCES
:=
$(
wildcard
*
.go src/
*
.go src/
*
/
*
.go
)
$(
MAKEFILE
)
VERSION
:=
$(
shell git describe
--abbrev
=
0
)
ifdef
FZF_VERSION
VERSION
:=
$(
FZF_VERSION
)
else
VERSION
:=
$(
shell git describe
--abbrev
=
0 2> /dev/null
)
endif
ifeq
($(VERSION),)
$(
error
Not on git repository
;
cannot determine
$$
FZF_VERSION
)
endif
VERSION_TRIM
:=
$(
shell
sed
"s/-.*//"
<<<
$(
VERSION
))
VERSION_REGEX
:=
$(
subst .,
\.
,
$(
VERSION_TRIM
))
REVISION
:=
$(
shell git log
-n
1
--pretty
=
format:%h
--
$(
SOURCES
))
ifdef
FZF_REVISION
REVISION
:=
$(
FZF_REVISION
)
else
REVISION
:=
$(
shell git log
-n
1
--pretty
=
format:%h
--
$(
SOURCES
)
2> /dev/null
)
endif
ifeq
($(REVISION),)
$(
error
Not on git repository
;
cannot determine
$$
FZF_REVISION
)
endif
BUILD_FLAGS
:=
-a
-ldflags
"-X main.version=
$(
VERSION
)
-X main.revision=
$(
REVISION
)
-w '-extldflags=
$(
LDFLAGS
)
'"
-tags
"
$(
TAGS
)
"
BINARY64
:=
fzf-
$(
GOOS
)
_amd64
...
...
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