logo

utils-extra

Collection of extra tools for Unixes git clone https://anongit.hacktivis.me/git/utils-extra.git/

Makefile (1474B)


  1. # SPDX-FileCopyrightText: 2017-2023 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  2. # SPDX-License-Identifier: MPL-2.0
  3. include config.mk
  4. all: $(EXE)
  5. .c:
  6. rm -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno}
  7. $(CC) -std=c99 $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDSTATIC)
  8. .c.o:
  9. rm -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno}
  10. $(CC) -std=c99 $(CFLAGS) -c -o $@ $<
  11. .PHONY: check
  12. check: all
  13. MALLOC_CHECK_=3 POSIX_ME_HARDER=1 POSIXLY_CORRECT=1 kyua test || (kyua report --verbose --results-filter=broken,failed; false)
  14. .PHONY: lint
  15. lint:
  16. $(SHELLCHECK) ./configure test_functions.sh ./sh/*
  17. SHELLCHECK=${SHELLCHECK} ./test-cmd/shellcheck
  18. ${FLAWFINDER} --error-level=4 .
  19. $(MANDOC) -Tlint -Wunsupp,error,warning $(MAN1)
  20. clean:
  21. rm -fr $(EXE)
  22. rm -fr ${EXE:=.c.gcov} ${EXE:=.gcda} ${EXE:=.gcno}
  23. install: all
  24. mkdir -p ${DESTDIR}${BINDIR}/
  25. cp -p ${EXE} sh/* ${DESTDIR}${BINDIR}/
  26. chown 0:0 ${DESTDIR}${BINDIR}/memsys
  27. chmod 4755 ${DESTDIR}${BINDIR}/memsys
  28. mkdir -p ${DESTDIR}${MANDIR}/man1
  29. cp -p ${MAN1} ${DESTDIR}${MANDIR}/man1
  30. .PHONY: coverage
  31. coverage:
  32. $(GCOV) -b $(EXE)
  33. C_SOURCES = cmd/*.c
  34. format: $(C_SOURCES)
  35. clang-format -style=file -assume-filename=.clang-format -i $(C_SOURCES)
  36. cmd/lolcat: cmd/lolcat.c Makefile
  37. rm -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno}
  38. $(CC) -std=c99 $(CFLAGS) -o $@ cmd/lolcat.c -lm $(LDFLAGS) $(LDSTATIC)
  39. cmd/xcd: cmd/xcd.c Makefile
  40. rm -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno}
  41. $(CC) -std=c99 $(CFLAGS) -o $@ cmd/xcd.c -lm $(LDFLAGS) $(LDSTATIC)