forked from victronenergy/dbus-systemcalc-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (68 loc) · 2.29 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
79
80
SOURCEDIR = $(PWD)
VEDLIBDIR = $(PWD)/ext/velib_python
INSTALL_CMD = install
LIBDIR = $(bindir)/ext/velib_python
FILES = \
$(SOURCEDIR)/dbus_systemcalc.py \
$(SOURCEDIR)/sc_utils.py
DELEGATES = \
$(SOURCEDIR)/delegates/base.py \
$(SOURCEDIR)/delegates/buzzercontrol.py \
$(SOURCEDIR)/delegates/dvcc.py \
$(SOURCEDIR)/delegates/hubtype.py \
$(SOURCEDIR)/delegates/__init__.py \
$(SOURCEDIR)/delegates/lgbattery.py \
$(SOURCEDIR)/delegates/relaystate.py \
$(SOURCEDIR)/delegates/servicemapper.py \
$(SOURCEDIR)/delegates/vebussocwriter.py \
$(SOURCEDIR)/delegates/systemstate.py \
$(SOURCEDIR)/delegates/batterysense.py \
$(SOURCEDIR)/delegates/batterylife.py \
$(SOURCEDIR)/delegates/schedule.py \
$(SOURCEDIR)/delegates/sourcetimers.py \
$(SOURCEDIR)/delegates/bydbattery.py \
$(SOURCEDIR)/delegates/batterysettings.py \
$(SOURCEDIR)/delegates/batterydata.py \
$(SOURCEDIR)/delegates/gps.py \
$(SOURCEDIR)/delegates/multi.py \
$(SOURCEDIR)/delegates/acinput.py \
$(SOURCEDIR)/delegates/genset.py \
$(SOURCEDIR)/delegates/socsync.py
VEDLIB_FILES = \
$(VEDLIBDIR)/logger.py \
$(VEDLIBDIR)/ve_utils.py \
$(VEDLIBDIR)/vedbus.py \
$(VEDLIBDIR)/settingsdevice.py \
$(VEDLIBDIR)/dbusmonitor.py
help:
@echo "The following make targets are available"
@echo " help - print this message"
@echo " install - install everything"
@echo " clean - remove temporary files"
install_delegates : $(DELEGATES)
@if [ "$^" != "" ]; then \
$(INSTALL_CMD) -d $(DESTDIR)$(bindir)/delegates; \
$(INSTALL_CMD) -m 644 -t $(DESTDIR)$(bindir)/delegates $^; \
fi
install_app : $(FILES)
@if [ "$^" != "" ]; then \
$(INSTALL_CMD) -m 755 -d $(DESTDIR)$(bindir); \
$(INSTALL_CMD) -m 755 -t $(DESTDIR)$(bindir) $^; \
echo installed $(DESTDIR)$(bindir)/$(notdir $^); \
fi
install_velib_python: $(VEDLIB_FILES)
@if [ "$^" != "" ]; then \
$(INSTALL_CMD) -m 755 -d $(DESTDIR)$(LIBDIR); \
$(INSTALL_CMD) -m 644 -t $(DESTDIR)$(LIBDIR) $^; \
echo installed $(DESTDIR)$(LIBDIR)/$(notdir $^); \
fi
clean: ;
install: install_velib_python install_app install_delegates
test:
python3 /usr/bin/nosetests -v -w tests
testinstall:
$(eval TMP := $(shell mktemp -d))
$(MAKE) DESTDIR=$(TMP) install
(cd $(TMP) && ./dbus_systemcalc.py --help > /dev/null)
-rm -rf $(TMP)
.PHONY: help install_app install_velib_python install test