-
Notifications
You must be signed in to change notification settings - Fork 117
/
Makefile
41 lines (34 loc) · 1.05 KB
/
Makefile
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
NAME = plugin.video.xbmctorrent
GIT = git
GIT_VERSION = $(shell $(GIT) describe --tags --always)
VERSION = $(patsubst v%,%,$(GIT_VERSION))
ARCHS = windows_x86 darwin_x64 linux_x86 linux_x64 linux_arm android_arm
ZIP_SUFFIX = zip
ZIP_FILE = $(NAME)-$(VERSION).$(ZIP_SUFFIX)
all: clean zip
bootstraper:
mkdir -p $(NAME)
sed s/\$$VERSION/0.0.1/g < addon.xml.tpl > $(NAME)/addon.xml
cp fanart.jpg $(NAME)
cp icon.png $(NAME)
zip -9 -r $(NAME).zip $(NAME)
rm -rf $(NAME)
addon.xml:
sed s/\$$VERSION/$(VERSION)/g < addon.xml.tpl > $@
$(ZIP_FILE): addon.xml
git archive --format zip --prefix $(NAME)/ --output $(ZIP_FILE) $(GIT_VERSION)
mkdir -p $(NAME)/resources/bin
ln -s `pwd`/addon.xml $(NAME)
zip -9 -r -g $(ZIP_FILE) $(NAME)/addon.xml
for arch in $(ARCHS); do \
ln -s `pwd`/resources/bin/$$arch $(NAME)/resources/bin/$$arch; \
zip -9 -r -g $(ZIP_FILE) $(NAME)/resources/bin/$$arch; \
done
rm -rf $(NAME)
zipfiles: addon.xml
for arch in $(ARCHS); do \
$(MAKE) zip ARCHS=$$arch ZIP_SUFFIX=$$arch.zip; \
done
zip: $(ZIP_FILE)
clean:
rm -rf addon.xml