summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2010-07-16 17:35:51 +0200
committerMichael Stapelberg <michael@stapelberg.de>2010-07-16 17:35:51 +0200
commit1dc3fd7bf000b57f8462416ae3e17f2f580d2020 (patch)
treec99f60831281a1ac59aecf2cc21f22c106798608 /Makefile
parentb4c10df0fc8440804d87e4df2f68a860b0bb08af (diff)
Initial commit of the XCB rewrite of i3lock
Changes: - Uses XCB instead of Xlib (like i3), thus cleaner/faster code - Uses cairo to load PNG images (*much* faster than XPM)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile58
1 files changed, 22 insertions, 36 deletions
diff --git a/Makefile b/Makefile
index 1fd76b9..9d3fb50 100644
--- a/Makefile
+++ b/Makefile
@@ -1,51 +1,37 @@
-# slock - simple screen locker
-# © 2006-2007 Anselm R. Garbe, Sander van Dijk
-# © 2009 Michael Stapelberg
+INSTALL=install
+PREFIX=/usr
-include config.mk
+# Check if pkg-config is installed, we need it for building CFLAGS/LDFLAGS
+ifeq ($(shell which pkg-config 2>/dev/null 1>/dev/null || echo 1),1)
+$(error "pkg-config was not found")
+endif
-SRC = i3lock.c
-OBJ = ${SRC:.c=.o}
+CFLAGS += -std=c99
+CFLAGS += -pipe
+CFLAGS += -Wall
+CFLAGS += -D_GNU_SOURCE
+CFLAGS += $(shell pkg-config --cflags cairo xcb-keysyms xcb-dpms)
+LDFLAGS += $(shell pkg-config --libs cairo xcb-keysyms xcb-dpms)
+LDFLAGS += -lpam
-all: options i3lock
+FILES:=$(wildcard *.c)
+FILES:=$(FILES:.c=.o)
-options:
- @echo i3lock build options:
- @echo "CFLAGS = ${CFLAGS}"
- @echo "LDFLAGS = ${LDFLAGS}"
- @echo "CC = ${CC}"
+VERSION:=$(shell git describe --tags --abbrev=0)
-.c.o:
- @echo CC $<
- @${CC} -c ${CFLAGS} $<
+.PHONY: install clean uninstall
-${OBJ}: config.mk
+all: i3lock
-i3lock: ${OBJ}
- @echo CC -o $@
- @${CC} -o $@ ${OBJ} ${LDFLAGS}
+i3lock: ${FILES}
+ $(CC) -o $@ $^ $(LDFLAGS)
clean:
- @echo cleaning
- @rm -f i3lock ${OBJ} i3lock-${VERSION}.tar.gz
-
-dist: clean
- @echo creating dist tarball
- @mkdir -p i3lock-${VERSION}
- @cp -R LICENSE Makefile README config.mk i3lock.1 ${SRC} i3lock-${VERSION}
- @tar -cf i3lock-${VERSION}.tar i3lock-${VERSION}
- @gzip i3lock-${VERSION}.tar
- @rm -rf i3lock-${VERSION}
+ rm -f i3lock ${FILES} i3lock-${VERSION}.tar.gz
install: all
- @echo installing executable file to $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
- $(INSTALL) -d $(MANDIR)/man1
$(INSTALL) -m 755 i3lock $(DESTDIR)$(PREFIX)/bin/i3lock
- $(INSTALL) -m 644 i3lock.1 $(MANDIR)/man1/i3lock.1
uninstall:
- @echo removing executable file from $(DESTDIR)$(PREFIX)/bin
- @rm -f $(DESTDIR)$(PREFIX)/bin/i3lock
-
-.PHONY: all options clean dist install uninstall
+ rm -f $(DESTDIR)$(PREFIX)/bin/i3lock