4 # Check if pkg-config is installed, we need it for building CFLAGS/LDFLAGS
5 ifeq ($(shell which pkg-config 2>/dev/null 1>/dev/null || echo 1),1)
6 $(error "pkg-config was not found")
12 CFLAGS += -D_GNU_SOURCE
14 CFLAGS += $(shell pkg-config --cflags cairo xcb-keysyms xcb-dpms)
15 LDFLAGS += $(shell pkg-config --libs cairo xcb-keysyms xcb-dpms xcb-image)
17 CFLAGS += -DNOLIBCAIRO
18 CFLAGS += $(shell pkg-config --cflags xcb-keysyms xcb-dpms)
19 LDFLAGS += $(shell pkg-config --libs xcb-keysyms xcb-dpms xcb-image)
23 FILES:=$(wildcard *.c)
26 VERSION:=$(shell git describe --tags --abbrev=0)
27 GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))"
28 CFLAGS += -DVERSION=\"${GIT_VERSION}\"
30 .PHONY: install clean uninstall
35 $(CC) -o $@ $^ $(LDFLAGS)
38 rm -f i3lock ${FILES} i3lock-${VERSION}.tar.gz
41 $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
42 $(INSTALL) -m 755 i3lock $(DESTDIR)$(PREFIX)/bin/i3lock
45 rm -f $(DESTDIR)$(PREFIX)/bin/i3lock