# # Makefile for a Video Disk Recorder plugin # # $Id: Makefile,v 1.24 2006/02/06 19:59:34 wachm Exp $ # 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. # PLUGIN = softdevice ### The version number of this plugin (taken from the main source file): VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') ### The C++ compiler and options: # ----------------------------------------------------------------------------- # #DVBDIR = ../../../../dvb-kernel #DVBDIR = ../../../../DVB DVBDIR = ../../../../DVB VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp -include config.mak # uncomment to build the shared memory video server # #SHM_SUPPORT = 1 ifndef WITH_CONFIGURE # ----------------------------------------------------------------------------- # framebuffer device name # #FBDEV = /dev/fb/0 #FBDEV = /dev/fb0 FBDEV = /dev/fb0 # uncomment ONE of these lines if you want to enable the support ############################### # don't forget to "make clean" if you change something ############################### #XV support by Stefan Lucke XV_SUPPORT=1 # DFB is very experimental (works only with my matrox G200, comments are welcome) #DFB_SUPPORT=1 # FB is unaccellerated and should work with any FB with 16bit color depth #FB_SUPPORT=1 # Vidix support by Vadim Catana #VIDIX_SUPPORT=1 # Set this if you want to use DPMS #LIBXDPMS_SUPPORT = 1 # Set this if you want to be able to toggle suspend mode by keyboard (XV only) SUSPEND_BY_KEY = 1 # Enable the usage from some deinterlacing pp-filters of libavcodec # ffmpeg must be compiled with the options --enable-pp --enable-gpl # to use this feature ! # Then you have to install the header files with 'make install' in # the directory ffmpeg/libavcodec/libpostproc . # I case you build static libs only (default) you have to copy them manuell # to your target directories (example with /usr/local [default] as target): # # mkdir -p /usr/local/include/postproc # install -m 644 postprocess.h /usr/local/include/postproc/postprocess.h # cp libpostproc.a /usr/local/lib/ # PP_LIBAVCODEC=1 # ----------------------------------------------------------------------------- # if you want output methods build as a single lib comment the following line #USE_SUBPLUGINS = 1 # ----------------------------------------------------------------------------- # VIDIX specific definitions # installation directory # #VIDIX_DIR = /opt/vidix #VIDIX_DIR = /usr/local/ #VIDIX_DIR = /usr/local # ----------------------------------------------------------------------------- # Set up these paths to your enviroment! # #FFMPEGCFLAGS=-I/opt/ffmpeg #FFMPEGCFLAGS=-I../../../../ffmpeg/libavcodec # # If you installed ffmpeg's lib (make installlib) FFMPEGCFLAGS=-I/usr/local/include/ffmpeg/ #FFMPEGCFLAGS=-I/home/extra/src/video/ffmpeg-0.4.8/libavcodec # # # DON'T touch this: FFMPEGLIBS = -lavcodec -lavformat -lz # # ----------------------------------------------------------------------------- # Depending on your ffmpeg lib you may need some additional libs # uncomment one of the following when you'll get unknow symbol messages: # # .. undefined symbol: lame_encode_buffer_interleaved #FFMPEGLIBS += -lmp3lame # # .. undefined symbol: vorbis_encode_init #FFMPEGLIBS += -lvorbisenc -lvorbis #tuning options #MMX is needed for FB-output! DEFINES += -DUSE_MMX # uncomment this line if you do not have MMX2 DEFINES += -DUSE_MMX2 ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config # ############################################################################# # moved some defines to this section, as they are generated by # configure too. # ifdef USE_SUBPLUGINS DEFINES += -DUSE_SUBPLUGINS endif ifdef DFB_SUPPORT DFB_LIBS = -L/usr/local/lib -ldfb++ DFB_CFLAGS = -I/usr/local/include/dfb++ -I/usr/local/include/directfb DEFINES += -DDFB_SUPPORT endif ifdef XV_SUPPORT XV_LIBS = -L/usr/X11R6/lib -lXi -lXext -lX11 -lm -lXv ifdef LIBXDPMS_SUPPORT DEFINES += -DLIBXDPMS_SUPPORT endif DEFINES += -DXV_SUPPORT endif ifdef FB_SUPPORT DEFINES += -DFB_SUPPORT -DFBDEV=\"$(FBDEV)\" endif ifdef PP_LIBAVCODEC DEFINES += -DPP_LIBAVCODEC FFMPEGLIBS += -lpostproc endif ifdef SUSPEND_BY_KEY DEFINES += -DSUSPEND_BY_KEY endif ifdef VIDIX_SUPPORT VIDIX_LIBS = -L$(VIDIX_DIR)/lib -lvidix VIDIX_CFLAGS = -I$(VIDIX_DIR)/include/vidix DEFINES += -DVIDIX_SUPPORT -DVIDIX_DIR=\"$(VIDIX_DIR)/lib/vidix/\" -DFBDEV=\"$(FBDEV)\" endif # ############################################################################# # end of section without configure # else DEFINES += -DHAVE_CONFIG ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config endif # WITH_CONFIGURE ### normally you shoudn't have to touch something below this line CXX ?= g++ CXXFLAGS ?= -O2 -g -Wall -fPIC -Woverloaded-virtual ### The directory environment: ### The version number of VDR (taken from VDR's "config.h"): VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') ### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) ### Includes and Defines (add further entries here): INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include $(FFMPEGCFLAGS) DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -D_GNU_SOURCE DEFINES += -DPLUGINLIBDIR='"./PLUGINS/lib"' ### The object files (add further files here): TARGETS = libvdr-$(PLUGIN).so LIBS = $(FFMPEGLIBS) -lasound OBJS = $(PLUGIN).o utils.o i18n.o video.o mpeg2decoder.o audio.o audio-ac3pt.o video-dummy.o setup-softdevice.o setup-softdevice-menu.o sync-timer.o SoftOsd.o ALL_OBJS = $(OBJS) ifdef DFB_SUPPORT ifdef USE_SUBPLUGINS DFB_OBJS = utils.o video.o video-dfb.o ALL_OBJS += $(DFB_OBJS) TARGETS += libsubvdr-$(PLUGIN)-dfb.so else OBJS += video-dfb.o LIBS += $(DFB_LIBS) endif INCLUDES += $(DFB_CFLAGS) endif ifdef FB_SUPPORT ifdef USE_SUBPLUGINS FB_LIBS = FB_OBJS = utils.o video.o video-fb.o ALL_OBJS += $(FB_OBJS) TARGETS += libsubvdr-$(PLUGIN)-fb.so else OBJS += video-fb.o endif endif ifdef XV_SUPPORT ifdef USE_SUBPLUGINS XV_OBJS = utils.o video.o video-xv.o xscreensaver.o ALL_OBJS += $(XV_OBJS) TARGETS += libsubvdr-$(PLUGIN)-xv.so else OBJS += video-xv.o xscreensaver.o LIBS += $(XV_LIBS) endif endif ifdef VIDIX_SUPPORT ifdef USE_SUBPLUGINS VIDIX_OBJS = utils.o video.o video-vidix.o ALL_OBJS += $(VIDIX_OBJS) TARGETS += libsubvdr-$(PLUGIN)-vidix.so else OBJS += video-vidix.o LIBS += -lvidix endif INCLUDES += $(VIDIX_CFLAGS) endif ifdef SHM_SUPPORT ifdef USE_SUBPLUGINS SHM_OBJS = utils.o video.o video-shm.o ALL_OBJS += $(SHM_OBJS) TARGETS += libsubvdr-$(PLUGIN)-shm.so else OBJS += video-shm.o endif DEFINES += -DSHM_SUPPORT endif ### Implicit rules: %.o: %.c $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< # Dependencies: MAKEDEP = g++ -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ -include $(DEPFILE) ### Targets: all: $(TARGETS) libvdr-$(PLUGIN).so: $(OBJS) $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@ @cp $@ $(LIBDIR)/$@.$(VDRVERSION) ifdef USE_SUBPLUGINS libsubvdr-$(PLUGIN)-dfb.so: $(DFB_OBJS) $(CXX) $(CXXFLAGS) -shared $(DFB_OBJS) $(DFB_LIBS) -o $@ @cp $@ $(LIBDIR)/$@.$(VDRVERSION) libsubvdr-$(PLUGIN)-fb.so: $(FB_OBJS) $(CXX) $(CXXFLAGS) -shared $(FB_OBJS) $(FB_LIBS) -o $@ @cp $@ $(LIBDIR)/$@.$(VDRVERSION) libsubvdr-$(PLUGIN)-xv.so: $(XV_OBJS) $(CXX) $(CXXFLAGS) -shared $(XV_OBJS) $(XV_LIBS) -o $@ @cp $@ $(LIBDIR)/$@.$(VDRVERSION) libsubvdr-$(PLUGIN)-vidix.so: $(VIDIX_OBJS) $(CXX) $(CXXFLAGS) -shared $(VIDIX_OBJS) $(VIDIX_LIBS) -o $@ @cp $@ $(LIBDIR)/$@.$(VDRVERSION) libsubvdr-$(PLUGIN)-shm.so: $(SHM_OBJS) $(CXX) $(CXXFLAGS) -shared $(SHM_OBJS) $(SHM_LIBS) -o $@ @cp $@ $(LIBDIR)/$@.$(VDRVERSION) endif dist: clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE) @echo Distribution package created as $(PACKAGE).tgz dist-clean: clean @-rm -f config.h config.mak clean: @-rm -f $(OBJS) $(DEPFILE) *.so *.o *.tgz core* *~ VDR_SHM_CLIENT_OBJS = ../../../tools.o ../../../thread.o \ ../../../remote.o ../../../i18n.o ../../../keys.o \ ../../../config.o ../../../plugin.o\ ../../../sources.o SHM_CLIENT_OBJS = video.o video-xv.o setup-softdevice.o xscreensaver.o \ utils.o ShmClient: ShmClient.o $(SHM_CLIENT_OBJS) $(CXX) $(CXXFLAGS) $(XV_LIBS) $(VDR_SHM_CLIENT_OBJS) $(SHM_CLIENT_OBJS) -lpthread -ljpeg $< -o $@