logo

cmd-glob

glob(1) wrapper around glob(3), inspired by https://github.com/isaacs/node-glob git clone https://anongit.hacktivis.me/git/cmd-glob.git/

Makefile (882B)


  1. # glob(1) wrapper around glob(3), inspired by https://github.com/isaacs/node-glob
  2. # SPDX-FileCopyrightText: 2023 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. # SPDX-License-Identifier: MPL-2.0
  4. CC ?= cc
  5. CFLAGS ?= -O2 -g -Wall -Wextra
  6. MANDOC ?= mandoc
  7. REUSE ?= reuse
  8. FLAWFINDER ?= flawfinder
  9. PREFIX ?= /usr/local
  10. BINDIR ?= $(PREFIX)/bin
  11. MANDIR ?= $(PREFIX)/share/man
  12. MAN1DIR ?= $(MANDIR)/man1
  13. glob: glob.c
  14. ${CC} -std=c11 ${CFLAGS} -o $@ $<
  15. .PHONY: clean
  16. clean:
  17. rm glob
  18. C_SOURCES = glob.c
  19. format: $(C_SOURCES)
  20. clang-format -style=file -assume-filename=.clang-format -i $(C_SOURCES)
  21. .PHONY: lint
  22. lint:
  23. $(MANDOC) -Tlint -Wunsupp,error,warning glob.1
  24. $(REUSE) lint
  25. ${FLAWFINDER} --error-level=4 .
  26. .PHONY: install
  27. install:
  28. mkdir -p $(DESTDIR)$(BINDIR)
  29. cp ./glob $(DESTDIR)$(BINDIR)/glob
  30. mkdir -p $(DESTDIR)$(MAN1DIR)
  31. cp ./glob.1 $(DESTDIR)$(MAN1DIR)/glob.1