aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 8b6efbb808c5f8e7b91bf2ae4721de143da60e46 (plain)
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
31
# 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