1PREFIX ?= /usr/local2BINDIR ?= $(PREFIX)/bin3MANDIR ?= $(PREFIX)/share/man4DOCDIR ?= $(PREFIX)/share/doc/archive-logs56CFLAGS ?= -O0 -g -Werror7CFLAGS += -std=c998CFLAGS += -Wpedantic -Wall -Wextra \9 -Wmissing-prototypes -Wpointer-arith \10 -Wstrict-prototypes -Wshadow -Wformat-nonliteral1112# glibc needs _XOPEN_SOURCE for nftw(3)13CPPFLAGS += -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=5001415ifeq ($(HAVE_SENDFILE),1)16 CPPFLAGS += -DHAVE_SENDFILE17else18 HEADERS = compat/sendfile.h19endif2021archive-logs: archive-logs.c $(HEADERS)22 $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@23check: archive-logs24 @./tests/run_tests.sh2526install: archive-logs archive-logs.1 README.md27 install -Dm755 archive-logs "$(DESTDIR)$(BINDIR)/archive-logs"28 install -Dm644 archive-logs.1 "$(DESTDIR)$(MANDIR)/man1/archive-logs.1"29 install -Dm644 README.md "$(DESTDIR)$(DOCDIR)/README.md"3031.PHONY: check install