Makefile (882B)
- # glob(1) wrapper around glob(3), inspired by https://github.com/isaacs/node-glob
- # SPDX-FileCopyrightText: 2023 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- # SPDX-License-Identifier: MPL-2.0
- CC ?= cc
- CFLAGS ?= -O2 -g -Wall -Wextra
- MANDOC ?= mandoc
- REUSE ?= reuse
- FLAWFINDER ?= flawfinder
- PREFIX ?= /usr/local
- BINDIR ?= $(PREFIX)/bin
- MANDIR ?= $(PREFIX)/share/man
- MAN1DIR ?= $(MANDIR)/man1
- glob: glob.c
- ${CC} -std=c11 ${CFLAGS} -o $@ $<
- .PHONY: clean
- clean:
- rm glob
- C_SOURCES = glob.c
- format: $(C_SOURCES)
- clang-format -style=file -assume-filename=.clang-format -i $(C_SOURCES)
- .PHONY: lint
- lint:
- $(MANDOC) -Tlint -Wunsupp,error,warning glob.1
- $(REUSE) lint
- ${FLAWFINDER} --error-level=4 .
- .PHONY: install
- install:
- mkdir -p $(DESTDIR)$(BINDIR)
- cp ./glob $(DESTDIR)$(BINDIR)/glob
- mkdir -p $(DESTDIR)$(MAN1DIR)
- cp ./glob.1 $(DESTDIR)$(MAN1DIR)/glob.1