mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 11:36:01 +01:00
Updated Makefiles (not finished)
This commit is contained in:
parent
52377b994d
commit
dc706aa912
8 changed files with 151 additions and 5 deletions
6
Makefile
6
Makefile
|
@ -1,14 +1,14 @@
|
|||
# See LICENSE file for license and copyright information
|
||||
# zathura - user interface
|
||||
|
||||
include config.mk
|
||||
|
||||
PROJECT = zathura
|
||||
SOURCE = $(shell find . -iname "*.c" -a ! -iwholename "*./doc*|*./ft*")
|
||||
SOURCE = $(shell find . -iname "*.c" -a ! -iwholename "*./ft*")
|
||||
OBJECTS = $(patsubst %.c, %.o, $(SOURCE))
|
||||
DOBJECTS = $(patsubst %.c, %.do, $(SOURCE))
|
||||
|
||||
all: options ${PROJECT}
|
||||
make -C ft
|
||||
|
||||
options:
|
||||
@echo ${PROJECT} build options:
|
||||
|
@ -35,12 +35,14 @@ ${PROJECT}: ${OBJECTS}
|
|||
clean:
|
||||
@rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \
|
||||
${DOBJECTS} ${PROJECT}-debug
|
||||
make -C ft clean
|
||||
|
||||
${PROJECT}-debug: ${DOBJECTS}
|
||||
@echo CC -o ${PROJECT}-debug
|
||||
@${CC} ${LDFLAGS} -o ${PROJECT}-debug ${DOBJECTS} ${LIBS}
|
||||
|
||||
debug: ${PROJECT}-debug
|
||||
make -C ft debug
|
||||
|
||||
valgrind: debug
|
||||
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes \
|
||||
|
|
|
@ -8,8 +8,8 @@ PREFIX ?= /usr
|
|||
MANPREFIX ?= ${PREFIX}/share/man
|
||||
|
||||
# libs
|
||||
GTK_INC = $(shell pkg-config --cflags gtk+-2.0 poppler-glib ddjvuapi)
|
||||
GTK_LIB = $(shell pkg-config --libs gtk+-2.0 gthread-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)
|
||||
|
||||
INCS = -I. -I/usr/include ${GTK_INC}
|
||||
LIBS = -lc ${GTK_LIB} -lpthread -lm -lgirara -ldl
|
||||
|
|
18
ft/Makefile
Normal file
18
ft/Makefile
Normal 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
42
ft/djvu/Makefile
Normal 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
21
ft/djvu/config.mk
Normal 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
42
ft/pdf/Makefile
Normal 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
21
ft/pdf/config.mk
Normal 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
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
#include <girara.h>
|
||||
#include <render.h>
|
||||
|
||||
#include "render.h"
|
||||
#include "document.h"
|
||||
|
||||
enum { NEXT, PREVIOUS, LEFT, RIGHT, UP, DOWN, BOTTOM, TOP, HIDE, HIGHLIGHT,
|
||||
|
|
Loading…
Reference in a new issue