aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile52
1 files changed, 52 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a84e889
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,52 @@
1# slock - simple screen locker
2# (C)opyright MMVI Anselm R. Garbe
3
4include config.mk
5
6SRC = slock.c
7OBJ = ${SRC:.c=.o}
8
9all: options slock
10
11options:
12 @echo slock build options:
13 @echo "CFLAGS = ${CFLAGS}"
14 @echo "LDFLAGS = ${LDFLAGS}"
15 @echo "CC = ${CC}"
16 @echo "LD = ${LD}"
17
18.c.o:
19 @echo CC $<
20 @${CC} -c ${CFLAGS} $<
21
22${OBJ}: config.mk
23
24slock: ${OBJ}
25 @echo LD $@
26 @${LD} -o $@ ${OBJ} ${LDFLAGS}
27 @strip $@
28
29clean:
30 @echo cleaning
31 @rm -f slock ${OBJ} slock-${VERSION}.tar.gz
32
33dist: clean
34 @echo creating dist tarball
35 @mkdir -p slock-${VERSION}
36 @cp -R LICENSE Makefile README config.mk ${SRC} slock-${VERSION}
37 @tar -cf slock-${VERSION}.tar slock-${VERSION}
38 @gzip slock-${VERSION}.tar
39 @rm -rf slock-${VERSION}
40
41install: all
42 @echo installing executable file to ${DESTDIR}${PREFIX}/bin
43 @mkdir -p ${DESTDIR}${PREFIX}/bin
44 @cp -f slock ${DESTDIR}${PREFIX}/bin
45 @chmod 755 ${DESTDIR}${PREFIX}/bin/slock
46 @chmod u+s ${DESTDIR}${PREFIX}/bin/slock
47
48uninstall:
49 @echo removing executable file from ${DESTDIR}${PREFIX}/bin
50 @rm -f ${DESTDIR}${PREFIX}/bin/slock
51
52.PHONY: all options clean dist install uninstall