This repository has been archived by the owner on May 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
152 lines (103 loc) · 8.08 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
MAVLINK_DIR = $(PWD)/lib/Mavlink/out
SRC_DIR = $(PWD)/src
INC_DIR = -I$(PWD)/inc -I$(PWD)/lib/RTIMULib2/RTIMULib -I$(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
ifdef $(DESTDIR)
$(DESTDIR) := $(DESTDIR)/
endif
SYSTEM_INCLUDE = -I$(PREFIX)/include -I/usr/local/include
LOCAL_INCLUDE = $(PWD)/lib/include
LDFLAGS = -L$(PREFIX)/lib -llifepo4wered -lboost_filesystem -lboost_regex -lboost_system -lboost_program_options -lstdc++fs
openhd_microservice: RTFusion.o RTFusionRTQF.o RTMath.o RTFusionKalman4.o RTIMUAccelCal.o RTIMUHal.o RTIMUMagCal.o RTIMUSettings.o RTIMU.o RTIMUGD20M303DLHC.o RTIMUGD20HM303DLHC.o RTIMUGD20HM303D.o RTIMULSM9DS0.o RTIMULSM9DS1.o RTIMUMPU9150.o RTIMUMPU9250.o RTIMUBMX055.o RTIMUBNO055.o RTIMUNull.o RTPressure.o RTPressureBMP180.o RTPressureLPS25H.o RTPressureMS5611.o RTPressureMS5637.o RTHumidity.o RTHumidityHTS221.o RTHumidityHTU21D.o RTIMUHMC5883LADXL345.o bcm2835.o ina2xx.o gpio.o power.o status.o sensor.o main.o
g++ -g -pthread -o openhd_microservice RTFusion.o RTFusionRTQF.o RTMath.o RTFusionKalman4.o RTIMUAccelCal.o RTIMUHal.o RTIMUMagCal.o RTIMUSettings.o RTIMU.o RTIMUGD20M303DLHC.o RTIMUGD20HM303DLHC.o RTIMUGD20HM303D.o RTIMULSM9DS0.o RTIMULSM9DS1.o RTIMUMPU9150.o RTIMUMPU9250.o RTIMUBMX055.o RTIMUBNO055.o RTIMUNull.o RTPressure.o RTPressureBMP180.o RTPressureLPS25H.o RTPressureMS5611.o RTPressureMS5637.o RTHumidity.o RTHumidityHTS221.o RTHumidityHTU21D.o RTIMUHMC5883LADXL345.o bcm2835.o ina2xx.o gpio.o power.o status.o sensor.o main.o $(LDFLAGS)
main.o: $(SRC_DIR)/main.cpp
g++ -std=c++17 -Wno-psabi -g -c -pthread $(SYSTEM_INCLUDE) -I$(MAVLINK_DIR) -I$(LOCAL_INCLUDE) $(INC_DIR) $(SRC_DIR)/main.cpp
power.o: $(SRC_DIR)/power.cpp
g++ -std=c++17 -Wno-psabi -g -c -pthread $(SYSTEM_INCLUDE) -I$(MAVLINK_DIR) -I$(LOCAL_INCLUDE) $(INC_DIR) $(SRC_DIR)/power.cpp
gpio.o: $(SRC_DIR)/gpio.cpp
g++ -std=c++17 -Wno-psabi -g -c -pthread $(SYSTEM_INCLUDE) -I$(MAVLINK_DIR) -I$(LOCAL_INCLUDE) $(INC_DIR) $(SRC_DIR)/gpio.cpp
status.o: $(SRC_DIR)/status.cpp
g++ -std=c++17 -Wno-psabi -g -c -pthread $(SYSTEM_INCLUDE) -I$(MAVLINK_DIR) -I$(LOCAL_INCLUDE) $(INC_DIR) $(SRC_DIR)/status.cpp
sensor.o: $(SRC_DIR)/sensor.cpp
g++ -std=c++17 -Wno-psabi -g -c -pthread $(SYSTEM_INCLUDE) -I$(MAVLINK_DIR) -I$(LOCAL_INCLUDE) $(INC_DIR) $(SRC_DIR)/sensor.cpp
ina2xx.o: $(SRC_DIR)/ina2xx.c
gcc -g -c -pthread $(SYSTEM_INCLUDE) -I$(MAVLINK_DIR) -I$(LOCAL_INCLUDE) $(INC_DIR) $(SRC_DIR)/ina2xx.c
bcm2835.o: $(SRC_DIR)/bcm2835.c
gcc -g -c -pthread $(SYSTEM_INCLUDE) -I$(MAVLINK_DIR) -I$(LOCAL_INCLUDE) $(INC_DIR) $(SRC_DIR)/bcm2835.c
RTFusion.o: $(PWD)/lib/RTIMULib2/RTIMULib/RTFusion.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/RTFusion.cpp
RTFusionRTQF.o: $(PWD)/lib/RTIMULib2/RTIMULib/RTFusionRTQF.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/RTFusionRTQF.cpp
RTMath.o: $(PWD)/lib/RTIMULib2/RTIMULib/RTMath.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/RTMath.cpp
RTFusionKalman4.o: $(PWD)/lib/RTIMULib2/RTIMULib/RTFusionKalman4.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/RTFusionKalman4.cpp
RTIMUAccelCal.o: $(PWD)/lib/RTIMULib2/RTIMULib/RTIMUAccelCal.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/RTIMUAccelCal.cpp
RTIMUHal.o: $(PWD)/lib/RTIMULib2/RTIMULib/RTIMUHal.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/RTIMUHal.cpp
RTIMUMagCal.o: $(PWD)/lib/RTIMULib2/RTIMULib/RTIMUMagCal.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/RTIMUMagCal.cpp
RTIMUSettings.o: $(PWD)/lib/RTIMULib2/RTIMULib/RTIMUSettings.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/RTIMUSettings.cpp
RTIMU.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMU.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMU.cpp
RTIMUGD20M303DLHC.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUGD20M303DLHC.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUGD20M303DLHC.cpp
RTIMUGD20HM303DLHC.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUGD20HM303DLHC.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUGD20HM303DLHC.cpp
RTIMUGD20HM303D.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUGD20HM303D.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUGD20HM303D.cpp
RTIMULSM9DS0.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMULSM9DS0.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMULSM9DS0.cpp
RTIMULSM9DS1.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMULSM9DS1.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMULSM9DS1.cpp
RTIMUMPU9150.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUMPU9150.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUMPU9150.cpp
RTIMUMPU9250.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUMPU9250.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUMPU9250.cpp
RTIMUBMX055.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUBMX055.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUBMX055.cpp
RTIMUBNO055.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUBNO055.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUBNO055.cpp
RTIMUNull.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUNull.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUNull.cpp
RTPressure.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTPressure.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTPressure.cpp
RTPressureBMP180.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTPressureBMP180.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTPressureBMP180.cpp
RTPressureLPS25H.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTPressureLPS25H.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTPressureLPS25H.cpp
RTPressureMS5611.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTPressureMS5611.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTPressureMS5611.cpp
RTPressureMS5637.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTPressureMS5637.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTPressureMS5637.cpp
RTHumidity.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTHumidity.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTHumidity.cpp
RTHumidityHTS221.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTHumidityHTS221.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTHumidityHTS221.cpp
RTHumidityHTU21D.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTHumidityHTU21D.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTHumidityHTU21D.cpp
RTIMUHMC5883LADXL345.o: $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUHMC5883LADXL345.cpp
gcc -g -c -pthread $(SYSTEM_INCLUDE) $(INC_DIR) $(PWD)/lib/RTIMULib2/RTIMULib/IMUDrivers/RTIMUHMC5883LADXL345.cpp
clean:
rm -f *.o openhd_microservice
.PHONY: install
install: openhd_microservice
install -d $(DESTDIR)$(PREFIX)/bin/
install -d $(DESTDIR)/etc/systemd/system
install -m 755 openhd_microservice $(DESTDIR)$(PREFIX)/bin/
install -m 644 [email protected] $(DESTDIR)/etc/systemd/system/
install -d $(DESTDIR)/etc/openhd
install -m 644 openhd_microservice.conf $(DESTDIR)/etc/openhd/
.PHONY: enable
enable: install
systemctl enable openhd_microservice@power
systemctl start openhd_microservice@power
systemctl enable openhd_microservice@gpio
systemctl start openhd_microservice@gpio
.PHONY: uninstall
uninstall:
rm -f $(PREFIX)/bin/openhd_microservice