5 # Check if pkg-config is installed, we need it for building CFLAGS/LIBS
6 ifeq ($(shell which pkg-config 2>/dev/null 1>/dev/null || echo 1),1)
7 $(error "pkg-config was not found")
13 CPPFLAGS += -D_GNU_SOURCE
15 CFLAGS += $(shell pkg-config --cflags cairo xcb-keysyms xcb-dpms)
16 LIBS += $(shell pkg-config --libs cairo xcb-keysyms xcb-dpms xcb-image)
18 CPPFLAGS += -DNOLIBCAIRO
19 CFLAGS += $(shell pkg-config --cflags xcb-keysyms xcb-dpms)
20 LIBS += $(shell pkg-config --libs xcb-keysyms xcb-dpms xcb-image)
24 FILES:=$(wildcard *.c)
27 VERSION:=$(shell git describe --tags --abbrev=0)
28 GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))"
29 CPPFLAGS += -DVERSION=\"${GIT_VERSION}\"
31 .PHONY: install clean uninstall
36 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
39 rm -f i3lock ${FILES} i3lock-${VERSION}.tar.gz
42 $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
43 $(INSTALL) -d $(DESTDIR)$(SYSCONFDIR)/pam.d
44 $(INSTALL) -m 755 i3lock $(DESTDIR)$(PREFIX)/bin/i3lock
45 $(INSTALL) -m 644 i3lock.pam $(DESTDIR)$(SYSCONFDIR)/pam.d/i3lock
48 rm -f $(DESTDIR)$(PREFIX)/bin/i3lock