forked from gregkeys/crossbar-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (48 loc) · 1.95 KB
/
Makefile
File metadata and controls
64 lines (48 loc) · 1.95 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
HOSTIP=$(shell ip route get 1 | awk '{print $$NF;exit}')
SUBDIRS = crossbar autobahn-js/x86_64 autobahn-js/armhf autobahn-js/aarch64 autobahn-python/x86_64 autobahn-python/armhf autobahn-python/aarch64
subdirs: $(SUBDIRS)
BUILDDIRS = $(SUBDIRS:%=build-%)
VERSIONDIRS = $(SUBDIRS:%=version-%)
TESTDIRS = $(SUBDIRS:%=test-%)
PUBLISHDIRS = $(SUBDIRS:%=publish-%)
build: $(BUILDDIRS)
version: $(VERSIONDIRS)
test: $(TESTDIRS)
publish: $(PUBLISHDIRS)
$(BUILDDIRS):
$(MAKE) -C $(@:build-%=%) build
$(VERSIONDIRS):
$(MAKE) -C $(@:version-%=%) version
$(TESTDIRS):
$(MAKE) -C $(@:test-%=%) test
$(PUBLISHDIRS):
$(MAKE) -C $(@:publish-%=%) publish
.PHONY: subdirs $(BUILDDIRS) $(VERSIONDIRS) $(TESTDIRS) $(PUBLISHDIRS)
.PHONY: build version test publish
requirements: docker docker_compose qemu
# install docker
docker:
sudo apt-get install -y apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo sh -c "echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-cache policy docker-engine
sudo apt-get install -y linux-image-extra-$$(uname -r)
sudo apt-get install -y docker-engine
# install docker compose (see: https://github.com/docker/compose/releases)
docker_compose:
sudo sh -c "curl -L https://github.com/docker/compose/releases/download/1.7.0-rc1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
#
# Install Qemu (this is needed for cross-building armhf/aarch64 on amd64)
#
qemu:
sudo apt-get update
sudo apt-get install -y --no-install-recommends qemu-user-static binfmt-support
sudo update-binfmts --enable qemu-arm
sudo update-binfmts --enable qemu-aarch64
sudo update-binfmts --display qemu-arm
sudo update-binfmts --display qemu-aarch64
images: images.json
python images.py