forked from swift-nav/piksi_buildroot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (34 loc) · 1.3 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
BR2_EXTERNAL:=$(shell pwd)
ifeq ($(HW_CONFIG),)
HW_CONFIG=prod
endif
ifeq ($(BUILDROOT_CONFIG),)
BUILDROOT_CONFIG=piksiv3_defconfig
endif
DOCKER_ARGS:= \
-e HW_CONFIG=$(HW_CONFIG) \
-v `pwd`:/piksi_buildroot \
-v `pwd`/buildroot/output/images:/piksi_buildroot/buildroot/output/images \
-v piksi_buildroot-buildroot:/piksi_buildroot/buildroot
.PHONY: all firmware config image docker-setup docker-make-image docker-run test cmake-setup travis
all: firmware image
firmware:
./fetch_firmware.sh
config:
BR2_EXTERNAL=$(BR2_EXTERNAL) make -C buildroot $(BUILDROOT_CONFIG)
image: config
BR2_EXTERNAL=$(BR2_EXTERNAL) HW_CONFIG=$(HW_CONFIG) make -C buildroot
docker-setup:
docker build -t piksi_buildroot .
docker run $(DOCKER_ARGS) piksi_buildroot git submodule update --init
docker-make-image:
docker run $(DOCKER_ARGS) piksi_buildroot make image
docker-run:
docker run $(DOCKER_ARGS) -ti piksi_buildroot
cmake-setup:
mkdir -p build && cd build && cmake ..
test: cmake-setup
make -C build
make -C build test
travis: firmware docker-setup
HW_CONFIG=prod make docker-make-image 2>&1 | tee -a build.out | grep --line-buffered '^make'