git-secret/Makefile

78 lines
1.4 KiB
Makefile
Raw Normal View History

2016-03-12 21:35:05 +00:00
SHELL:=/usr/bin/env bash
2016-03-13 09:14:28 +00:00
PREFIX?="/usr"
2016-03-12 21:35:05 +00:00
2016-03-12 19:21:04 +00:00
#
# Building:
#
2016-02-21 13:26:17 +00:00
all: build
git-secret: src/_utils/* src/commands/* src/main.sh
@cat $^ > "$@"
@chmod +x git-secret
clean:
@rm -f git-secret
build: git-secret
2016-03-13 09:14:28 +00:00
install: clean build
@chmod +x "./utils/install.sh"
@sudo "./utils/install.sh" "$(PREFIX)"
2016-03-12 19:21:04 +00:00
#
# Testing:
#
2016-02-21 13:26:17 +00:00
install-test:
git clone https://github.com/sstephenson/bats.git vendor/bats
test:
@if [ ! -d "vendor/bats" ]; then make install-test; fi
@export SECRET_PROJECT_ROOT="${PWD}"; export PATH="${PWD}/vendor/bats/bin:${PWD}:${PATH}"; \
make develop; \
rm -rf temp; mkdir temp; cd temp; \
bats "../tests";
2016-03-12 19:21:04 +00:00
#
# Manuals:
#
install-ronn:
@if [ ! `gem list ronn -i` == "true" ]; then gem install ronn; fi
2016-02-21 13:26:17 +00:00
build-man:
2016-03-12 19:21:04 +00:00
@make install-ronn
2016-03-13 09:14:28 +00:00
ronn --roff man/*/*.ronn
2016-02-21 13:26:17 +00:00
2016-02-23 21:25:39 +00:00
build-gh-pages:
2016-03-13 10:10:45 +00:00
@chmod +x "./utils/gh-branch.sh"
2016-03-13 09:14:28 +00:00
@"./utils/gh-branch.sh"
2016-02-23 21:25:39 +00:00
2016-03-12 19:21:04 +00:00
#
# Development:
#
2016-02-21 13:26:17 +00:00
install-hooks:
2016-02-23 21:35:25 +00:00
@# pre-commit:
2016-02-21 13:26:17 +00:00
@ln -fs "${PWD}/utils/pre-commit.sh" "${PWD}/.git/hooks/pre-commit"
@chmod +x "${PWD}/.git/hooks/pre-commit"
2016-02-23 21:35:25 +00:00
@# post-commit:
@ln -fs "${PWD}/utils/post-commit.sh" "${PWD}/.git/hooks/post-commit"
@chmod +x "${PWD}/.git/hooks/post-commit"
2016-02-21 13:26:17 +00:00
develop: clean build install-hooks
2016-03-12 19:21:04 +00:00
#
# Packaging:
#
install-fpm:
@if [ ! `gem list fpm -i` == "true" ]; then gem install fpm; fi
build-deb: clean build
@make install-fpm
2016-03-13 09:14:28 +00:00
@chmod +x "./utils/build-deb.sh"
2016-03-12 19:21:04 +00:00
@"./utils/build-deb.sh"