-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathmakefile.toolchain
29 lines (20 loc) · 920 Bytes
/
makefile.toolchain
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
# there is no reason to use this makefile manually
.PHONY: build
ifeq (,$(PLATFORM))
$(error please specify PLATFORM, eg. make PLATFORM=trimui)
endif
HOST_WORKSPACE=$(shell pwd)/workspace
GUEST_WORKSPACE=/root/workspace
GIT_IF_NECESSARY=toolchains/$(PLATFORM)-toolchain
INIT_IF_NECESSARY=toolchains/$(PLATFORM)-toolchain/.build
all: $(INIT_IF_NECESSARY)
docker run -it --rm -v $(HOST_WORKSPACE):$(GUEST_WORKSPACE) $(PLATFORM)-toolchain /bin/bash
$(INIT_IF_NECESSARY): $(GIT_IF_NECESSARY)
cd toolchains/$(PLATFORM)-toolchain && make .build
$(GIT_IF_NECESSARY):
mkdir -p toolchains
git clone https://github.com/shauninman/union-$(PLATFORM)-toolchain/ toolchains/$(PLATFORM)-toolchain
clean:
cd toolchains/$(PLATFORM)-toolchain && make clean
build: $(INIT_IF_NECESSARY)
docker run -it --rm -v $(HOST_WORKSPACE):$(GUEST_WORKSPACE) $(PLATFORM)-toolchain /bin/bash -c '. ~/.bashrc && cd /root/workspace && make'