forked from 0x74-0x62/stratux
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
63 lines (53 loc) · 2.03 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
ifeq "$(CIRCLECI)" "true"
BUILDINFO=
PLATFORMDEPENDENT=
else
LDFLAGS_VERSION=-X main.stratuxVersion=`git describe --tags --abbrev=0` -X main.stratuxBuild=`git log -n 1 --pretty=%H`
BUILDINFO=-ldflags "$(LDFLAGS_VERSION)"
BUILDINFO_STATIC=-ldflags "-extldflags -static $(LDFLAGS_VERSION)"
$(if $(GOROOT),,$(error GOROOT is not set!))
PLATFORMDEPENDENT=fancontrol
endif
all:
make xdump978 xdump1090 xgen_gdl90 $(PLATFORMDEPENDENT)
xgen_gdl90:
go get -t -d -v ./main ./godump978 ./uatparse ./sensors
go build $(BUILDINFO) -p 4 main/gen_gdl90.go main/traffic.go main/gps.go main/network.go main/managementinterface.go main/sdr.go main/ping.go main/uibroadcast.go main/monotonic.go main/datalog.go main/equations.go main/sensors.go main/cputemp.go main/lowpower_uat.go
fancontrol:
go get -t -d -v ./main
go build $(BUILDINFO_STATIC) -p 4 main/fancontrol.go main/equations.go main/cputemp.go
xdump1090:
git submodule update --init
cd dump1090 && make
xdump978:
cd dump978 && make lib
sudo cp -f ./libdump978.so /usr/lib/libdump978.so
.PHONY: test
test:
make -C test
www:
cd web && make
install:
cp -f gen_gdl90 /usr/bin/gen_gdl90
chmod 755 /usr/bin/gen_gdl90
cp -f fancontrol /usr/bin/fancontrol
chmod 755 /usr/bin/fancontrol
-/usr/bin/fancontrol remove
/usr/bin/fancontrol install
cp image/10-stratux.rules /etc/udev/rules.d/10-stratux.rules
cp image/99-uavionix.rules /etc/udev/rules.d/99-uavionix.rules
rm -f /etc/init.d/stratux
cp __lib__systemd__system__stratux.service /lib/systemd/system/stratux.service
cp __root__stratux-pre-start.sh /root/stratux-pre-start.sh
chmod 644 /lib/systemd/system/stratux.service
chmod 744 /root/stratux-pre-start.sh
ln -fs /lib/systemd/system/stratux.service /etc/systemd/system/multi-user.target.wants/stratux.service
make www
cp -f libdump978.so /usr/lib/libdump978.so
cp -f dump1090/dump1090 /usr/bin/
cp -f image/hostapd_manager.sh /usr/sbin/
cp -f image/stratux-wifi.sh /usr/sbin/
clean:
rm -f gen_gdl90 libdump978.so fancontrol ahrs_approx
cd dump1090 && make clean
cd dump978 && make clean