-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
39 lines (29 loc) · 808 Bytes
/
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
#
# Makefile for installing bme280_mqtt_daemon.py
INSTDIR = /usr/local/bin
SVCDIR = /etc/systemd/system
SCRIPT = bme280_mqtt_daemon.py
SERVICE = bme280-mqtt.service
#install: $(INSTDIR)/bme280_mqtt_daemon.py $(SVCDIR)/bme280-mqtt.service
install: install.daemon install.service
install.daemon: $(INSTDIR)/$(SCRIPT)
install.service: $(SVCDIR)/$(SERVICE)
build:
sudo pip3 install -r requirements.txt
test:
sudo ./$(SCRIPT)
$(INSTDIR)/$(SCRIPT): $(SCRIPT)
cp $? $(INSTDIR)
$(SVCDIR)/$(SERVICE): $(SERVICE)
cp $? $(SVCDIR)
systemctl daemon-reload
systemctl enable $?
# systemctl start $?
clobber: clobber.daemon clobber.service
clobber.daemon:
rm -f $(INSTDIR)/$(SCRIPT)
clobber.service: $(SERVICE)
systemctl stop $?
systemctl disable $?
rm -f $(SVCDIR)/$(SERVICE)
systemctl daemon-reload