Files
Robotd/Makefile

34 lines
778 B
Makefile
Raw Normal View History

2018-11-22 03:04:40 +00:00
TARGET = robotd shutdownd
OBJECT = robotd.o shutdownd.o
CFLAGS = -std=c11 -Wall -g -O0 -D _GNU_SOURCE
LDLIBS = -lmraa
2018-11-21 21:40:40 -04:00
.PHONY: all
2018-11-22 03:04:40 +00:00
all: robotd shutdownd
2018-11-21 21:40:40 -04:00
2018-11-22 03:04:40 +00:00
robotd: LDLIBS += `pkg-config --libs python`
robotd: robotd.o
2018-11-21 21:40:40 -04:00
2018-11-22 03:04:40 +00:00
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
2018-11-21 21:40:40 -04:00
.PHONY: clean
clean:
$(RM) $(TARGET) $(OBJECT)