~ubuntu-branches/ubuntu/precise/remuco-server/precise

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-03-30 00:59:36 UTC
  • Revision ID: james.westby@ubuntu.com-20090330005936-hkxki384hm0d33gj
Tags: upstream-0.8.2.1
ImportĀ upstreamĀ versionĀ 0.8.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -----------------------------------------------------------------------------
 
2
# Makefile intended for end users. It is a wrapper around setup.py.
 
3
# -----------------------------------------------------------------------------
 
4
 
 
5
#PREFIX ?= /usr/local
 
6
#SETUP := python setup.py install --prefix=$(PREFIX)
 
7
 
 
8
SETUP := python setup.py install
 
9
 
 
10
ADAPTERS := $(shell ls adapter)
 
11
 
 
12
help:
 
13
        @echo
 
14
        @echo "To install a player adapter (and required base components), run:"
 
15
        @for PA in $(ADAPTERS); do echo "    make install-$$PA"; done
 
16
        @echo
 
17
        @echo "To uninstall a player adapter, run"
 
18
        @for PA in $(ADAPTERS); do echo "    make uninstall-$$PA"; done
 
19
        @echo
 
20
        @echo "To uninstall all components (base and player adapters), run"
 
21
        @echo "    make uninstall-all"
 
22
        @echo
 
23
        @echo "Of course, use 'sudo' when needed."
 
24
        @echo
 
25
 
 
26
all: help
 
27
        @true
 
28
 
 
29
install: help
 
30
        @true
 
31
 
 
32
uninstall: help
 
33
        @true
 
34
 
 
35
install-base: clean
 
36
        python base/module/install-check.py
 
37
        REMUCO_ADAPTERS="" $(SETUP) --record install-base.log
 
38
        @echo "+-----------------------------------------------------------------+"
 
39
        @echo "| Installed Remuco base."
 
40
        @echo "+-----------------------------------------------------------------+"
 
41
 
 
42
install-%: install-base
 
43
        @IC=adapter/$(subst install-,,$@)/install-check.py ; \
 
44
                [ ! -e $$IC ] || python $$IC
 
45
        REMUCO_ADAPTERS=$(subst install-,,$@) $(SETUP) --record install-tmp.log
 
46
        diff --suppress-common-lines -n \
 
47
                install-base.log install-tmp.log \
 
48
                | grep "^/" > install-$(subst install-,,$@).log
 
49
        rm install-tmp.log
 
50
        @echo "+-----------------------------------------------------------------+"
 
51
        @echo "| Installed player adapter '$(subst install-,,$@)'."
 
52
        @echo "+-----------------------------------------------------------------+"
 
53
 
 
54
uninstall-all: $(addprefix uninstall-,$(ADAPTERS)) uninstall-base
 
55
        @echo "+-----------------------------------------------------------------+"
 
56
        @echo "| Uninstalled all components."
 
57
        @echo "+-----------------------------------------------------------------+"
 
58
 
 
59
uninstall-%:
 
60
        @PA='$(subst uninstall-,,$@)'; \
 
61
        if [ -e install-$$PA.log ] ; then \
 
62
                cat install-$$PA.log | xargs rm -f || exit 1; \
 
63
                rm install-$$PA.log ; \
 
64
                echo "+-----------------------------------------------------------------+" ; \
 
65
                echo "| Uninstalled component '$$PA'." ; \
 
66
                echo "+-----------------------------------------------------------------+" ; \
 
67
        else \
 
68
                echo "+-----------------------------------------------------------------+" ; \
 
69
                echo "| Skipped component '$$PA' (install log does not exist)" ; \
 
70
                echo "+-----------------------------------------------------------------+" ; \
 
71
        fi
 
72
 
 
73
clean:
 
74
        python setup.py clean --all
 
75
        @echo "+-----------------------------------------------------------------+"
 
76
        @echo "| Clean ok (keep install log files for uninsallation)."
 
77
        @echo "+-----------------------------------------------------------------+"