2009-12-26 14:30:50 +01:00
|
|
|
# See LICENSE file for license and copyright information
|
|
|
|
# zathura - user interface
|
2009-08-11 23:18:50 +02:00
|
|
|
|
2009-12-26 14:30:50 +01:00
|
|
|
include config.mk
|
2011-08-31 16:04:55 +02:00
|
|
|
include common.mk
|
2009-08-11 23:18:50 +02:00
|
|
|
|
2009-12-26 14:30:50 +01:00
|
|
|
PROJECT = zathura
|
|
|
|
SOURCE = zathura.c
|
|
|
|
OBJECTS = ${SOURCE:.c=.o}
|
|
|
|
DOBJECTS = ${SOURCE:.c=.do}
|
|
|
|
|
|
|
|
all: options ${PROJECT}
|
|
|
|
|
|
|
|
options:
|
2010-01-28 13:57:54 +01:00
|
|
|
@echo ${PROJECT} build options:
|
2009-12-26 14:30:50 +01:00
|
|
|
@echo "CFLAGS = ${CFLAGS}"
|
2010-11-12 17:48:49 +01:00
|
|
|
@echo "LDFLAGS = ${LDFLAGS}"
|
2010-03-12 18:23:41 +01:00
|
|
|
@echo "LIBS = ${LIBS}"
|
2009-12-26 14:30:50 +01:00
|
|
|
@echo "DFLAGS = ${DFLAGS}"
|
|
|
|
@echo "CC = ${CC}"
|
|
|
|
|
|
|
|
%.o: %.c
|
2011-08-31 16:04:55 +02:00
|
|
|
$(ECHO) CC $<
|
|
|
|
$(QUIET)${CC} -c ${CFLAGS} -o $@ $<
|
2009-12-26 14:30:50 +01:00
|
|
|
|
|
|
|
%.do: %.c
|
2011-08-31 16:04:55 +02:00
|
|
|
$(ECHO) CC $<
|
|
|
|
$(QUIET)${CC} -c ${CFLAGS} ${DFLAGS} -o $@ $<
|
2009-12-26 14:30:50 +01:00
|
|
|
|
|
|
|
${OBJECTS}: config.h config.mk
|
|
|
|
${DOBJECTS}: config.h config.mk
|
|
|
|
|
2010-07-08 12:41:56 +02:00
|
|
|
config.h: config.def.h
|
|
|
|
@if [ -f $@ ] ; then \
|
|
|
|
echo "config.h exists, but config.def.h is newer. Please check your" \
|
|
|
|
"config.h or ${PROJECT} might fail to build." ; \
|
|
|
|
else \
|
2010-07-08 20:32:27 +02:00
|
|
|
cp $< $@ ; \
|
2010-07-08 12:41:56 +02:00
|
|
|
fi
|
2009-12-26 14:30:50 +01:00
|
|
|
|
|
|
|
${PROJECT}: ${OBJECTS}
|
2011-08-31 16:04:55 +02:00
|
|
|
$(ECHO) CC -o $@
|
|
|
|
$(QUIET)${CC} ${SFLAGS} ${LDFLAGS} -o $@ ${OBJECTS} ${LIBS}
|
2009-08-11 23:18:50 +02:00
|
|
|
|
|
|
|
clean:
|
2011-08-31 16:04:55 +02:00
|
|
|
$(QUIET)rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \
|
2009-12-26 14:30:50 +01:00
|
|
|
${DOBJECTS} ${PROJECT}-debug
|
|
|
|
|
2010-07-22 23:40:55 +02:00
|
|
|
distclean: clean
|
2011-08-31 16:04:55 +02:00
|
|
|
$(QUIET)rm -rf config.h
|
2010-07-22 23:40:55 +02:00
|
|
|
|
2009-12-26 14:30:50 +01:00
|
|
|
${PROJECT}-debug: ${DOBJECTS}
|
2011-08-31 16:04:55 +02:00
|
|
|
$(ECHO) CC -o ${PROJECT}-debug
|
|
|
|
$(QUIET)${CC} ${LDFLAGS} -o ${PROJECT}-debug ${DOBJECTS} ${LIBS}
|
2009-08-11 23:18:50 +02:00
|
|
|
|
2009-12-26 14:30:50 +01:00
|
|
|
debug: ${PROJECT}-debug
|
2009-08-11 23:18:50 +02:00
|
|
|
|
2009-09-12 11:19:51 +02:00
|
|
|
valgrind: debug
|
2009-12-26 14:30:50 +01:00
|
|
|
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes \
|
|
|
|
./${PROJECT}-debug
|
|
|
|
|
|
|
|
gdb: debug
|
|
|
|
cgdb ${PROJECT}-debug
|
|
|
|
|
|
|
|
dist: clean
|
2011-08-31 16:04:55 +02:00
|
|
|
$(QUIET)mkdir -p ${PROJECT}-${VERSION}
|
2011-11-09 16:42:37 +01:00
|
|
|
$(QUIET)cp -R LICENSE Makefile config.mk common.mk config.def.h README \
|
2011-07-12 20:11:06 +02:00
|
|
|
${PROJECT}.desktop ${PROJECT}rc.5.rst \
|
|
|
|
${PROJECT}.1 ${SOURCE} ${PROJECT}-${VERSION}
|
2011-08-31 16:04:55 +02:00
|
|
|
$(QUIET)tar -cf ${PROJECT}-${VERSION}.tar ${PROJECT}-${VERSION}
|
|
|
|
$(QUIET)gzip ${PROJECT}-${VERSION}.tar
|
|
|
|
$(QUIET)rm -rf ${PROJECT}-${VERSION}
|
2009-08-11 23:18:50 +02:00
|
|
|
|
|
|
|
install: all
|
2011-08-31 16:04:55 +02:00
|
|
|
$(ECHO) installing executable file
|
|
|
|
$(QUIET)mkdir -p ${DESTDIR}${PREFIX}/bin
|
|
|
|
$(QUIET)install -m 755 ${PROJECT} ${DESTDIR}${PREFIX}/bin
|
|
|
|
$(ECHO) installing manual page
|
|
|
|
$(QUIET)mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
|
|
|
$(QUIET)sed "s/VERSION/${VERSION}/g" < ${PROJECT}.1 > ${DESTDIR}${MANPREFIX}/man1/${PROJECT}.1
|
|
|
|
$(QUIET)if which rst2man > /dev/null ; then \
|
2011-07-08 15:51:04 +02:00
|
|
|
mkdir -p ${DESTDIR}${MANPREFIX}/man5 ; \
|
|
|
|
rst2man ${PROJECT}rc.5.rst > ${DESTDIR}${MANPREFIX}/man5/${PROJECT}rc.5 ; \
|
|
|
|
fi
|
2011-08-31 16:04:55 +02:00
|
|
|
$(QUIET)chmod 644 ${DESTDIR}${MANPREFIX}/man1/${PROJECT}.1
|
|
|
|
$(QUIET)mkdir -p ${DESTDIR}${DESKTOPPREFIX}
|
|
|
|
$(ECHO) installing desktop file
|
|
|
|
$(QUIET)install -m 644 ${PROJECT}.desktop ${DESTDIR}${DESKTOPPREFIX}
|
2009-08-11 23:18:50 +02:00
|
|
|
|
|
|
|
uninstall:
|
2011-08-31 16:04:55 +02:00
|
|
|
$(ECHO) removing executable file
|
|
|
|
$(QUIET)rm -f ${DESTDIR}${PREFIX}/bin/${PROJECT}
|
|
|
|
$(ECHO) removing manual page
|
|
|
|
$(QUIET)rm -f ${DESTDIR}${MANPREFIX}/man1/${PROJECT}.1
|
|
|
|
$(QUIET)rm -f ${DESTDIR}${MANPREFIX}/man5/${PROJECT}rc.5
|
|
|
|
$(ECHO) removing desktop file
|
|
|
|
$(QUIET)rm -f ${DESTDIR}${DESKTOPPREFIX}/${PROJECT}.desktop
|