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
13 CFLAGS += $(shell pkg-config --cflags cairo xcb-keysyms xcb-dpms)
14 LDFLAGS += $(shell pkg-config --libs cairo xcb-keysyms xcb-dpms)
17 FILES:=$(wildcard *.c)
20 VERSION:=$(shell git describe --tags --abbrev=0)
22 .PHONY: install clean uninstall
27 $(CC) -o $@ $^ $(LDFLAGS)
30 rm -f i3lock ${FILES} i3lock-${VERSION}.tar.gz
33 $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
34 $(INSTALL) -m 755 i3lock $(DESTDIR)$(PREFIX)/bin/i3lock
37 rm -f $(DESTDIR)$(PREFIX)/bin/i3lock