fix: Makefile
This commit is contained in:
parent
ffbc8a793c
commit
a62bf175cb
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,7 +1,8 @@
|
||||
# absolute files
|
||||
bin
|
||||
.env
|
||||
|
||||
flucky*
|
||||
|
||||
# directories
|
||||
.vscode/
|
||||
|
||||
|
77
Makefile
77
Makefile
@ -7,42 +7,9 @@ PREFIX?=/usr/local
|
||||
|
||||
# BINARIES
|
||||
# ==============================================================================
|
||||
EXECUTABLE_TARGETS:= \
|
||||
bin/linux/amd64/${EXECUTABLE} \
|
||||
bin/linux/arm/5/${EXECUTABLE} \
|
||||
bin/linux/arm/7/${EXECUTABLE} \
|
||||
bin/tmp/${EXECUTABLE}
|
||||
all: ${EXECUTABLE}
|
||||
|
||||
${EXECUTABLE}: bin/tmp/${EXECUTABLE}
|
||||
|
||||
bin/linux/amd64/${EXECUTABLE}:
|
||||
CGO_ENABLED=1 \
|
||||
GOOS=linux \
|
||||
GOARCH=amd64 \
|
||||
GOPROXY=$(shell go env GOPROXY) \
|
||||
GOPRIVATE=$(shell go env GOPRIVATE) \
|
||||
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
|
||||
|
||||
bin/linux/arm/5/${EXECUTABLE}:
|
||||
CGO_ENABLED=1 \
|
||||
GOOS=linux \
|
||||
GOARCH=arm \
|
||||
GOARM=5 \
|
||||
GOPROXY=$(shell go env GOPROXY) \
|
||||
GOPRIVATE=$(shell go env GOPRIVATE) \
|
||||
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
|
||||
|
||||
bin/linux/arm/7/${EXECUTABLE}:
|
||||
CC=arm-linux-gnueabihf-gcc \
|
||||
CGO_ENABLED=1 \
|
||||
GOOS=linux \
|
||||
GOARCH=arm \
|
||||
GOARM=7 \
|
||||
GOPROXY=$(shell go env GOPROXY) \
|
||||
GOPRIVATE=$(shell go env GOPRIVATE) \
|
||||
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
|
||||
|
||||
bin/tmp/${EXECUTABLE}:
|
||||
${EXECUTABLE}:
|
||||
CGO_ENABLED=1 \
|
||||
GOPROXY=$(shell go env GOPROXY) \
|
||||
GOPRIVATE=$(shell go env GOPRIVATE) \
|
||||
@ -50,48 +17,48 @@ bin/tmp/${EXECUTABLE}:
|
||||
|
||||
# COMPLETIONS
|
||||
# ==============================================================================
|
||||
bin/tmp/${EXECUTABLE}.sh: bin/tmp/${EXECUTABLE}
|
||||
bin/tmp/${EXECUTABLE} completion bash > ${@}
|
||||
${EXECUTABLE}.sh: ${EXECUTABLE}
|
||||
${EXECUTABLE} completion bash > ${@}
|
||||
|
||||
bin/tmp/${EXECUTABLE}.fish: bin/tmp/${EXECUTABLE}
|
||||
bin/tmp/${EXECUTABLE} completion fish > ${@}
|
||||
${EXECUTABLE}.fish: ${EXECUTABLE}
|
||||
${EXECUTABLE} completion fish > ${@}
|
||||
|
||||
bin/tmp/${EXECUTABLE}.zsh: bin/tmp/${EXECUTABLE}
|
||||
bin/tmp/${EXECUTABLE} completion zsh > ${@}
|
||||
${EXECUTABLE}.zsh: ${EXECUTABLE}
|
||||
${EXECUTABLE} completion zsh > ${@}
|
||||
|
||||
# UN/INSTALL
|
||||
# ==============================================================================
|
||||
PHONY+=install
|
||||
install: bin/tmp/${EXECUTABLE} bin/tmp/${EXECUTABLE}.sh bin/tmp/${EXECUTABLE}.fish bin/tmp/${EXECUTABLE}.zsh
|
||||
install: ${EXECUTABLE} ${EXECUTABLE}.sh ${EXECUTABLE}.fish ${EXECUTABLE}.zsh
|
||||
install --directory ${DESTDIR}${PREFIX}/bin
|
||||
install --mode 755 bin/tmp/${EXECUTABLE} ${DESTDIR}${PREFIX}/bin/${EXECUTABLE}
|
||||
|
||||
install --directory ${DESTDIR}/etc/bash_completion.d
|
||||
install --mode 755 bin/tmp/${EXECUTABLE}.sh ${DESTDIR}/etc/bash_completion.d/${EXECUTABLE}.sh
|
||||
|
||||
install --directory ${DESTDIR}/usr/share/fish/vendor_completions.d
|
||||
install --mode 644 bin/tmp/${EXECUTABLE}.fish ${DESTDIR}/usr/share/fish/vendor_completions.d/${EXECUTABLE}.fish
|
||||
install --mode 755 ${EXECUTABLE} ${DESTDIR}${PREFIX}/bin/${EXECUTABLE}
|
||||
|
||||
install --directory ${DESTDIR}/usr/lib/systemd/system
|
||||
install --mode 644 systemd/${EXECUTABLE}.service ${DESTDIR}/usr/lib/systemd/system/${EXECUTABLE}.service
|
||||
|
||||
install --directory ${DESTDIR}/usr/share/licenses/${EXECUTABLE}
|
||||
install --mode 644 LICENSE ${DESTDIR}/usr/share/licenses/${EXECUTABLE}/LICENSE
|
||||
install --directory ${DESTDIR}${PREFIX}/share/bash-completion/completions/
|
||||
install --mode 644 ${EXECUTABLE}.sh ${DESTDIR}${PREFIX}/share/bash-completion/completions/${EXECUTABLE}.sh
|
||||
|
||||
install --directory ${DESTDIR}${PREFIX}/fish/vendor_completions.d
|
||||
install --mode 644 ${EXECUTABLE}.fish ${DESTDIR}${PREFIX}/fish/vendor_completions.d/${EXECUTABLE}.fish
|
||||
|
||||
install --directory ${DESTDIR}${PREFIX}/licenses/${EXECUTABLE}
|
||||
install --mode 644 LICENSE ${DESTDIR}${PREFIX}/licenses/${EXECUTABLE}/LICENSE
|
||||
|
||||
PHONY+=uninstall
|
||||
uninstall:
|
||||
-rm --recursive --force \
|
||||
${DESTDIR}${PREFIX}/bin/${EXECUTABLE} \
|
||||
${DESTDIR}/etc/bash_completion.d/${EXECUTABLE}.sh \
|
||||
${DESTDIR}/usr/lib/systemd/system/${EXECUTABLE}.service \
|
||||
${DESTDIR}/usr/share/fish/vendor_completions.d/${EXECUTABLE}.fish \
|
||||
${DESTDIR}/usr/share/licenses/${EXECUTABLE}/LICENSE
|
||||
${DESTDIR}${PREFIX}/share/bash-completion/completions/${EXECUTABLE}.sh \
|
||||
${DESTDIR}${PREFIX}/fish/vendor_completions.d/${EXECUTABLE}.fish \
|
||||
${DESTDIR}${PREFIX}/licenses/${EXECUTABLE}/LICENSE
|
||||
|
||||
# CLEAN
|
||||
# ==============================================================================
|
||||
PHONY+=clean
|
||||
clean:
|
||||
rm --force --recursive bin/ || true
|
||||
rm --force --recursive ${EXECUTABLE}* || true
|
||||
|
||||
# TEST
|
||||
# ==============================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user