logo

deblob

remove binary executables from a directory git clone https://anongit.hacktivis.me/git/deblob.git/

Makefile (1771B)


  1. # SPDX-FileCopyrightText: 2019 deblob Authors <https://hacktivis.me/projects/deblob>
  2. # SPDX-License-Identifier: BSD-3-Clause
  3. PREFIX ?= /usr/local
  4. BINDIR ?= $(PREFIX)/bin
  5. MANDIR ?= $(PREFIX)/share/man
  6. HARE ?= hare
  7. HAREFLAGS ?=
  8. MANDOC ?= mandoc
  9. REUSE ?= reuse
  10. EXE = deblob
  11. all: $(EXE)
  12. $(EXE): main.ha
  13. $(HARE) build $(HAREFLAGS) -o $@
  14. .PHONY: clean
  15. clean:
  16. rm -f $(EXE)
  17. $(MAKE) -C test/fixtures clean
  18. .PHONY: test-fixtures
  19. test-fixtures: all
  20. @if $(MAKE) --version | grep -q GNU; then echo 'GNU Make is not my favorite make implementation'; fi
  21. $(MAKE) -C test/fixtures
  22. test: test-fixtures test-pyc test-pickle
  23. rm -fr test/check_dir-fixtures
  24. cp -r test/fixtures test/check_dir-fixtures
  25. $(HARE) $(HAREFLAGS) test
  26. rm -fr test/check_dir-fixtures
  27. .PHONY: test-pyc
  28. test-pyc: test-fixtures
  29. rm -fr test/check_dir_pyc-fixtures
  30. cp -r test/fixtures/pyc/ test/check_dir_pyc-fixtures
  31. test -n "$$(ls test/check_dir_pyc-fixtures)"
  32. ./deblob -d test/check_dir_pyc-fixtures
  33. test -z "$$(ls test/check_dir_pyc-fixtures)"
  34. rm -fr test/check_dir_pyc-fixtures
  35. .PHONY: test-pickle
  36. test-pickle: test-fixtures
  37. rm -fr test/check_dir_pickle-fixtures
  38. cp -r test/fixtures/pickle/ test/check_dir_pickle-fixtures
  39. test "$$(find test/check_dir_pickle-fixtures -type f | wc -l)" -eq "6"
  40. ./deblob -d test/check_dir_pickle-fixtures
  41. test "$$(find test/check_dir_pickle-fixtures -type f | wc -l)" -eq "2"
  42. rm -fr test/check_dir_pickle-fixtures
  43. .PHONY: lint
  44. lint:
  45. $(MANDOC) -Tlint -Wunsupp,error,warning $(EXE).1
  46. $(REUSE) lint
  47. # https://pypi.org/project/black/ python code formatter
  48. .PHONY: format
  49. format:
  50. black .
  51. .PHONY: install
  52. install:
  53. mkdir -p $(DESTDIR)$(BINDIR)
  54. cp -p $(EXE) $(DESTDIR)$(BINDIR)/
  55. mkdir -p $(DESTDIR)$(MANDIR)/man1
  56. cp -p $(EXE).1 $(DESTDIR)$(MANDIR)/man1/