2012-07-16 09:41:34 +00:00
|
|
|
CC ?= gcc
|
|
|
|
STRIP ?= strip
|
2012-07-24 10:25:45 +00:00
|
|
|
CFLAGS ?= -std=c99 -fshort-wchar -Os
|
2012-07-16 09:41:34 +00:00
|
|
|
LDFLAGS += -lxcb
|
|
|
|
CFDEBUG = -g3 -pedantic -Wall -Wunused-parameter -Wlong-long\
|
|
|
|
-Wsign-conversion -Wconversion -Wimplicit-function-declaration
|
|
|
|
|
|
|
|
EXEC = bar
|
|
|
|
SRCS = bar.c
|
|
|
|
OBJS = ${SRCS:.c=.o}
|
|
|
|
|
|
|
|
PREFIX?=/usr
|
|
|
|
BINDIR=${PREFIX}/bin
|
|
|
|
|
|
|
|
all: ${EXEC}
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
${CC} ${CFLAGS} -o $@ -c $<
|
|
|
|
|
2012-07-17 11:35:16 +00:00
|
|
|
${OBJS}: config.h
|
|
|
|
|
|
|
|
config.h:
|
|
|
|
@echo creating $@ from config.def.h
|
|
|
|
@cp config.def.h $@
|
|
|
|
|
2012-07-16 09:41:34 +00:00
|
|
|
${EXEC}: ${OBJS}
|
|
|
|
${CC} ${LDFLAGS} -o ${EXEC} ${OBJS}
|
|
|
|
${STRIP} -s ${EXEC}
|
|
|
|
|
|
|
|
debug: ${EXEC}
|
|
|
|
debug: CC += ${CFDEBUG}
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf ./*.o
|
|
|
|
rm -rf ./${EXEC}
|
|
|
|
|
|
|
|
install: bar
|
|
|
|
test -d ${DESTDIR}${BINDIR} || mkdir -p ${DESTDIR}${BINDIR}
|
|
|
|
install -m755 bar ${DESTDIR}${BINDIR}/bar
|
|
|
|
|
2012-10-12 12:14:39 +00:00
|
|
|
uninstall:
|
|
|
|
rm -f ${DESTDIR}${BINDIR}/bar
|
|
|
|
|
2012-07-16 09:41:34 +00:00
|
|
|
.PHONY: all debug clean install
|