mirror of
https://github.com/miky-kr5/Robotd.git
synced 2023-01-29 18:47:06 +00:00
Added shutdown daemon
This commit is contained in:
33
Makefile
33
Makefile
@@ -1,15 +1,32 @@
|
||||
TARGET = robotd
|
||||
OBJECT = robotd.o
|
||||
SOURCE = robotd.c
|
||||
CFLAGS = -std=c11 -Wall -g -O0 `pkg-config --cflags python`
|
||||
LDLIBS = -lmraa `pkg-config --libs python`
|
||||
TARGET = robotd shutdownd
|
||||
OBJECT = robotd.o shutdownd.o
|
||||
CFLAGS = -std=c11 -Wall -g -O0 -D _GNU_SOURCE
|
||||
LDLIBS = -lmraa
|
||||
|
||||
.PHONY: all
|
||||
all: $(TARGET)
|
||||
all: robotd shutdownd
|
||||
|
||||
$(TARGET): $(OBJECT)
|
||||
robotd: LDLIBS += `pkg-config --libs python`
|
||||
robotd: robotd.o
|
||||
|
||||
$(OBJECT): $(SOURCE)
|
||||
robotd.o: CFLAGS += `pkg-config --cflags python`
|
||||
robotd.o: robotd.c
|
||||
|
||||
shutdownd: shutdownd.o
|
||||
|
||||
shutdownd.o: shutdownd.c
|
||||
|
||||
install: robotd shutdownd init.sh shtdd.sh robot.service shutdown.service
|
||||
cp robotd /usr/bin/robotd
|
||||
cp shutdownd /usr/bin/shtdd
|
||||
cp init.sh /etc/init.d/robot
|
||||
cp shtdd.sh /etc/init.d/shtd
|
||||
cp robot.service /lib/systemd/system
|
||||
cp shutdown.service /lib/systemd/system
|
||||
chmod a+x /etc/init.d/robot
|
||||
chmod a+x /etc/init.d/shtd
|
||||
systemctl enable robot.service
|
||||
systemctl enable shutdown.service
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
Reference in New Issue
Block a user