2019-04-04 12:39:17 +02:00
|
|
|
# Makefile for has
|
|
|
|
# https://github.com/kdabir/has
|
2019-04-04 12:43:56 +02:00
|
|
|
# Sadly, longopts like --verbose are not working on MacOS for cp, mkdir and rm
|
|
|
|
|
2019-04-04 12:39:17 +02:00
|
|
|
|
|
|
|
# PREFIX is an environment variable.
|
|
|
|
# Use default value if not set.
|
|
|
|
ifeq ($(PREFIX),)
|
|
|
|
PREFIX := /usr/local
|
|
|
|
endif
|
|
|
|
|
|
|
|
test : has
|
2017-08-29 08:31:11 +02:00
|
|
|
bats .hastest.bats
|
|
|
|
|
2019-04-04 12:39:17 +02:00
|
|
|
has :
|
|
|
|
# ensure 'has' in repo
|
|
|
|
git checkout --force -- has
|
|
|
|
|
2019-04-04 12:43:56 +02:00
|
|
|
# install 'has' in specified directory
|
2019-04-04 12:39:17 +02:00
|
|
|
install : has
|
|
|
|
chmod 755 has && \
|
2019-04-04 12:43:56 +02:00
|
|
|
mkdir -v -p $(DESTDIR)$(PREFIX)/bin && \
|
|
|
|
cp -v has $(DESTDIR)$(PREFIX)/bin/has
|
2019-04-04 12:39:17 +02:00
|
|
|
|
|
|
|
# update: has
|
|
|
|
update : update-fetch has
|
|
|
|
|
|
|
|
update-fetch : update-force
|
|
|
|
# update repo from upstream
|
|
|
|
git fetch --verbose --force
|
|
|
|
|
|
|
|
update-force :
|
|
|
|
# remove local repo 'has' to force update
|
2019-04-04 12:43:56 +02:00
|
|
|
rm -f has
|
2019-04-04 12:39:17 +02:00
|
|
|
|
|
|
|
uninstall :
|
2019-04-04 12:43:56 +02:00
|
|
|
rm -f /usr/local/bin/has
|
2019-04-04 12:39:17 +02:00
|
|
|
|
|
|
|
.PHONY: test install uninstall update
|
2017-08-29 08:31:11 +02:00
|
|
|
|