From 63e18945230882dbbffdd15d8c7dd9f6728f8286 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Fri, 12 Mar 2010 18:23:41 +0100 Subject: [PATCH] Patch for zathura build system A patch to zathuras build system to get zathura included in gentoos portage. Thanks a lot to ssuominen! --- Makefile | 18 +++++++++--------- config.mk | 7 +++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 0103fc5..4370813 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ all: options ${PROJECT} options: @echo ${PROJECT} build options: @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" + @echo "LIBS = ${LIBS}" @echo "DFLAGS = ${DFLAGS}" @echo "CC = ${CC}" @@ -33,7 +33,7 @@ config.h: ${PROJECT}: ${OBJECTS} @echo CC -o $@ - @${CC} -o $@ ${OBJECTS} ${LDFLAGS} + @${CC} ${LDFLAGS} -o $@ ${OBJECTS} ${LIBS} clean: @rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \ @@ -41,7 +41,7 @@ clean: ${PROJECT}-debug: ${DOBJECTS} @echo CC -o ${PROJECT}-debug - @${CC} -o ${PROJECT}-debug ${DOBJECTS} ${LDFLAGS} + @${CC} ${LDFLAGS} -o ${PROJECT}-debug ${DOBJECTS} ${LIBS} debug: ${PROJECT}-debug @@ -62,13 +62,13 @@ dist: clean install: all @echo installing executeable file - @mkdir -p ${PREFIX}/bin - @cp -f ${PROJECT} ${PREFIX}/bin - @chmod 755 ${PROJECT} ${PREFIX}/bin/${PROJECT} + @mkdir -p ${DESTDIR}${PREFIX}/bin + @cp -f ${PROJECT} ${DESTDIR}${PREFIX}/bin + @chmod 755 ${PROJECT} ${DESTDIR}${PREFIX}/bin/${PROJECT} @echo installing manual page - @mkdir -p ${MANPREFIX}/man1 - @sed "s/VERSION/${VERSION}/g" < ${PROJECT}.1 > ${MANPREFIX}/man1/${PROJECT}.1 - @chmod 644 ${MANPREFIX}/man1/${PROJECT}.1 + @mkdir -p ${DESTDIR}${MANPREFIX}/man1 + @sed "s/VERSION/${VERSION}/g" < ${PROJECT}.1 > ${DESTDIR}${MANPREFIX}/man1/${PROJECT}.1 + @chmod 644 ${DESTDIR}${MANPREFIX}/man1/${PROJECT}.1 uninstall: @echo removing executeable file diff --git a/config.mk b/config.mk index 2d32656..04073b7 100644 --- a/config.mk +++ b/config.mk @@ -12,14 +12,13 @@ GTK_INC = $(shell pkg-config --cflags gtk+-2.0 poppler-glib) GTK_LIB = $(shell pkg-config --libs gtk+-2.0 gthread-2.0 poppler-glib) INCS = -I. -I/usr/include ${GTK_INC} -LIBS = -L/usr/lib -lc ${GTK_LIB} -lpthread +LIBS = -lc ${GTK_LIB} -lpthread # flags -CFLAGS = -std=c99 -pedantic -Wall $(INCS) -LDFLAGS = ${LIBS} +CFLAGS += -std=c99 -pedantic -Wall $(INCS) # debug DFLAGS = -g # compiler -CC = gcc +CC ?= gcc