-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 671 Bytes
/
Makefile
File metadata and controls
35 lines (25 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
NAME = keymouse
VERSION = 0.1
PREFIX = /usr/local
BINDIR = ${PREFIX}/bin
MANDIR = ${PREFIX}/share/man/man1
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
INC = -I. -I/usr/include -I${X11INC}
LIB = -L${X11LIB} -lX11 -lXtst
DEF = "-DVERSION=\"${VERSION}\"" "-DNAME=\"${NAME}\""
CFLAGS = -Wall -Wextra -std=c99 -pedantic -Os ${INC} ${DEF}
LDFLAGS = -s ${LIB}
SOURCE = keymouse.c
all: ${NAME}
${NAME}: ${SOURCE}
${CC} ${CFLAGS} ${LDFLAGS} ${SOURCE} -o $@
chmod +x $@
install: ${NAME}
cp ${NAME} /usr/bin/
sed keymouse.1 -e "s/VERSION/v${VERSION}/" > "${MANDIR}/${NAME}.1"
uninstall:
rm -f /usr/bin/${NAME}
rm -f ${MANDIR}/${NAME}.1
clean:
rm -f ${NAME}