From 88beb7703b805cc5bc4ba2e74d7f2d8f5b886c73 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 27 Sep 2014 21:31:10 -0300 Subject: Add targets to install the files at the system In order to be easier to package the scan tables, add some targets to install the files, and add the instructions about how to use it at the README file. Signed-off-by: Mauro Carvalho Chehab --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2fb4a889..901dc9df 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ MKDIR = mkdir -p DVBFORMATCONVERT = dvb-format-convert DVBV3DIRS = atsc dvb-c dvb-s dvb-t +DVBV5DIRS = $(DVBV3DIRS) isdb-t DVBV3CHANNELFILES = $(foreach dir,$(DVBV3DIRS),$(wildcard $(dir)/*)) @@ -25,6 +26,22 @@ DVBV5OUTPUTDIR = dvbv5 PHONY := clean dvbv3 dvbv5 +ifeq ($(PREFIX),) +PREFIX = /usr/local +endif + +ifeq ($(DATADIR),) +DATADIR = $(PREFIX)/share +endif + +ifeq ($(DVBV5DIR),) +DVBV5DIR = dvbv5 +endif + +ifeq ($(DVBV3DIR),) +DVBV3DIR = dvbv3 +endif + dvbv3: @$(foreach var,$(DVBV3DIRS), $(MKDIR) $(DVBV3OUTPUTDIR)/$(var);) @$(foreach var,$(DVBV3CHANNELFILES), $(DVBFORMATCONVERT) $(DVBFORMATCONVERT_CHANNEL_DVBV3) $(var) $(DVBV3OUTPUTDIR)/$(var);) @@ -34,6 +51,13 @@ dvbv5: $(DVBV3OUTPUTDIR) @$(foreach var,$(DVBV3DIRS), $(MKDIR) $(DVBV5OUTPUTDIR)/$(var);) @$(foreach var,$(DVBV3CHANNELFILES), $(DVBFORMATCONVERT) $(DVBFORMATCONVERT_CHANNEL_DVBV5) $(DVBV3OUTPUTDIR)/$(var) $(DVBV5OUTPUTDIR)/$(var);) +install: + @mkdir -p $(DATADIR)/$(DVBV5DIR) + $(foreach var,$(DVBV5DIRS), install -d -p $(DATADIR)/$(DVBV5DIR)/$(var); install -D -p -m 644 $(var)/* $(DATADIR)/$(DVBV5DIR)/$(var);) + +install_v3: + @mkdir -p $(DATADIR)/$(DVBV3DIR) + $(foreach var,$(DVBV3DIRS), install -d -p $(DATADIR)/$(DVBV3DIR)/$(var); install -D -p -m 644 $(DVBV3OUTPUTDIR)/$(var)/* $(DATADIR)/$(DVBV3DIR)/$(var);) clean: rm -rf $(DVBV3OUTPUTDIR)/ $(DVBV5OUTPUTDIR)/ -- cgit v1.2.3