Updated Makefiles (not finished)

This commit is contained in:
Moritz Lipp 2011-03-05 22:11:08 +01:00
parent 52377b994d
commit dc706aa912
8 changed files with 151 additions and 5 deletions

View file

@ -1,14 +1,14 @@
# See LICENSE file for license and copyright information # See LICENSE file for license and copyright information
# zathura - user interface
include config.mk include config.mk
PROJECT = zathura PROJECT = zathura
SOURCE = $(shell find . -iname "*.c" -a ! -iwholename "*./doc*|*./ft*") SOURCE = $(shell find . -iname "*.c" -a ! -iwholename "*./ft*")
OBJECTS = $(patsubst %.c, %.o, $(SOURCE)) OBJECTS = $(patsubst %.c, %.o, $(SOURCE))
DOBJECTS = $(patsubst %.c, %.do, $(SOURCE)) DOBJECTS = $(patsubst %.c, %.do, $(SOURCE))
all: options ${PROJECT} all: options ${PROJECT}
make -C ft
options: options:
@echo ${PROJECT} build options: @echo ${PROJECT} build options:
@ -35,12 +35,14 @@ ${PROJECT}: ${OBJECTS}
clean: clean:
@rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \ @rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \
${DOBJECTS} ${PROJECT}-debug ${DOBJECTS} ${PROJECT}-debug
make -C ft clean
${PROJECT}-debug: ${DOBJECTS} ${PROJECT}-debug: ${DOBJECTS}
@echo CC -o ${PROJECT}-debug @echo CC -o ${PROJECT}-debug
@${CC} ${LDFLAGS} -o ${PROJECT}-debug ${DOBJECTS} ${LIBS} @${CC} ${LDFLAGS} -o ${PROJECT}-debug ${DOBJECTS} ${LIBS}
debug: ${PROJECT}-debug debug: ${PROJECT}-debug
make -C ft debug
valgrind: debug valgrind: debug
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes \ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes \

View file

@ -8,8 +8,8 @@ PREFIX ?= /usr
MANPREFIX ?= ${PREFIX}/share/man MANPREFIX ?= ${PREFIX}/share/man
# libs # libs
GTK_INC = $(shell pkg-config --cflags gtk+-2.0 poppler-glib ddjvuapi) GTK_INC = $(shell pkg-config --cflags gtk+-2.0)
GTK_LIB = $(shell pkg-config --libs gtk+-2.0 gthread-2.0 poppler-glib ddjvuapi) GTK_LIB = $(shell pkg-config --libs gtk+-2.0 gthread-2.0)
INCS = -I. -I/usr/include ${GTK_INC} INCS = -I. -I/usr/include ${GTK_INC}
LIBS = -lc ${GTK_LIB} -lpthread -lm -lgirara -ldl LIBS = -lc ${GTK_LIB} -lpthread -lm -lgirara -ldl

18
ft/Makefile Normal file
View file

@ -0,0 +1,18 @@
# See LICENSE file for license and copyright information
SUBDIRS = $(shell find -mindepth 2 -maxdepth 2 -iname "Makefile" -exec dirname '{}' \;)
all:
@for dir in ${SUBDIRS}; do ${MAKE} -C $${dir}; done
debug:
@for dir in ${SUBDIRS}; do ${MAKE} -C $${dir} clean; done
clean:
@for dir in ${SUBDIRS}; do ${MAKE} -C $${dir} clean; done
install:
@for dir in ${SUBDIRS}; do ${MAKE} -C $${dir} install; done
uninstall:
@for dir in ${SUBDIRS}; do ${MAKE} -C $${dir} uninstall; done

42
ft/djvu/Makefile Normal file
View file

@ -0,0 +1,42 @@
# See LICENSE file for license and copyright information
include config.mk
PLUGIN = djvu
SOURCE = djvu.c
OBJECTS = ${SOURCE:.c=.o}
DOBJECTS = ${SOURCE:.c=.do}
all: options ${PLUGIN}
options:
@echo ${PLUGIN} build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "DFLAGS = ${DFLAGS}"
@echo "CC = ${CC}"
%.o: %.c
@echo CC $<
@${CC} -c ${CFLAGS} -o $@ $<
%.do: %.c
@echo CC $<
@${CC} -c ${CFLAGS} ${DFLAGS} -o $@ $<
${OBJECTS}: config.mk
${DOBJECTS}: config.mk
${PLUGIN}: ${OBJECTS}
@echo LD $@
@${LD} -shared ${LDFLAGS} -o ${PLUGIN}.so $(OBJECTS)
${PLUGIN}-debug: ${DOBJECTS}
@echo LD $@
@${LD} -shared ${LDFLAGS} -o ${PLUGIN}-debug.so $(DOBJECTS)
clean:
@rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).so ${PLUGIN}-debug.so
debug: options ${PLUGIN}-debug
@make -C debug

21
ft/djvu/config.mk Normal file
View file

@ -0,0 +1,21 @@
# See LICENSE file for license and copyright information
# paths
PREFIX ?= /usr
# libs
DJVU_INC = $(shell pkg-config --cflags gtk+-2.0 ddjvuapi)
DJVU_LIB = $(shell pkg-config --libs gtk+-2.0 ddjvuapi)
INCS = -I. -I/usr/include ${DJVU_INC}
LIBS = -lc ${DJVU_LIB}
# flags
CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)
# debug
DFLAGS = -g
# compiler
CC ?= gcc
LD ?= ld

42
ft/pdf/Makefile Normal file
View file

@ -0,0 +1,42 @@
# See LICENSE file for license and copyright information
include config.mk
PLUGIN = pdf
SOURCE = pdf.c
OBJECTS = ${SOURCE:.c=.o}
DOBJECTS = ${SOURCE:.c=.do}
all: options ${PLUGIN}
options:
@echo ${PLUGIN} build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "DFLAGS = ${DFLAGS}"
@echo "CC = ${CC}"
%.o: %.c
@echo CC $<
@${CC} -c ${CFLAGS} -o $@ $<
%.do: %.c
@echo CC $<
@${CC} -c ${CFLAGS} ${DFLAGS} -o $@ $<
${OBJECTS}: config.mk
${DOBJECTS}: config.mk
${PLUGIN}: ${OBJECTS}
@echo LD $@
@${LD} -shared ${LDFLAGS} -o ${PLUGIN}.so $(OBJECTS)
${PLUGIN}-debug: ${DOBJECTS}
@echo LD $@
@${LD} -shared ${LDFLAGS} -o ${PLUGIN}-debug.so $(DOBJECTS)
clean:
@rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).so ${PLUGIN}-debug.so
debug: options ${PLUGIN}-debug
@make -C debug

21
ft/pdf/config.mk Normal file
View file

@ -0,0 +1,21 @@
# See LICENSE file for license and copyright information
# paths
PREFIX ?= /usr
# libs
PDF_INC = $(shell pkg-config --cflags gtk+-2.0 poppler-glib)
PDF_LIB = $(shell pkg-config --libs gtk+-2.0 poppler-glib)
INCS = -I. -I/usr/include ${PDF_INC}
LIBS = -lc ${PDF_LIB}
# flags
CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)
# debug
DFLAGS = -g
# compiler
CC ?= gcc
LD ?= ld

View file

@ -5,8 +5,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <girara.h> #include <girara.h>
#include <render.h>
#include "render.h"
#include "document.h" #include "document.h"
enum { NEXT, PREVIOUS, LEFT, RIGHT, UP, DOWN, BOTTOM, TOP, HIDE, HIGHLIGHT, enum { NEXT, PREVIOUS, LEFT, RIGHT, UP, DOWN, BOTTOM, TOP, HIDE, HIGHLIGHT,