# Define variables CC = gcc CFLAGS = -std=c99 -Wall $(shell pkg-config --cflags libnotify) LDFLAGS = $(shell pkg-config --libs libnotify) LIBS = -lnotify TARGET = lowbat SRCS = lowbat.c OBJS = $(SRCS:.c=.o) all: $(TARGET) $(TARGET): $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ clean: rm -f $(TARGET) $(OBJS) install: all mkdir -p /usr/local/bin cp lowbat /usr/local/bin/lowbat chmod 755 /usr/local/bin/lowbat cp lowbat.1 /usr/local/share/man/man1/lowbat.1 chmod 644 /usr/local/share/man/man1/lowbat.1 uninstall: rm -f /usr/local/bin/lowbat /usr/local/share/man/man1/lowbat.1 .PHONY: all clean