1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
CFLAGS ?= -O2 -g -Wall -Wextra -Werror
PREFIX ?= /usr/local
all: fatrace tests/slow-exit.so
fatrace: fatrace.o
$(CC) $(LDFLAGS) -o $@ $<
clean:
rm -f *.o fatrace tests/slow-exit.so
distclean: clean
install: fatrace
install -m 755 -D fatrace $(DESTDIR)$(PREFIX)/sbin/fatrace
install -m 755 power-usage-report $(DESTDIR)$(PREFIX)/sbin/
install -d $(DESTDIR)$(PREFIX)/share/man/man8/
install -m 644 *.8 $(DESTDIR)$(PREFIX)/share/man/man8/
tests/slow-exit.so: tests/slow-exit.c
$(CC) -shared -fPIC -o $@ $< -ldl
lint:
ruff check power-usage-report
ruff check tests
mypy power-usage-report
mypy tests
.PHONY: all clean distclean install lint
|