summaryrefslogtreecommitdiff
path: root/server/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'server/Makefile')
-rw-r--r--server/Makefile45
1 files changed, 26 insertions, 19 deletions
diff --git a/server/Makefile b/server/Makefile
index 00c471c..37cd4bb 100644
--- a/server/Makefile
+++ b/server/Makefile
@@ -1,14 +1,18 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile,v 1.2 2010/07/19 13:49:31 schmirl Exp $
+# $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.
-#
+
PLUGIN = streamdev-server
+### The name of the shared object file:
+
+SOFILE = libvdr-$(PLUGIN).so
+
### Includes and Defines (add further entries here):
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
@@ -27,8 +31,7 @@ SERVEROBJS = $(PLUGIN).o \
### The main target:
-.PHONY: all i18n clean
-all: libvdr-$(PLUGIN).so i18n
+all: $(SOFILE) i18n
### Implicit rules:
@@ -39,44 +42,48 @@ all: libvdr-$(PLUGIN).so i18n
MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
-
$(DEPFILE): Makefile
- @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(SERVEROBJS:%.o=%.c) $(COMMONOBJS:%.o=%.c) > $@
+ @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(SERVEROBJS:%.o=%.c) $(COMMONOBJS:%.o=%.c) > $@
-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))))))
+I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
+I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
I18Npot = $(PODIR)/$(PLUGIN).pot
%.mo: %.po
msgfmt -c -o $@ $<
$(I18Npot): $(SERVEROBJS:%.o=%.c)
- xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<http://www.vdr-developer.org/mantisbt/>' -o $@ $^
+ xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<vdrdev@schmirler.de>' -o $@ `ls $^`
%.po: $(I18Npot)
- msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
+ msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
@touch $@
-$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
- @mkdir -p $(dir $@)
- cp $< $@
+$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
+ install -D -m644 $< $@
+
+.PHONY: i18n
+i18n: $(I18Nmo) $(I18Npot)
-i18n: $(I18Nmsgs)
+install-i18n: $(I18Nmsgs)
### Targets:
-libvdr-$(PLUGIN).so: $(SERVEROBJS) $(COMMONOBJS) \
+$(SOFILE): $(SERVEROBJS) $(COMMONOBJS) \
../tools/sockettools.a ../remux/remux.a ../libdvbmpeg/libdvbmpegtools.a
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $^ -o $@
+
+install-lib: $(SOFILE)
+ install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
-%.so:
- $(CXX) $(CXXFLAGS) -shared $^ -o $@
- @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
+install: install-lib install-i18n
clean:
- @-rm -f $(COMMONOBJS) $(SERVEROBJS) $(DEPFILE) $(PODIR)/*.mo $(PODIR)/*.pot *.so *.tgz core* *~
+ @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
+ @-rm -f $(COMMONOBJS) $(SERVEROBJS) $(DEPFILE) *.so *.tgz core* *~