diff options
| author | Jochen Dolze <vdr@dolze.de> | 2010-03-30 18:49:58 +0200 |
|---|---|---|
| committer | Jochen Dolze <vdr@dolze.de> | 2010-03-30 18:49:58 +0200 |
| commit | 74cdd9ffa1d0e5f74942051e7e22e07542929c03 (patch) | |
| tree | e59472547b1ed3543b8e2d1d0e2a7c52fcb24c04 /Makefile | |
| parent | 6446f24dce1b30fa341b7de078ca4385d1378457 (diff) | |
| download | vdr-plugin-markad-74cdd9ffa1d0e5f74942051e7e22e07542929c03.tar.gz vdr-plugin-markad-74cdd9ffa1d0e5f74942051e7e22e07542929c03.tar.bz2 | |
Changed directory structure, added Makefiles
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 127 |
1 files changed, 20 insertions, 107 deletions
@@ -1,124 +1,37 @@ # -# Makefile for a Video Disk Recorder plugin +# Makefile for a Video Disk Recorder plugin + program # -# $Id$ -# 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 = markad - -### The version number of this plugin (taken from the main source file): +DIRS = command plugin VERSION = $(shell grep 'static const char \*VERSION *=' version.h | awk '{ print $$6 }' | sed -e 's/[";]//g') -### The C++ compiler and options: - -CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Wextra -Woverloaded-virtual -Wno-parentheses -PKG-CONFIG ?= pkg-config - -### The directory environment: - -VDRDIR = ../../.. -LIBDIR = ../../lib TMPDIR = /tmp - -### Allow user defined options to overwrite defaults: - --include $(VDRDIR)/Make.config - -### The version number of VDR's plugin API (taken from VDR's "config.h"): - -APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) - -### The name of the distribution archive: - -ARCHIVE = $(PLUGIN)-$(VERSION) +ARCHIVE = markad-$(VERSION) PACKAGE = vdr-$(ARCHIVE) -### Includes and Defines (add further entries here): - -PKG-LIBS += libavcodec -PKG-INCLUDES += libavcodec - -INCLUDES += -I$(VDRDIR)/include - -DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE - -INCLUDES += $(shell $(PKG-CONFIG) --cflags $(PKG-INCLUDES)) -LIBS-CMD += $(shell $(PKG-CONFIG) --libs $(PKG-LIBS)) - -### The object files (add further files here): - -OBJS-CMD = markad-standalone.o decoder.o marks.o streaminfo.o video.o audio.o demux.o queue.o vdr2pkt.o ts2pkt.o pes2es.o -OBJS = $(PLUGIN).o status.o - -### The main target: - -all: libvdr-$(PLUGIN).so $(PLUGIN) i18n - -### Implicit rules: - -%.o: %.cpp - $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< - -### Dependencies: - -MAKEDEP = $(CXX) -MM -MG -DEPFILE = .dependencies -$(DEPFILE): Makefile - @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.cpp) > $@ - @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS-CMD:%.o=%.cpp) >> $@ - --include $(DEPFILE) - -### Internationalization (I18N): - -PODIR = po -LOCALEDIR = $(VDRDIR)/locale -I18Npo = $(wildcard $(PODIR)/*.po) -I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) -I18Npot = $(PODIR)/$(PLUGIN).pot - -%.mo: %.po - msgfmt -c -o $@ $< - -$(I18Npot): $(wildcard *.cpp *.h) - xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<see README>' -o $@ $^ - -%.po: $(I18Npot) - msgmerge -U --no-wrap --no-location --backup=none -q $@ $< - @touch $@ - -$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo - @mkdir -p $(dir $@) - cp $< $@ - -.PHONY: i18n -i18n: $(I18Nmsgs) $(I18Npot) - -### Targets: - -libvdr-$(PLUGIN).so: $(OBJS) - $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@ - @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION) +all: + for i in $(DIRS); do make -C $$i; done -$(PLUGIN): $(OBJS-CMD) - $(CXX) $(CXXFLAGS) $(OBJS-CMD) $(LIBS-CMD) -o $@ +install: + for i in $(DIRS); do make -C $$i install; done -dist: clean +dist: @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) - @cp -a *.cpp *.h $(TMPDIR)/$(ARCHIVE) - @cp -a logos po COPYING HISTORY README Makefile $(TMPDIR)/$(ARCHIVE) - @tar czf $(PACKAGE).tgz -C $(TMPDIR) --exclude debian --exclude CVS --exclude .svn --exclude markad.kdevelop --exclude markad.kdevelop.filelist --exclude markad.kdevelop.pcs --exclude markad.kdevses --exclude Doxyfile --exclude test $(ARCHIVE) + @mkdir $(TMPDIR)/$(ARCHIVE)/plugin + @mkdir $(TMPDIR)/$(ARCHIVE)/plugin/po + @mkdir $(TMPDIR)/$(ARCHIVE)/command + @mkdir $(TMPDIR)/$(ARCHIVE)/command/logos + @cp -a plugin/*.cpp plugin/*.h plugin/Makefile $(TMPDIR)/$(ARCHIVE)/plugin + @cp -a plugin/po/*.po $(TMPDIR)/$(ARCHIVE)/plugin/po + @cp -a command/*.cpp command/*.h command/Makefile $(TMPDIR)/$(ARCHIVE)/command + @cp -a command/logos/*.pgm $(TMPDIR)/$(ARCHIVE)/command/logos + @cp -a *.h COPYING HISTORY README INSTALL Makefile $(TMPDIR)/$(ARCHIVE) + @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE) @echo Distribution package created as $(PACKAGE).tgz clean: - @-rm -f $(OBJS) $(OBJS-COMMON) $(OBJS-CMD) $(DEPFILE) $(PLUGIN) *.so *.so.* *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot + for i in $(DIRS); do make -C $$i clean; done + @-rm -f $(PACKAGE).tgz |
