61 lines
2.0 KiB
Makefile
61 lines
2.0 KiB
Makefile
GCC ?= 11 # 8,9,10,11 can be used here
|
|
CLIB2REPO ?= adtools # or use afxgroup
|
|
CLIB2TAG :=
|
|
|
|
REPOSPATH ?= ./repos
|
|
REPO ?= walkero/adtoolsbuilder
|
|
TAG ?= adtools-build
|
|
WORKSPACE ?= -w /opt/adtools
|
|
NAME ?= adtools-build
|
|
VOLUMES ?= -v "${PWD}/native-gcc":/gcc
|
|
|
|
ifeq ($(CLIB2REPO), afxgroup)
|
|
override CLIB2TAG = -newclib2
|
|
override TAG = adtools-build$(CLIB2TAG)
|
|
endif
|
|
|
|
.PHONY: help build buildnc shell compile clonerepos pullrepos clean
|
|
|
|
default: help
|
|
|
|
help:
|
|
@echo "This make file helps on building the Docker image and starting containers"
|
|
@echo "where adtools can get build."
|
|
@echo "The available parameters can be seen below:"
|
|
@echo ""
|
|
@echo "build - Build the Docker image"
|
|
@echo "buildnc - Pull the latest repos' code and build the Docker image"
|
|
@echo " without using caching"
|
|
@echo "shell - Create a container with the latest Docker image and get"
|
|
@echo " into it. Not suitable to compile adtools"
|
|
@echo "compile [GCC=x] - Create a container with the latest Docker image and get"
|
|
@echo " into it to compile adtools with GCC 8 (default) or the"
|
|
@echo " defined one by GCC argument. Possible values 6/8/9/10/11."
|
|
@echo "clean - Remove the docker container, if this still exists."
|
|
@echo ""
|
|
@echo "Since the SDK 53.34 is used, there is a need of the latest ExecSG private SDK"
|
|
@echo "which should be placed manually under repos folder. So the path should be:"
|
|
@echo "repos/execsg_private_sdk/SDK/..."
|
|
@echo ""
|
|
|
|
build:
|
|
docker build -t $(REPO):$(TAG) \
|
|
--build-arg CLIB2_REPO=$(CLIB2REPO) \
|
|
--build-arg REPOS_PATH=$(REPOSPATH) .
|
|
|
|
buildnc: pullrepos
|
|
docker build --no-cache -t $(REPO):$(TAG) \
|
|
--build-arg CLIB2_REPO=$(CLIB2REPO) \
|
|
--build-arg REPOS_PATH=$(REPOSPATH) .
|
|
|
|
shell:
|
|
docker run -it --rm --name $(NAME) $(WORKSPACE) $(VOLUMES) $(REPO):$(TAG) /bin/bash
|
|
|
|
compile:
|
|
docker run -it --rm --name $(NAME)-$(GCC) $(WORKSPACE) \
|
|
-v "${PWD}/native-gcc/$(GCC)":/gcc \
|
|
--env-file .env$(GCC) $(REPO):$(TAG) /bin/bash
|
|
|
|
clean:
|
|
-docker rm -f $(NAME)
|