2012-07-16 09:41:34 +00:00
|
|
|
CC ?= gcc
|
2015-02-13 23:20:46 +00:00
|
|
|
CFLAGS = -Wall -std=c99 -Os
|
2014-02-09 23:54:33 +00:00
|
|
|
LDFLAGS = -lxcb -lxcb-xinerama -lxcb-randr
|
2012-07-16 09:41:34 +00:00
|
|
|
CFDEBUG = -g3 -pedantic -Wall -Wunused-parameter -Wlong-long\
|
|
|
|
-Wsign-conversion -Wconversion -Wimplicit-function-declaration
|
|
|
|
|
|
|
|
EXEC = bar
|
|
|
|
SRCS = bar.c
|
|
|
|
OBJS = ${SRCS:.c=.o}
|
|
|
|
|
2012-10-20 16:47:42 +00:00
|
|
|
PREFIX?=/usr
|
2012-07-16 09:41:34 +00:00
|
|
|
BINDIR=${PREFIX}/bin
|
|
|
|
|
|
|
|
all: ${EXEC}
|
|
|
|
|
2014-02-19 17:53:32 +00:00
|
|
|
doc: README.pod
|
|
|
|
pod2man --section=1 --center="bar Manual" --name "bar" --release="bar $(shell git describe --always)" README.pod > bar.1
|
|
|
|
|
2012-07-16 09:41:34 +00:00
|
|
|
.c.o:
|
|
|
|
${CC} ${CFLAGS} -o $@ -c $<
|
|
|
|
|
|
|
|
${EXEC}: ${OBJS}
|
2013-08-18 19:04:21 +00:00
|
|
|
${CC} -o ${EXEC} ${OBJS} ${LDFLAGS}
|
2012-07-16 09:41:34 +00:00
|
|
|
|
|
|
|
debug: ${EXEC}
|
|
|
|
debug: CC += ${CFDEBUG}
|
|
|
|
|
|
|
|
clean:
|
2014-02-19 17:53:32 +00:00
|
|
|
rm -f ./*.o ./*.1
|
2014-02-09 23:54:33 +00:00
|
|
|
rm -f ./${EXEC}
|
2012-07-16 09:41:34 +00:00
|
|
|
|
2014-02-19 17:53:32 +00:00
|
|
|
install: bar doc
|
|
|
|
install -D -m 755 bar ${DESTDIR}${BINDIR}/bar
|
|
|
|
install -D -m 644 bar.1 ${DESTDIR}${PREFIX}/share/man/man1/bar.1
|
2012-07-16 09:41:34 +00:00
|
|
|
|
2012-10-12 12:14:39 +00:00
|
|
|
uninstall:
|
|
|
|
rm -f ${DESTDIR}${BINDIR}/bar
|
2014-02-19 17:53:32 +00:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/bar.1
|
2012-10-12 12:14:39 +00:00
|
|
|
|
2012-07-16 09:41:34 +00:00
|
|
|
.PHONY: all debug clean install
|