You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
852 B

  1. INSTALL=install
  2. PREFIX=/usr
  3. # Check if pkg-config is installed, we need it for building CFLAGS/LDFLAGS
  4. ifeq ($(shell which pkg-config 2>/dev/null 1>/dev/null || echo 1),1)
  5. $(error "pkg-config was not found")
  6. endif
  7. CFLAGS += -std=c99
  8. CFLAGS += -pipe
  9. CFLAGS += -Wall
  10. CFLAGS += -D_GNU_SOURCE
  11. CFLAGS += $(shell pkg-config --cflags cairo xcb-keysyms xcb-dpms)
  12. LDFLAGS += $(shell pkg-config --libs cairo xcb-keysyms xcb-dpms xcb-image)
  13. LDFLAGS += -lpam
  14. FILES:=$(wildcard *.c)
  15. FILES:=$(FILES:.c=.o)
  16. VERSION:=$(shell git describe --tags --abbrev=0)
  17. .PHONY: install clean uninstall
  18. all: i3lock
  19. i3lock: ${FILES}
  20. $(CC) -o $@ $^ $(LDFLAGS)
  21. clean:
  22. rm -f i3lock ${FILES} i3lock-${VERSION}.tar.gz
  23. install: all
  24. $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
  25. $(INSTALL) -m 755 i3lock $(DESTDIR)$(PREFIX)/bin/i3lock
  26. uninstall:
  27. rm -f $(DESTDIR)$(PREFIX)/bin/i3lock