summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile67
1 files changed, 35 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index 682e14dc..4b86faf6 100644
--- a/Makefile
+++ b/Makefile
@@ -4,28 +4,33 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
-# $Id: Makefile 2.31 2012/12/18 13:20:17 kls Exp $
+# $Id: Makefile 2.32 2012/12/19 11:26:50 kls Exp $
.DELETE_ON_ERROR:
CC ?= gcc
-CFLAGS ?= -g -O3 -Wall
+CFLAGS ?= -g -O3 -Wall -fPIC
+CFLAGS += -fPIC
CXX ?= g++
-CXXFLAGS ?= -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses
+CXXFLAGS ?= $(CFLAGS) -Werror=overloaded-virtual -Wno-parentheses
+CDEFINES = -D_GNU_SOURCE
+CDEFINES = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+
+CWD := $(shell pwd)
LSIDIR = ./libsi
DESTDIR ?=
PREFIX ?= /usr/local
MANDIR ?= $(PREFIX)/share/man
BINDIR ?= $(PREFIX)/bin
-INCDIR ?= $(PREFIX)/include
-LOCDIR ?= ./locale
+INCDIR ?= $(CWD)/include
+LOCDIR ?= $(CWD)/locale
LIBS = -ljpeg -lpthread -ldl -lcap -lrt $(shell pkg-config --libs freetype2 fontconfig)
INCLUDES ?= $(shell pkg-config --cflags freetype2 fontconfig)
-PLUGINDIR= ./PLUGINS
-PLUGINLIBDIR= $(PLUGINDIR)/lib
+PLUGINDIR= $(CWD)/PLUGINS
+LIBDIR = $(PLUGINDIR)/lib
# By default VDR requires only one single directory to operate:
VIDEODIR = /video
@@ -36,7 +41,6 @@ DOXYFILE = Doxyfile
PCDIR ?= $(firstword $(subst :, , ${PKG_CONFIG_PATH}:$(shell pkg-config --variable=pc_path pkg-config):$(PREFIX)/lib/pkgconfig))
-include Make.global
-include Make.config
SILIB = $(LSIDIR)/libsi.a
@@ -48,6 +52,8 @@ OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o d
skinclassic.o skinlcars.o skins.o skinsttng.o sourceparams.o sources.o spu.o status.o svdrp.o themes.o thread.o\
timers.o tools.o transfer.o vdr.o videodir.o
+DEFINES += $(CDEFINES)
+
ifndef NO_KBD
DEFINES += -DREMOTE_KBD
endif
@@ -66,15 +72,11 @@ endif
LIRC_DEVICE ?= /var/run/lirc/lircd
DEFINES += -DLIRC_DEVICE=\"$(LIRC_DEVICE)\"
-
-DEFINES += -D_GNU_SOURCE
-DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-
DEFINES += -DVIDEODIR=\"$(VIDEODIR)\"
DEFINES += -DCONFDIR=\"$(CONFDIR)\"
DEFINES += -DCACHEDIR=\"$(CACHEDIR)\"
DEFINES += -DRESDIR=\"$(RESDIR)\"
-DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\"
+DEFINES += -DPLUGINDIR=\"$(LIBDIR)\"
DEFINES += -DLOCDIR=\"$(LOCDIR)\"
# Default values for directories:
@@ -88,7 +90,7 @@ RESDIRDEF = $(firstword $(RESDIR) $(CONFDIRDEF))
VDRVERSION = $(shell sed -ne '/define VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
-all: vdr i18n vdr.pc
+all: vdr i18n plugins
# Implicit rules:
@@ -107,27 +109,28 @@ $(DEPFILE): Makefile
# The main program:
vdr: $(OBJS) $(SILIB)
- $(CXX) $(CXXFLAGS) -rdynamic $(LDFLAGS) $(OBJS) $(LIBS) $(LIBDIRS) $(SILIB) -o vdr
+ $(CXX) $(CXXFLAGS) -rdynamic $(LDFLAGS) $(OBJS) $(LIBS) $(SILIB) -o vdr
# The libsi library:
$(SILIB):
- $(MAKE) -C $(LSIDIR) all
+ $(MAKE) -C $(LSIDIR) CXXFLAGS="$(CXXFLAGS)" DEFINES="$(CDEFINES)" all
# pkg-config file:
-vdr.pc: Makefile Make.global
+.PHONY: vdr.pc
+vdr.pc:
@echo "bindir=$(BINDIR)" > $@
- @echo "includedir=$(INCDIR)" >> $@
+ @echo "incdir=$(INCDIR)" >> $@
@echo "configdir=$(CONFDIRDEF)" >> $@
@echo "videodir=$(VIDEODIR)" >> $@
@echo "cachedir=$(CACHEDIRDEF)" >> $@
@echo "resdir=$(RESDIRDEF)" >> $@
- @echo "plugindir=$(PLUGINLIBDIR)" >> $@
- @echo "localedir=$(LOCDIR)" >> $@
+ @echo "libdir=$(LIBDIR)" >> $@
+ @echo "locdir=$(LOCDIR)" >> $@
@echo "apiversion=$(APIVERSION)" >> $@
- @echo "cflags=$(CXXFLAGS) $(DEFINES) -I\$${includedir}" >> $@
- @echo "plugincflags=\$${cflags} -fPIC" >> $@
+ @echo "cflags=$(CFLAGS) $(CDEFINES)" >> $@
+ @echo "cxxflags=$(CXXFLAGS) $(CDEFINES)" >> $@
@echo "" >> $@
@echo "Name: VDR" >> $@
@echo "Description: Video Disk Recorder" >> $@
@@ -158,7 +161,7 @@ $(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr.mo: $(PODIR)/%.mo
cp $< $@
.PHONY: i18n
-i18n: $(I18Nmsgs)
+i18n: $(I18Nmsgs) $(I18Npot)
install-i18n:
@mkdir -p $(DESTDIR)$(LOCDIR)
@@ -174,7 +177,7 @@ include-dir:
# Plugins:
-plugins: include-dir
+plugins: include-dir vdr.pc
@failed="";\
noapiv="";\
for i in `ls $(PLUGINDIR)/src | grep -v '[^a-z0-9]'`; do\
@@ -184,7 +187,7 @@ plugins: include-dir
noapiv="$$noapiv $$i";\
continue;\
fi;\
- $(MAKE) -C "$(PLUGINDIR)/src/$$i" all || failed="$$failed $$i";\
+ $(MAKE) -C "$(PLUGINDIR)/src/$$i" VDRDIR=$(CWD) all || failed="$$failed $$i";\
done;\
if [ -n "$$noapiv" ] ; then echo; echo "*** plugins without APIVERSION:$$noapiv"; echo; fi;\
if [ -n "$$failed" ] ; then echo; echo "*** failed plugins:$$failed"; echo; exit 1; fi
@@ -226,8 +229,8 @@ install-doc:
# Plugins:
install-plugins: plugins
- @mkdir -p $(DESTDIR)$(PLUGINLIBDIR)
- @cp --remove-destination $(PLUGINDIR)/lib/lib*-*.so.$(APIVERSION) $(DESTDIR)$(PLUGINLIBDIR)
+ @mkdir -p $(DESTDIR)$(LIBDIR)
+ @cp --remove-destination $(PLUGINDIR)/lib/lib*-*.so.$(APIVERSION) $(DESTDIR)$(LIBDIR)
# Includes:
@@ -254,9 +257,9 @@ srcdoc:
# Housekeeping:
clean:
- $(MAKE) -C $(LSIDIR) clean
- -rm -f $(OBJS) $(DEPFILE) vdr vdr.pc core* *~
- -rm -rf $(LOCALEDIR) $(PODIR)/*.mo $(PODIR)/*.pot
- -rm -rf include
- -rm -rf srcdoc
+ @$(MAKE) -C $(LSIDIR) clean
+ @-rm -f $(OBJS) $(DEPFILE) vdr vdr.pc core* *~
+ @-rm -rf $(LOCALEDIR) $(PODIR)/*.mo $(PODIR)/*.pot
+ @-rm -rf include
+ @-rm -rf srcdoc
CLEAN: clean