Skip to content

Commit

Permalink
Small improvements to Makefile (comments & more)
Browse files Browse the repository at this point in the history
  • Loading branch information
doronbehar committed Jul 27, 2024
1 parent e0fbb1c commit f73f198
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ endif

pistol: build

# Cross platform build command, with the VERSION embedded to the executable -
# in contrary to all nix related builds
build:
go build -ldflags "-X 'main.Version=$(VERSION)'" ./cmd/pistol

build-static:
nix build -L ".#pistol-static"
ldd ./result/bin/pistol 2>&1 | grep -q 'not a dynamic executable'

# https://stackoverflow.com/a/5810179/4935114
ifeq (, $(shell which jq)$(shell which nix))
$(warning "No jq and/or nix executables in PATH, cannot get info from flake.nix")
else
release:
./bump-version.sh
endif

# Manpage
pistol.1: README.adoc
Expand All @@ -32,7 +35,8 @@ manpage: pistol.1
install:
go install -ldflags "-X 'main.Version=$(VERSION)'" ./cmd/pistol

# requires: bat (https://github.com/sharkdp/bat), elinks
# requires: bat (https://github.com/sharkdp/bat), elinks . Both of them are
# added to the flake.nix.
test: pistol
@echo -------------------
@echo fpath
Expand Down

0 comments on commit f73f198

Please sign in to comment.