-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
47 lines (35 loc) · 934 Bytes
/
Makefile
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
36
37
38
39
40
41
42
43
44
45
46
47
VERSION= 1.6
VERSION!= [ -d .git ] && \
echo "git-`git rev-list --abbrev-commit --tags --max-count=1`" || \
echo "${VERSION}"
CC?= cc
PREFIX?= /usr/local
PKGLIBS= x11 xft xrandr xtst xres freetype2
CFLAGS+= -O2 -Wall \
-Wunused -Wmissing-prototypes -Wstrict-prototypes \
`pkg-config --cflags ${PKGLIBS}` \
-DVERSION=\"${VERSION}\"
LDFLAGS+= `pkg-config --libs ${PKGLIBS}`
# uncomment to enable debugging
#CFLAGS+= -g -DDEBUG=1
# and this for subsystem-specific debugging
#CFLAGS+= -DINPUT_DEBUG=1
#CFLAGS+= -DSENDCMD_DEBUG=1
BINDIR= ${DESTDIR}$(PREFIX)/bin
MANDIR?= ${DESTDIR}$(PREFIX)/man/man1
SRC!= ls *.c
OBJ= ${SRC:.c=.o}
BIN= sdorfehs
MAN= sdorfehs.1
all: sdorfehs
sdorfehs: $(OBJ)
$(CC) -o $@ $(OBJ) $(LDFLAGS)
install: all
mkdir -p $(BINDIR) $(MANDIR)
install -s $(BIN) $(BINDIR)
install -m 644 $(MAN) $(MANDIR)
regress:
scan-build $(MAKE)
clean:
rm -f $(BIN) $(OBJ)
.PHONY: all install clean