has/Makefile

41 lines
780 B
Makefile
Raw Normal View History

Freshen Makefile and update README.md (#31) Details: * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permission mode The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permissions set The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets - [x] Add tests for Makefile changes - [x] Uses `bats` variables for directories - ✓ make install creates a valid installation - ✓ ..even if has is missing from directory - ✓ make update runs git pull * Update .hastest.bats temp remove "git pull" check. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Change version output to non-blinking. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Working makefile * Use `[[` and `@` for the $lines match. * `make install` MacOS friendly again
2019-04-04 12:39:17 +02:00
# Makefile for has
# https://github.com/kdabir/has
# Sadly, longopts like --verbose are not working on MacOS for cp, mkdir and rm
Freshen Makefile and update README.md (#31) Details: * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permission mode The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permissions set The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets - [x] Add tests for Makefile changes - [x] Uses `bats` variables for directories - ✓ make install creates a valid installation - ✓ ..even if has is missing from directory - ✓ make update runs git pull * Update .hastest.bats temp remove "git pull" check. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Change version output to non-blinking. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Working makefile * Use `[[` and `@` for the $lines match. * `make install` MacOS friendly again
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
bats .hastest.bats
Freshen Makefile and update README.md (#31) Details: * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permission mode The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permissions set The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets - [x] Add tests for Makefile changes - [x] Uses `bats` variables for directories - ✓ make install creates a valid installation - ✓ ..even if has is missing from directory - ✓ make update runs git pull * Update .hastest.bats temp remove "git pull" check. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Change version output to non-blinking. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Working makefile * Use `[[` and `@` for the $lines match. * `make install` MacOS friendly again
2019-04-04 12:39:17 +02:00
has :
# ensure 'has' in repo
git checkout --force -- has
# install 'has' in specified directory
Freshen Makefile and update README.md (#31) Details: * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permission mode The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permissions set The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets - [x] Add tests for Makefile changes - [x] Uses `bats` variables for directories - ✓ make install creates a valid installation - ✓ ..even if has is missing from directory - ✓ make update runs git pull * Update .hastest.bats temp remove "git pull" check. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Change version output to non-blinking. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Working makefile * Use `[[` and `@` for the $lines match. * `make install` MacOS friendly again
2019-04-04 12:39:17 +02:00
install : has
chmod 755 has && \
mkdir -v -p $(DESTDIR)$(PREFIX)/bin && \
cp -v has $(DESTDIR)$(PREFIX)/bin/has
Freshen Makefile and update README.md (#31) Details: * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permission mode The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permissions set The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets - [x] Add tests for Makefile changes - [x] Uses `bats` variables for directories - ✓ make install creates a valid installation - ✓ ..even if has is missing from directory - ✓ make update runs git pull * Update .hastest.bats temp remove "git pull" check. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Change version output to non-blinking. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Working makefile * Use `[[` and `@` for the $lines match. * `make install` MacOS friendly again
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
rm -f has
Freshen Makefile and update README.md (#31) Details: * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permission mode The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permissions set The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets - [x] Add tests for Makefile changes - [x] Uses `bats` variables for directories - ✓ make install creates a valid installation - ✓ ..even if has is missing from directory - ✓ make update runs git pull * Update .hastest.bats temp remove "git pull" check. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Change version output to non-blinking. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Working makefile * Use `[[` and `@` for the $lines match. * `make install` MacOS friendly again
2019-04-04 12:39:17 +02:00
uninstall :
rm -f $(DESTDIR)$(PREFIX)/bin/has
Freshen Makefile and update README.md (#31) Details: * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permission mode The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets * Freshen Makefile and update README.md - [x] Add `sudo` to revelvant commands - [x] Use named languages (bash) in fenced codeblocks - [x] Use `console` in fenced codeblocks for command output - [x] Use `install` with permissions set The permissions on `has` were 777 from `git clone`. - [x] Add option to use $PREFIX What if I don't want to install to /usr/local/bin? `make PREFIX=$HOME/.local install` now works. - [x] Add `update` target for `git pull` - [x] Include .PHONY targets - [x] Add tests for Makefile changes - [x] Uses `bats` variables for directories - ✓ make install creates a valid installation - ✓ ..even if has is missing from directory - ✓ make update runs git pull * Update .hastest.bats temp remove "git pull" check. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Change version output to non-blinking. * Update travis to use bats-core 1.10 Do not be concerned about dirty working tree when running make update. * Working makefile * Use `[[` and `@` for the $lines match. * `make install` MacOS friendly again
2019-04-04 12:39:17 +02:00
.PHONY: test install uninstall update