1 # |
1 # |
2 # PremiereEpg plugin to VDR |
2 # PremiereEpg plugin to VDR |
3 # |
3 # |
4 # (C) 2005-2007 Stefan Huelswitt <s.huelswitt@gmx.de> |
4 # (C) 2005-2008 Stefan Huelswitt <s.huelswitt@gmx.de> |
5 # |
5 # |
6 # This code is free software; you can redistribute it and/or |
6 # This code is free software; you can redistribute it and/or |
7 # modify it under the terms of the GNU General Public License |
7 # modify it under the terms of the GNU General Public License |
8 # as published by the Free Software Foundation; either version 2 |
8 # as published by the Free Software Foundation; either version 2 |
9 # of the License, or (at your option) any later version. |
9 # of the License, or (at your option) any later version. |
24 # |
24 # |
25 PLUGIN = premiereepg |
25 PLUGIN = premiereepg |
26 |
26 |
27 ### The version number of this plugin: |
27 ### The version number of this plugin: |
28 |
28 |
|
29 HGARCHIVE = .hg_archival.txt |
29 RELEASE := $(shell grep 'define PLUGIN_RELEASE' version.h | awk '{ print $$3 }' | sed -e 's/[";]//g') |
30 RELEASE := $(shell grep 'define PLUGIN_RELEASE' version.h | awk '{ print $$3 }' | sed -e 's/[";]//g') |
30 VERSION := $(shell if test -d .hg; then echo -n '$(RELEASE)-'; (hg identify 2>/dev/null || echo -n Unknown) | sed -e 's/ .*//'; else echo -n '$(RELEASE)'; fi) |
31 RELSTR := $(shell if test -d .hg; then \ |
|
32 echo -n "-"; (hg identify 2>/dev/null || echo -n "Unknown") | sed -e 's/ .*//'; \ |
|
33 elif test -r $(HGARCHIVE); then \ |
|
34 echo -n "-"; grep "^node" $(HGARCHIVE) | awk '{ printf "%.12s",$$2 }'; \ |
|
35 fi) |
|
36 VERSION := $(RELEASE)$(RELSTR) |
31 |
37 |
32 ### The C++ compiler and options: |
38 ### The C++ compiler and options: |
33 |
39 |
34 CXX ?= g++ |
40 CXX ?= g++ |
35 CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual |
41 CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual |
53 APIVERSION = $(VDRVERSION) |
59 APIVERSION = $(VDRVERSION) |
54 endif |
60 endif |
55 |
61 |
56 ### The name of the distribution archive: |
62 ### The name of the distribution archive: |
57 |
63 |
58 ARCHIVE = $(PLUGIN)-$(VERSION) |
64 ARCHIVE = $(PLUGIN)-$(RELEASE) |
59 PACKAGE = vdr-$(ARCHIVE) |
65 PACKAGE = vdr-$(ARCHIVE) |
60 |
66 |
61 ### Includes and Defines (add further entries here): |
67 ### Includes and Defines (add further entries here): |
62 |
68 |
63 INCLUDES += -I$(VDRDIR)/include |
69 INCLUDES += -I$(VDRDIR)/include |
77 PODIR = po |
83 PODIR = po |
78 I18Npot = $(PODIR)/$(PLUGIN).pot |
84 I18Npot = $(PODIR)/$(PLUGIN).pot |
79 I18Nmsgs = $(addprefix $(LOCALEDIR)/,$(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo,$(notdir $(foreach file, $(wildcard $(PODIR)/*.po), $(basename $(file)))))) |
85 I18Nmsgs = $(addprefix $(LOCALEDIR)/,$(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo,$(notdir $(foreach file, $(wildcard $(PODIR)/*.po), $(basename $(file)))))) |
80 LOCALEDIR = $(VDRDIR)/locale |
86 LOCALEDIR = $(VDRDIR)/locale |
81 |
87 |
|
88 ### Targets: |
|
89 |
|
90 TARGETS = libvdr-$(PLUGIN).so |
|
91 ifneq ($(shell grep -l 'Phrases' $(VDRDIR)/i18n.c),$(VDRDIR)/i18n.c) |
|
92 TARGETS += i18n |
|
93 endif |
|
94 |
|
95 all: $(TARGETS) |
|
96 .PHONY: i18n |
|
97 |
82 # Dependencies: |
98 # Dependencies: |
83 |
99 |
84 MAKEDEP = $(CXX) -MM -MG |
100 MAKEDEP = $(CXX) -MM -MG |
85 DEPFILE = .dependencies |
101 DEPFILE = .dependencies |
86 DEPFILES = $(subst version.c,,$(OBJS:%.o=%.c) $(OBJS2:%.o=%.c)) |
102 DEPFILES = $(subst version.c,,$(OBJS:%.o=%.c) $(OBJS2:%.o=%.c)) |
87 $(DEPFILE): Makefile $(DEPFILES) $(wildcard *.h) |
103 $(DEPFILE): Makefile $(DEPFILES) $(wildcard *.h) |
88 @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(DEPFILES) > $@ |
104 @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(DEPFILES) > $@ |
89 |
105 |
90 -include $(DEPFILE) |
106 -include $(DEPFILE) |
91 |
107 |
92 ### Targets: |
108 # Rules |
93 |
|
94 TARGETS = libvdr-$(PLUGIN).so |
|
95 ifneq ($(shell grep -l 'Phrases' $(VDRDIR)/i18n.c),$(VDRDIR)/i18n.c) |
|
96 TARGETS += i18n |
|
97 endif |
|
98 |
|
99 all: $(TARGETS) |
|
100 .PHONY: i18n |
|
101 |
109 |
102 %.o: %.c |
110 %.o: %.c |
103 $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< |
111 $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< |
104 |
112 |
105 libvdr-$(PLUGIN).so: $(OBJS) |
113 libvdr-$(PLUGIN).so: $(OBJS) |