mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Makefile improvements
This commit is contained in:
		
							
								
								
									
										11
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -1285,3 +1285,14 @@ Video Disk Recorder Revision History | ||||
|   See PLUGINS.html, section "Configuration files" for details. | ||||
| - Improved the [eid]syslog() macros, so that the LOG_... macros don't need to be | ||||
|   given any more. | ||||
|  | ||||
| 2002-05-17: Version 1.1.3 | ||||
|  | ||||
| - Improved the VDR Makefile to avoid a warning if the '.dependencies' file does | ||||
|   not exist, and also using $(MAKE) to call recursive makes. | ||||
| - Changed the name of the 'package' target in the plugin Makefiles to 'dist' | ||||
|   (following the suggestions in the "GNU Make" manual). If you already have started | ||||
|   a plugin project, you may want to change this in your Makefile accordingly. | ||||
| - Improved the plugin Makefile to avoid a warning if the '.dependencies' file does | ||||
|   not exist, and also using $(shell...) to get the version numbers. If you already have | ||||
|   started a plugin project, you may want to change this in your Makefile accordingly. | ||||
|   | ||||
							
								
								
									
										12
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Makefile
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
| # See the main source file 'vdr.c' for copyright information and | ||||
| # how to reach the author. | ||||
| # | ||||
| # $Id: Makefile 1.35 2002/05/10 10:24:46 kls Exp $ | ||||
| # $Id: Makefile 1.36 2002/05/14 21:12:28 kls Exp $ | ||||
|  | ||||
| .DELETE_ON_ERROR: | ||||
|  | ||||
| @@ -66,7 +66,7 @@ DEPFILE = .dependencies | ||||
| $(DEPFILE): Makefile | ||||
| 	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ | ||||
|  | ||||
| include $(DEPFILE) | ||||
| -include $(DEPFILE) | ||||
|  | ||||
| # The main program: | ||||
|  | ||||
| @@ -88,7 +88,7 @@ genfontfile: genfontfile.c | ||||
| # The libdtv library: | ||||
|  | ||||
| $(DTVLIB) $(DTVDIR)/libdtv.h: | ||||
| 	make -C $(DTVDIR) all | ||||
| 	$(MAKE) -C $(DTVDIR) all | ||||
|  | ||||
| # The 'include' directory (for plugins): | ||||
|  | ||||
| @@ -99,10 +99,10 @@ include-dir: | ||||
| # Plugins: | ||||
|  | ||||
| plugins: include-dir | ||||
| 	@for i in `ls $(PLUGINDIR)/src | grep -v '[^a-z0-9]'`; do make -C "$(PLUGINDIR)/src/$$i" all; done | ||||
| 	@for i in `ls $(PLUGINDIR)/src | grep -v '[^a-z0-9]'`; do $(MAKE) -C "$(PLUGINDIR)/src/$$i" all; done | ||||
|  | ||||
| plugins-clean: | ||||
| 	@for i in `ls $(PLUGINDIR)/src | grep -v '[^a-z0-9]'`; do make -C "$(PLUGINDIR)/src/$$i" clean; done | ||||
| 	@for i in `ls $(PLUGINDIR)/src | grep -v '[^a-z0-9]'`; do $(MAKE) -C "$(PLUGINDIR)/src/$$i" clean; done | ||||
| 	@-rm -f $(PLUGINDIR)/lib/* | ||||
|  | ||||
| # Install the files: | ||||
| @@ -119,7 +119,7 @@ install: | ||||
| # Housekeeping: | ||||
|  | ||||
| clean: | ||||
| 	make -C $(DTVDIR) clean | ||||
| 	$(MAKE) -C $(DTVDIR) clean | ||||
| 	-rm -f $(OBJS) $(DEPFILE) vdr genfontfile genfontfile.o core* *~ | ||||
| 	-rm -rf include | ||||
| fontclean: | ||||
|   | ||||
							
								
								
									
										33
									
								
								PLUGINS.html
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								PLUGINS.html
									
									
									
									
									
								
							| @@ -16,12 +16,15 @@ This document describes the "outside" interface of the plugin system. | ||||
| It handles everything necessary for a plugin to get hooked into the core | ||||
| VDR program and present itself to the user. | ||||
| <p> | ||||
| <!--X1.1.1--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| <!--X1.1.1--><table width=100%><tr><td bgcolor=lime> </td><td width=100%> | ||||
| Important modifications introduced in version 1.1.1 are marked like this. | ||||
| <!--X1.1.1--></td></tr></table> | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=red> </td><td width=100%> | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| Important modifications introduced in version 1.1.2 are marked like this. | ||||
| <!--X1.1.2--></td></tr></table> | ||||
| <!--X1.1.3--><table width=100%><tr><td bgcolor=red> </td><td width=100%> | ||||
| Important modifications introduced in version 1.1.3 are marked like this. | ||||
| <!--X1.1.3--></td></tr></table> | ||||
| <!--<p>TODO: Link to the document about VDR base classes to use when implementing actual functionality (yet to be written).--> | ||||
|  | ||||
| <hr><h2>Quick start</h2> | ||||
| @@ -117,7 +120,7 @@ from the web, it will typically have a name like | ||||
| <p> | ||||
| and will unpack into a directory named | ||||
| <p> | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=red> </td><td width=100%> | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| <tt>hello-0.0.1</tt> | ||||
| <!--X1.1.2--></td></tr></table> | ||||
| <p> | ||||
| @@ -125,7 +128,7 @@ To use the <tt>plugins</tt> and <tt>plugins-clean</tt> targets from the VDR <tt> | ||||
| you need to unpack such an archive into the <tt>VDR/PLUGINS/src</tt> directory and | ||||
| create a symbolic link with the basic plugin name, as in | ||||
|  | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=red> </td><td width=100%> | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| <p><table><tr><td bgcolor=#F0F0F0><pre><br> | ||||
| ln -s hello-0.0.1 hello | ||||
| </pre></td></tr></table><p> | ||||
| @@ -191,7 +194,7 @@ its memory. You don't need to worry about the details behind all this. | ||||
| If your plugin requires additional source files, simply add them to your plugin's | ||||
| source directory and adjust the <tt>Makefile</tt> accordingly. | ||||
| <p> | ||||
| <!--X1.1.1--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| <!--X1.1.1--><table width=100%><tr><td bgcolor=lime> </td><td width=100%> | ||||
| Header files usually contain preprocessor statements that prevent the same | ||||
| file (or rather its contents, to be precise) from being included more than once, like | ||||
|  | ||||
| @@ -410,7 +413,7 @@ If a plugin implements a function that runs in the background (presumably in a | ||||
| thread of its own), or wants to make use of <a href="#Internationalization">internationalization</a>, | ||||
| it needs to implement the function | ||||
|  | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=red> </td><td width=100%> | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| <p><table><tr><td bgcolor=#F0F0F0><pre><br> | ||||
| virtual bool Start(void); | ||||
| </pre></td></tr></table><p> | ||||
| @@ -422,7 +425,7 @@ its task. This may, for instance, be a thread that collects data from the DVB | ||||
| stream, which is later presented to the user via a function that is available | ||||
| from the main menu. | ||||
| <p> | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=red> </td><td width=100%> | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| A return value of <i>false</i> indicates that something has gone wrong and the | ||||
| plugin will not be able to perform its task. In that case, the plugin should | ||||
| write a proper error message to the log file. The first plugin that returns | ||||
| @@ -486,7 +489,7 @@ interaction is possible. If a specific action takes longer than a few seconds, | ||||
| the plugin should launch a separate thread to do this. | ||||
| </b> | ||||
|  | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=red> </td><td width=100%> | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| <hr><h2>Housekeeping</h2> | ||||
|  | ||||
| <center><i><b>Chores, chores...</b></i></center><p> | ||||
| @@ -533,7 +536,7 @@ previously stored in the global setup data (see below). It shall return | ||||
| <i>true</i> if the parameter was parsed correctly, <i>false</i> in case of | ||||
| an error. If <i>false</i> is returned, an error message will be written to | ||||
| the log file (and program execution will continue). | ||||
| <!--X1.1.1--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| <!--X1.1.1--><table width=100%><tr><td bgcolor=lime> </td><td width=100%> | ||||
| A possible implementation of <tt>SetupParse()</tt> could look like this: | ||||
|  | ||||
| <p><table><tr><td bgcolor=#F0F0F0><pre><br> | ||||
| @@ -588,7 +591,7 @@ needs setup parameters that are not directly user adjustable. It can use | ||||
| <tt>SetupStore()</tt> and <tt>SetupParse()</tt> without presenting these | ||||
| parameters to the user. | ||||
|  | ||||
| <!--X1.1.1--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| <!--X1.1.1--><table width=100%><tr><td bgcolor=lime> </td><td width=100%> | ||||
| <a name="The Setup menu"><hr><h2>The Setup menu</h2> | ||||
|  | ||||
| <center><i><b>Have it your way!</b></i></center><p> | ||||
| @@ -648,7 +651,7 @@ your setup parameters and use that one to copy all parameters with one single st | ||||
| (like VDR does with its cSetup class). | ||||
| <!--X1.1.1--></td></tr></table> | ||||
|  | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=red> </td><td width=100%> | ||||
| <!--X1.1.2--><table width=100%><tr><td bgcolor=cyan> </td><td width=100%> | ||||
| <hr><h2>Configuration files</h2> | ||||
|  | ||||
| <center><i><b>I want my own stuff!</b></i></center><p> | ||||
| @@ -815,16 +818,18 @@ and display their help and/or version information in addition to its own output. | ||||
|  | ||||
| If you want to make your plugin available to other VDR users, you'll need to | ||||
| make a package that can be easily distributed. | ||||
| <!--X1.1.3--><table width=100%><tr><td bgcolor=red> </td><td width=100%> | ||||
| The <tt>Makefile</tt> that has been created by the call to | ||||
| <a href="#Initializing a new plugin directory"><tt>newplugin</tt></a> | ||||
| provides the target <tt>package</tt>, which does this for you. | ||||
| provides the target <tt>dist</tt>, which does this for you. | ||||
| <p> | ||||
| Simply change into your source directory and execute <tt>make package</tt>: | ||||
| Simply change into your source directory and execute <tt>make dist</tt>: | ||||
|  | ||||
| <p><table><tr><td bgcolor=#F0F0F0><pre><br> | ||||
| cd VDR/PLUGINS/src/hello | ||||
| make package | ||||
| make dist | ||||
| </pre></td></tr></table><p> | ||||
| <!--X1.1.3--></td></tr></table> | ||||
|  | ||||
| After this you should find a file named like | ||||
|  | ||||
|   | ||||
| @@ -14,3 +14,7 @@ VDR Plugin 'hello' Revision History | ||||
| - Changed return type of cPluginHello::Start(). | ||||
| - Added cPluginHello::Housekeeping(). | ||||
| - Modified package generation. | ||||
|  | ||||
| 2002-05-17: Version 0.0.4 | ||||
|  | ||||
| - Makefile improvements. | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| # | ||||
| # Makefile for a Video Disk Recorder plugin | ||||
| # | ||||
| # $Id: Makefile 1.2 2002/05/12 15:09:07 kls Exp $ | ||||
| # $Id: Makefile 1.3 2002/05/14 21:21:32 kls Exp $ | ||||
|  | ||||
| # The official name of this plugin. | ||||
| # This name will be used in the '-P...' option of VDR to load the plugin. | ||||
| @@ -11,7 +11,7 @@ PLUGIN = hello | ||||
|  | ||||
| ### The version number of this plugin (taken from the main source file): | ||||
|  | ||||
| VERSION = `grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g'` | ||||
| VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') | ||||
|  | ||||
| ### The directory environment: | ||||
|  | ||||
| @@ -23,7 +23,7 @@ TMPDIR = /tmp | ||||
|  | ||||
| ### The version number of VDR (taken from VDR's "config.h"): | ||||
|  | ||||
| VDRVERSION = `grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g'` | ||||
| VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') | ||||
|  | ||||
| ### The name of the distribution archive: | ||||
|  | ||||
| @@ -57,7 +57,7 @@ DEPFILE = .dependencies | ||||
| $(DEPFILE): Makefile | ||||
| 	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ | ||||
|  | ||||
| include $(DEPFILE) | ||||
| -include $(DEPFILE) | ||||
|  | ||||
| ### Targets: | ||||
|  | ||||
| @@ -67,7 +67,7 @@ libvdr-$(PLUGIN).so: $(OBJS) | ||||
| 	$(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@ | ||||
| 	@cp $@ $(LIBDIR)/$@.$(VDRVERSION) | ||||
|  | ||||
| package: clean | ||||
| dist: clean | ||||
| 	@-rm -rf $(TMPDIR)/$(ARCHIVE) | ||||
| 	@mkdir $(TMPDIR)/$(ARCHIVE) | ||||
| 	@cp -a * $(TMPDIR)/$(ARCHIVE) | ||||
|   | ||||
| @@ -3,7 +3,7 @@ | ||||
|  * | ||||
|  * See the README file for copyright information and how to reach the author. | ||||
|  * | ||||
|  * $Id: hello.c 1.4 2002/05/12 10:18:59 kls Exp $ | ||||
|  * $Id: hello.c 1.5 2002/05/14 21:23:25 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #include <getopt.h> | ||||
| @@ -11,7 +11,7 @@ | ||||
| #include <vdr/plugin.h> | ||||
| #include "i18n.h" | ||||
|  | ||||
| static const char *VERSION        = "0.0.3"; | ||||
| static const char *VERSION        = "0.0.4"; | ||||
| static const char *DESCRIPTION    = "A friendly greeting"; | ||||
| static const char *MAINMENUENTRY  = "Hello"; | ||||
|  | ||||
|   | ||||
							
								
								
									
										4
									
								
								config.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								config.h
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  * See the main source file 'vdr.c' for copyright information and | ||||
|  * how to reach the author. | ||||
|  * | ||||
|  * $Id: config.h 1.116 2002/05/13 16:28:16 kls Exp $ | ||||
|  * $Id: config.h 1.117 2002/05/14 21:21:53 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #ifndef __CONFIG_H | ||||
| @@ -19,7 +19,7 @@ | ||||
| #include "eit.h" | ||||
| #include "tools.h" | ||||
|  | ||||
| #define VDRVERSION "1.1.2" | ||||
| #define VDRVERSION "1.1.3" | ||||
|  | ||||
| #define MAXPRIORITY 99 | ||||
| #define MAXLIFETIME 99 | ||||
|   | ||||
| @@ -12,7 +12,7 @@ | ||||
| # See the main source file 'vdr.c' for copyright information and | ||||
| # how to reach the author. | ||||
| # | ||||
| # $Id: newplugin 1.4 2002/05/12 15:02:13 kls Exp $ | ||||
| # $Id: newplugin 1.5 2002/05/14 21:22:59 kls Exp $ | ||||
|  | ||||
| $PLUGIN_NAME = $ARGV[0] || die "Usage: newplugin <name>\n"; | ||||
|  | ||||
| @@ -66,7 +66,7 @@ PLUGIN = $PLUGIN_NAME | ||||
|  | ||||
| ### The version number of this plugin (taken from the main source file): | ||||
|  | ||||
| VERSION = `grep 'static const char \\*VERSION *=' \$(PLUGIN).c | awk '{ print \$\$6 }' | sed -e 's/[";]//g'` | ||||
| VERSION = \$(shell grep 'static const char \\*VERSION *=' \$(PLUGIN).c | awk '{ print \$\$6 }' | sed -e 's/[";]//g') | ||||
|  | ||||
| ### The directory environment: | ||||
|  | ||||
| @@ -78,7 +78,7 @@ TMPDIR = /tmp | ||||
|  | ||||
| ### The version number of VDR (taken from VDR's "config.h"): | ||||
|  | ||||
| VDRVERSION = `grep 'define VDRVERSION ' \$(VDRDIR)/config.h | awk '{ print \$\$3 }' | sed -e 's/"//g'` | ||||
| VDRVERSION = \$(shell grep 'define VDRVERSION ' \$(VDRDIR)/config.h | awk '{ print \$\$3 }' | sed -e 's/"//g') | ||||
|  | ||||
| ### The name of the distribution archive: | ||||
|  | ||||
| @@ -112,7 +112,7 @@ DEPFILE = .dependencies | ||||
| \$(DEPFILE): Makefile | ||||
| 	\@\$(MAKEDEP) \$(DEFINES) \$(INCLUDES) \$(OBJS:%.o=%.c) > \$\@ | ||||
|  | ||||
| include \$(DEPFILE) | ||||
| -include \$(DEPFILE) | ||||
|  | ||||
| ### Targets: | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user