This repository has been archived by the owner on Nov 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
78 lines (66 loc) · 2.89 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
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
# -----------------------------------------------------------------------------
# Makefile intended for end users. It is a wrapper around setup.py.
# -----------------------------------------------------------------------------
#PREFIX ?= /usr/local
#SETUP := python setup.py install --prefix=$(PREFIX)
SETUP := python setup.py install
ADAPTERS := $(shell ls adapter)
help:
@echo
@echo "To install a player adapter (and required base components), run:"
@for PA in $(ADAPTERS); do echo " make install-$$PA"; done
@echo
@echo "To uninstall a player adapter, run:"
@for PA in $(ADAPTERS); do echo " make uninstall-$$PA"; done
@echo
@echo "To uninstall all components (base and player adapters), run:"
@echo " make uninstall-all"
@echo
@echo "Of course, be root or use 'sudo' when needed."
@echo
all: help
@true
install: help
@true
uninstall: help
@true
install-base: clean
python base/module/install-check.py
REMUCO_COMPONENTS="" $(SETUP) --record install-base.log
@echo "+-----------------------------------------------------------------+"
@echo "| Installed Remuco base."
@echo "+-----------------------------------------------------------------+"
install-%: install-base
@IC=adapter/$(subst install-,,$@)/install-check.py ; \
[ ! -e $$IC ] || python $$IC
REMUCO_COMPONENTS=$(subst install-,,$@) $(SETUP) --record install-tmp.log
diff --suppress-common-lines -n install-base.log install-tmp.log \
| grep "^/" > install-$(subst install-,,$@).log
rm install-tmp.log
@echo "+-----------------------------------------------------------------+"
@echo "| Installed player adapter '$(subst install-,,$@)'."
@[ ! -e adapter/$(subst install-,,$@)/.wip ] || \
echo "| WARNING: This adapter is still work in progress!"
@echo "+-----------------------------------------------------------------+"
uninstall-all: $(addprefix uninstall-,$(ADAPTERS)) uninstall-base
@echo "+-----------------------------------------------------------------+"
@echo "| Uninstalled all components."
@echo "+-----------------------------------------------------------------+"
uninstall-%:
@PA='$(subst uninstall-,,$@)'; \
if [ -e install-$$PA.log ] ; then \
cat install-$$PA.log | xargs rm -f || exit 1; \
rm install-$$PA.log ; \
echo "+-----------------------------------------------------------------+" ; \
echo "| Uninstalled component '$$PA'." ; \
echo "+-----------------------------------------------------------------+" ; \
else \
echo "+-----------------------------------------------------------------+" ; \
echo "| Skipped component '$$PA' (install log does not exist)" ; \
echo "+-----------------------------------------------------------------+" ; \
fi
clean:
python setup.py clean --all
@echo "+-----------------------------------------------------------------+"
@echo "| Clean ok (keep install log files for uninsallation)."
@echo "+-----------------------------------------------------------------+"