adtoolsBuilder/Makefile

61 lines
2.0 KiB
Makefile
Raw Normal View History

2024-01-18 12:43:23 +01:00
GCC ?= 11 # 8,9,10,11 can be used here
2023-10-24 00:29:45 +02:00
CLIB2REPO ?= adtools # or use afxgroup
CLIB2TAG :=
2022-02-01 19:47:39 +01:00
REPOSPATH ?= ./repos
REPO ?= walkero/adtoolsbuilder
TAG ?= adtools-build
WORKSPACE ?= -w /opt/adtools
NAME ?= adtools-build
VOLUMES ?= -v "${PWD}/native-gcc":/gcc
2023-10-24 00:29:45 +02:00
ifeq ($(CLIB2REPO), afxgroup)
override CLIB2TAG = -newclib2
override TAG = adtools-build$(CLIB2TAG)
endif
2022-02-01 19:47:39 +01:00
.PHONY: help build buildnc shell compile clonerepos pullrepos clean
2022-02-01 19:47:39 +01:00
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."
2022-02-01 19:47:39 +01:00
@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) \
2023-10-24 00:29:45 +02:00
--build-arg CLIB2_REPO=$(CLIB2REPO) \
2022-02-01 19:47:39 +01:00
--build-arg REPOS_PATH=$(REPOSPATH) .
buildnc: pullrepos
docker build --no-cache -t $(REPO):$(TAG) \
2023-10-24 00:29:45 +02:00
--build-arg CLIB2_REPO=$(CLIB2REPO) \
2022-02-01 19:47:39 +01:00
--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
2022-02-01 19:47:39 +01:00
clean:
-docker rm -f $(NAME)