db104ac8c861c4bcbdcac2c59424268909dc8e1b
[vuplus_xbmc] / tools / depends / target / xbmc-pvr-addons / Makefile
1 include ../../Makefile.include
2 #DEPS= ../../Makefile.include Makefile
3
4 LIBNAME=xbmc-pvr-addons
5 VERSION=1d9e336efb1462d08f311cd9d29f162445961c61
6 GIT_DIR=$(TARBALLS_LOCATION)/$(LIBNAME).git
7 BASE_URL=git://github.com/opdenkamp/$(LIBNAME).git
8 DYLIB=$(PLATFORM)/addons/pvr.demo/.libs/libpvrdemo-addon.so
9 XBMC_ADDONSDIR=../../../../addons
10
11 #tell git to use the addons repo rather than xbmc's repo
12 export GIT_DIR
13 export GIT_WORK_TREE=$(PLATFORM)
14
15 #mysql_config is remarkably useless. Help configure find the right one.
16 export MYSQL_CONFIG=$(PREFIX)/bin/mysql_config
17
18 # configuration settings
19 CONFIGURE=./configure --prefix=$(PREFIX) --enable-addons-with-dependencies
20
21 all: .installed-$(PLATFORM)
22
23 $(GIT_DIR)/HEAD:
24         cd $(TARBALLS_LOCATION); git clone --bare $(BASE_URL)
25
26 $(GIT_DIR)/current/$(VERSION): $(GIT_DIR)/HEAD $(DEPS)
27         git rev-list -1 $(VERSION) >/dev/null || git fetch origin "+refs/heads/*:refs/remotes/origin/*"
28         git rev-list -1 $(VERSION) >/dev/null
29         rm -rf $(GIT_DIR)/current; mkdir -p $(GIT_DIR)/current
30         touch $@
31
32 $(PLATFORM)/bootstrap: $(GIT_DIR)/current/$(VERSION)
33         rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
34         git checkout $(VERSION) -- .
35
36 $(PLATFORM)/configure: $(PLATFORM)/bootstrap
37         cd $(PLATFORM); ./bootstrap
38
39 $(PLATFORM)/Makefile: $(PLATFORM)/configure
40         cd $(PLATFORM); $(CONFIGURE)
41
42 $(DYLIB): $(PLATFORM)/Makefile
43         make -C $(PLATFORM)
44         touch $@
45
46 .installed-$(PLATFORM): $(DYLIB)
47 ifeq (darwin, $(findstring darwin, $(HOST)))
48         for ADDON in `find $(PLATFORM)/addons -type d -name "pvr.*"`; do \
49           ADDON=`basename $$ADDON` ; \
50           mkdir -p $(XBMC_ADDONSDIR)/$$ADDON ; \
51           cp -PRf $(PLATFORM)/addons/$$ADDON/addon/* $(XBMC_ADDONSDIR)/$$ADDON ; \
52           cp -Pf $(PLATFORM)/addons/$$ADDON/*.pvr $(XBMC_ADDONSDIR)/$$ADDON ; \
53           install_name_tool -id "$$ADDON" `find "$(XBMC_ADDONSDIR)/$$ADDON" -type f -name "*.pvr"` ; \
54         done
55 else
56         $(MAKE) -C $(PLATFORM) install
57 endif
58         touch $@
59
60 clean:
61         -make -C $(PLATFORM) clean
62         rm -f .installed-$(PLATFORM)
63
64 distclean::
65         rm -rf $(PLATFORM) .installed-$(PLATFORM)
66         rm -rf $(GIT_DIR)/current
67