Makefile (1771B)
- # SPDX-FileCopyrightText: 2019 deblob Authors <https://hacktivis.me/projects/deblob>
- # SPDX-License-Identifier: BSD-3-Clause
- PREFIX ?= /usr/local
- BINDIR ?= $(PREFIX)/bin
- MANDIR ?= $(PREFIX)/share/man
- HARE ?= hare
- HAREFLAGS ?=
- MANDOC ?= mandoc
- REUSE ?= reuse
- EXE = deblob
- all: $(EXE)
- $(EXE): main.ha
- $(HARE) build $(HAREFLAGS) -o $@
- .PHONY: clean
- clean:
- rm -f $(EXE)
- $(MAKE) -C test/fixtures clean
- .PHONY: test-fixtures
- test-fixtures: all
- @if $(MAKE) --version | grep -q GNU; then echo 'GNU Make is not my favorite make implementation'; fi
- $(MAKE) -C test/fixtures
- test: test-fixtures test-pyc test-pickle
- rm -fr test/check_dir-fixtures
- cp -r test/fixtures test/check_dir-fixtures
- $(HARE) $(HAREFLAGS) test
- rm -fr test/check_dir-fixtures
- .PHONY: test-pyc
- test-pyc: test-fixtures
- rm -fr test/check_dir_pyc-fixtures
- cp -r test/fixtures/pyc/ test/check_dir_pyc-fixtures
- test -n "$$(ls test/check_dir_pyc-fixtures)"
- ./deblob -d test/check_dir_pyc-fixtures
- test -z "$$(ls test/check_dir_pyc-fixtures)"
- rm -fr test/check_dir_pyc-fixtures
- .PHONY: test-pickle
- test-pickle: test-fixtures
- rm -fr test/check_dir_pickle-fixtures
- cp -r test/fixtures/pickle/ test/check_dir_pickle-fixtures
- test "$$(find test/check_dir_pickle-fixtures -type f | wc -l)" -eq "6"
- ./deblob -d test/check_dir_pickle-fixtures
- test "$$(find test/check_dir_pickle-fixtures -type f | wc -l)" -eq "2"
- rm -fr test/check_dir_pickle-fixtures
- .PHONY: lint
- lint:
- $(MANDOC) -Tlint -Wunsupp,error,warning $(EXE).1
- $(REUSE) lint
- # https://pypi.org/project/black/ python code formatter
- .PHONY: format
- format:
- black .
- .PHONY: install
- install:
- mkdir -p $(DESTDIR)$(BINDIR)
- cp -p $(EXE) $(DESTDIR)$(BINDIR)/
- mkdir -p $(DESTDIR)$(MANDIR)/man1
- cp -p $(EXE).1 $(DESTDIR)$(MANDIR)/man1/