isdb-t: update existing files with newer channels
[dtv-scan-tables.git] / Makefile
blob901dc9df45950267cb99574dab06644fed36fa8a
1 # Makefile for dtv-scan-tables (26 May 2014)
2 # Copyright 2014 Jonathan McCrohan <jmccrohan@gmail.com>
4 # The vast majority of the DVB scan files contained in this repository
5 # are DVBv3 scan files. This format has been deprecated in favor of the
6 # DVBv5 scan format.
8 # Use this makefile to convert the existing DVBv3 scan files to DVBv5
9 # scan files until such time as DVBv5 scan format is in widespread use.
11 # Requires dvb-format-convert from v4l-utils.
13 MKDIR = mkdir -p
14 DVBFORMATCONVERT = dvb-format-convert
16 DVBV3DIRS = atsc dvb-c dvb-s dvb-t
17 DVBV5DIRS = $(DVBV3DIRS) isdb-t
19 DVBV3CHANNELFILES = $(foreach dir,$(DVBV3DIRS),$(wildcard $(dir)/*))
21 DVBFORMATCONVERT_CHANNEL_DVBV5 = -ICHANNEL -ODVBV5
22 DVBFORMATCONVERT_CHANNEL_DVBV3 = -IDVBV5 -OCHANNEL
24 DVBV3OUTPUTDIR = dvbv3
25 DVBV5OUTPUTDIR = dvbv5
27 PHONY := clean dvbv3 dvbv5
29 ifeq ($(PREFIX),)
30 PREFIX = /usr/local
31 endif
33 ifeq ($(DATADIR),)
34 DATADIR = $(PREFIX)/share
35 endif
37 ifeq ($(DVBV5DIR),)
38 DVBV5DIR = dvbv5
39 endif
41 ifeq ($(DVBV3DIR),)
42 DVBV3DIR = dvbv3
43 endif
45 dvbv3:
46 @$(foreach var,$(DVBV3DIRS), $(MKDIR) $(DVBV3OUTPUTDIR)/$(var);)
47 @$(foreach var,$(DVBV3CHANNELFILES), $(DVBFORMATCONVERT) $(DVBFORMATCONVERT_CHANNEL_DVBV3) $(var) $(DVBV3OUTPUTDIR)/$(var);)
50 dvbv5: $(DVBV3OUTPUTDIR)
51 @$(foreach var,$(DVBV3DIRS), $(MKDIR) $(DVBV5OUTPUTDIR)/$(var);)
52 @$(foreach var,$(DVBV3CHANNELFILES), $(DVBFORMATCONVERT) $(DVBFORMATCONVERT_CHANNEL_DVBV5) $(DVBV3OUTPUTDIR)/$(var) $(DVBV5OUTPUTDIR)/$(var);)
54 install:
55 @mkdir -p $(DATADIR)/$(DVBV5DIR)
56 $(foreach var,$(DVBV5DIRS), install -d -p $(DATADIR)/$(DVBV5DIR)/$(var); install -D -p -m 644 $(var)/* $(DATADIR)/$(DVBV5DIR)/$(var);)
58 install_v3:
59 @mkdir -p $(DATADIR)/$(DVBV3DIR)
60 $(foreach var,$(DVBV3DIRS), install -d -p $(DATADIR)/$(DVBV3DIR)/$(var); install -D -p -m 644 $(DVBV3OUTPUTDIR)/$(var)/* $(DATADIR)/$(DVBV3DIR)/$(var);)
62 clean:
63 rm -rf $(DVBV3OUTPUTDIR)/ $(DVBV5OUTPUTDIR)/