summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile53
1 files changed, 30 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index 8521947..fb01ff7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,6 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile,v 1.1.1.1 2004/11/19 16:45:31 lordjaxom Exp $
# You can change the compile options here or create a Make.config
# in the VDR directory an set them there.
@@ -18,6 +17,8 @@ WITH_NEW_FFMPEG_HEADERS=1
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
# By default the main source file also carries this name.
+# IMPORTANT: the presence of this macro is important for the Make.config
+# file. So it must be defined, even if it is not used here!
#
PLUGIN = osdpip
@@ -28,23 +29,26 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
### The C++ compiler and options:
CXX ?= g++
-CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual
+CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
### The directory environment:
-DVBDIR = ../../../../DVB
FFMDIR = ../../../../ffmpeg-0.4.8
VDRDIR = ../../..
LIBDIR = ../../lib
TMPDIR = /tmp
+### Make sure that necessary options are included:
+
+-include $(VDRDIR)/Make.global
+
### Allow user defined options to overwrite defaults:
-include $(VDRDIR)/Make.config
-### The version number of VDR (taken from VDR's "config.h"):
+### The version number of VDR's plugin API (taken from VDR's "config.h"):
-APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
+APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
### The name of the distribution archive:
@@ -53,14 +57,12 @@ PACKAGE = vdr-$(ARCHIVE)
### Includes and Defines (add further entries here):
-INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include -I. -I$(FFMDIR)/libavcodec
-LIBS = -L$(FFMDIR)/libavcodec -lavcodec
-DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
-DEFINES += -D_GNU_SOURCE
+INCLUDES += -I$(VDRDIR)/include
-### The object files (add further files here):
+DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
-OBJS = $(PLUGIN).o osd_info.o remux.o osd.o receiver.o setup.o i18n.o pes.o quantize.o decoder.o
+INCLUDES += -I$(FFMDIR)/libavcodec
+LIBS += -L$(FFMDIR)/libavcodec -lavcodec
ifdef FFMPEG_STATIC
DEFINES += -DHAVE_FFMPEG_STATIC
@@ -79,14 +81,22 @@ ifdef WITH_NEW_FFMPEG_HEADERS
DEFINES += -DUSE_NEW_FFMPEG_HEADERS
endif
+### The object files (add further files here):
+
+OBJS = $(PLUGIN).o osd_info.o remux.o osd.o receiver.o setup.o i18n.o pes.o quantize.o decoder.o
+
+### The main target:
+
+all: libvdr-$(PLUGIN).so i18n
+
### Implicit rules:
%.o: %.c
- $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+ $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
-# Dependencies:
+### Dependencies:
-MAKEDEP = g++ -MM -MG
+MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
$(DEPFILE): Makefile
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
@@ -109,31 +119,28 @@ $(I18Npot): $(wildcard *.c)
%.po: $(I18Npot)
msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
- touch $@
+ @touch $@
$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
- mkdir -p $(dir $@)
+ @mkdir -p $(dir $@)
cp $< $@
.PHONY: i18n
-i18n: $(I18Nmsgs)
+i18n: $(I18Nmsgs) $(I18Npot)
### Targets:
-all: libvdr-$(PLUGIN).so i18n
-
libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) -shared -o $@ $^ $(LIBS)
- @cp $@ $(LIBDIR)/$@.$(APIVERSION)
+ @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)
@cp -a * $(TMPDIR)/$(ARCHIVE)
- @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
+ @tar czf $(PACKAGE).tgz -C $(TMPDIR) --exclude debian $(ARCHIVE)
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@echo Distribution package created as $(PACKAGE).tgz
clean:
- @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
- @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~
+ @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot