-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
37 lines (31 loc) · 1.16 KB
/
Makefile
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
32
33
34
35
36
37
CFLAGS += -Wall -Wextra -Wformat-security -Wconversion -fstack-protector-all -std=gnu99 -g
# If the user has libelogind installed, we can assume
# that they want to use libelogind instead of libsystemd.
$(shell pkg-config --exists libelogind 2> /dev/null)
ifeq ($(.SHELLSTATUS),0)
$(info libelogind is installed: using libelogind instead of libsystemd)
CFLAGS += $(shell pkg-config --cflags libelogind)
LDLIBS += $(shell pkg-config --libs libelogind)
else
LDLIBS += -lsystemd
endif
systembus-notify: *.c *.h Makefile
$(CC) $(LDFLAGS) $(CFLAGS) -o systembus-notify *.c $(LDLIBS)
# Depends on compilation to make sure the syntax is ok.
format: systembus-notify
clang-format --style=WebKit -i *.h *.c
.PHONY: install
install: systembus-notify
mkdir -p ${HOME}/bin ${HOME}/.config/autostart
cp systembus-notify ${HOME}/bin
cp systembus-notify.desktop ${HOME}/.config/autostart
.PHONY: uninstall
uninstall:
# delete in reverse order compared to install
rm -f ${HOME}/.config/systemd/user/systembus-notify.service
rm -f ${HOME}/.config/autostart/systembus-notify.desktop
rm -f ${HOME}/bin/systembus-notify
.PHONY: test
test: systembus-notify
cppcheck -q . || true
./testmessage.sh