From 4e375151df3c79300a1d3454949fe309f690dd63 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Wed, 2 Feb 2022 13:28:55 +0000 Subject: [PATCH] Simplified makefile by replacing gcc jobs with compile --- Makefile | 59 ++++++++++++++++---------------------------------------- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/Makefile b/Makefile index 309b18a..ead01e6 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,9 @@ TAG ?= adtools-build WORKSPACE ?= -w /opt/adtools NAME ?= adtools-build VOLUMES ?= -v "${PWD}/native-gcc":/gcc +GCC ?= 8 -.PHONY: help build buildnc shell gcc6 gcc8 gcc10 gcc11 clonerepos pullrepos clean +.PHONY: help build buildnc shell compile clonerepos pullrepos clean default: help @@ -14,22 +15,17 @@ help: @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 without" - @echo " using caching" - @echo "shell - Create a container with the latest Docker image and get into it." - @echo " Not suitable to compile adtools" - @echo "gcc6 - Create a container with the latest Docker image and get into it" - @echo " to compile adtools with GCC 6." - @echo "gcc8 - Create a container with the latest Docker image and get into it" - @echo " to compile adtools with GCC 8." - @echo "gcc10 - Create a container with the latest Docker image and get into it" - @echo " to compile adtools with GCC 10." - @echo "gcc11 - Create a container with the latest Docker image and get into it" - @echo " to compile adtools with GCC 11." - @echo "clonerepos - Clone the necessary repositories under repos folder." - @echo "pullrepos - Pull the latest code for the projects under repos folder." - @echo "clean - Remove the docker container, if this still exists." + @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 parameter. Possible values 8/9/10/11." + @echo "clonerepos - Clone the necessary repositories under repos folder." + @echo "pullrepos - Pull the latest code for the projects under repos folder." + @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:" @@ -47,33 +43,12 @@ buildnc: pullrepos shell: docker run -it --rm --name $(NAME) $(WORKSPACE) $(VOLUMES) $(REPO):$(TAG) /bin/bash -gcc6: - docker run -it --rm --name $(NAME)-6 $(WORKSPACE) \ - -v "${PWD}/native-gcc/6":/gcc \ +compile: + docker run -it --rm --name $(NAME)-$(GCC) $(WORKSPACE) \ + -v "${PWD}/native-gcc/$(GCC)":/gcc \ -v "${PWD}/files/native-build/makefile-SDK53.34":/opt/adtools/native-build/makefile \ -v "${PWD}/files/gcc-build":/opt/adtools/gcc-build \ - --env-file .env6 $(REPO):$(TAG) /bin/bash - -gcc8: - docker run -it --rm --name $(NAME)-8 $(WORKSPACE) \ - -v "${PWD}/native-gcc/8":/gcc \ - -v "${PWD}/files/native-build/makefile-SDK53.34":/opt/adtools/native-build/makefile \ - -v "${PWD}/files/gcc-build":/opt/adtools/gcc-build \ - --env-file .env8 $(REPO):$(TAG) /bin/bash - -gcc10: - docker run -it --rm --name $(NAME)-10 $(WORKSPACE) \ - -v "${PWD}/native-gcc/10":/gcc \ - -v "${PWD}/files/native-build/makefile-SDK53.34":/opt/adtools/native-build/makefile \ - -v "${PWD}/files/gcc-build":/opt/adtools/gcc-build \ - --env-file .env10 $(REPO):$(TAG) /bin/bash - -gcc11: - docker run -it --rm --name $(NAME)-11 $(WORKSPACE) \ - -v "${PWD}/native-gcc/11":/gcc \ - -v "${PWD}/files/native-build/makefile-SDK53.34":/opt/adtools/native-build/makefile \ - -v "${PWD}/files/gcc-build":/opt/adtools/gcc-build \ - --env-file .env11 $(REPO):$(TAG) /bin/bash + --env-file .env$(GCC) $(REPO):$(TAG) /bin/bash clonerepos: git clone https://github.com/sba1/adtools $(REPOSPATH)/adtools