summaryrefslogtreecommitdiff
path: root/dist/epgdata2xmltv/Makefile
blob: 3301bd24ef8adaf67e3905ae8313074e08133d5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#
# Makefile for epgdata2xmltv
#

### The C++ compiler and options:

CXX      ?= g++
CXXFLAGS ?= -g -rdynamic -O2 -Wall -Wextra -Woverloaded-virtual -Wno-parentheses
PKG-CONFIG ?= pkg-config
STRIP ?= -s

### Includes and Defines (add further entries here):

PKG-LIBS += libxml-2.0 libxslt libexslt libcurl libzip libpcrecpp enca
PKG-INCLUDES += libxml-2.0 libxslt libexslt libcurl libzip libpcrecpp enca

DEFINES += -D_GNU_SOURCE 
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
DEFINES += -D__STDC_CONSTANT_MACROS -D__USE_XOPEN_EXTENDED

INCLUDES += $(shell $(PKG-CONFIG) --cflags $(PKG-INCLUDES))
LIBS     += $(shell $(PKG-CONFIG) --libs $(PKG-LIBS)) 

INCLUDES += -I..

### directory environment

TMPDIR = /tmp

### install directory ###

INSTALL = $(DESTDIR)/usr/bin

### The object files (add further files here):

OBJS = epgdata2xmltv.o

### The main target:

all: epgdata2xmltv_xsl epgdata2xmltv

### Implicit rules:

%.o: %.cpp
	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<

### Dependencies:

MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
$(DEPFILE): Makefile
	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.cpp) > $@

-include $(DEPFILE)

### Targets:

epgdata2xmltv_xsl: 
	echo -n "char xsl[]=\"" > epgdata2xmltv_xsl.h
	sed -e "s/\"/\\\\\"/g;" epgdata2xmltv.xsl | awk '{ printf("%s",$$0); }' >> epgdata2xmltv_xsl.h
	echo "\";" >> epgdata2xmltv_xsl.h

epgdata2xmltv: epgdata2xmltv_xsl $(OBJS)
	$(CXX) $(CXXFLAGS) $(OBJS) $(LIBS) -o $@

install: epgdata2xmltv
	@mkdir -p $(INSTALL)
	@install $(STRIP) epgdata2xmltv $(INSTALL)	
	@mkdir -p $(DESTDIR)/var/lib/epgsources
	@mkdir -p /var/lib/epgsources/epgdata2xmltv-img
	@cp epgdata2xmltv.dist /var/lib/epgsources/epgdata2xmltv
	@chown -R vdr.vdr /var/lib/epgsources

dist: clean
	@-rm -rf $(TMPDIR)/epgdata2xmltv
	@mkdir $(TMPDIR)/epgdata2xmltv
	@cp -a *.cpp *.h *.xsl epgdata2xmltv.dist Makefile $(TMPDIR)/epgdata2xmltv
	@tar cfz epgdata2xmltv.tgz -C $(TMPDIR) epgdata2xmltv
	@-rm -rf $(TMPDIR)/epgdata2xmltv 

clean:
	@-rm -f $(OBJS) $(DEPFILE) *.*~ epgdata2xmltv epgdata2xmltv_xsl.h

distclean: clean
	@-rm -f *~ *.tgz