-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (32 loc) · 1.03 KB
/
Copy pathMakefile
File metadata and controls
41 lines (32 loc) · 1.03 KB
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
CC = gcc
CFLAGS = -Wall -Wextra -Werror -g
.PHONY: all simulator gateway sensorctl kernel clean install help
all: simulator gateway sensorctl
simulator:
$(CC) $(CFLAGS) simulator/sensor_simulator.c \
-o simulator/sensor_simulator
gateway:
$(CC) $(CFLAGS) gateway/gateway_daemon.c \
-o gateway/gateway_daemon -pthread
sensorctl:
$(CC) $(CFLAGS) sensorctl/sensorctl.c \
-o sensorctl/sensorctl
kernel:
$(MAKE) -C kernel/
clean:
rm -f simulator/sensor_simulator
rm -f gateway/gateway_daemon
rm -f sensorctl/sensorctl
$(MAKE) -C kernel/ clean
install:
sudo cp gateway/gateway_daemon /usr/local/bin/
sudo cp systemd/sensor-gateway.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable sensor-gateway
@echo "Installed. Run: sudo systemctl start sensor-gateway"
help:
@echo "Targets:"
@echo " make all - build simulator, gateway, sensorctl"
@echo " make kernel - build kernel driver"
@echo " make clean - remove build outputs"
@echo " make install - install systemd service"