Skip to content

Commit 7414dca

Browse files
committed
Add Makefile targets for the Docker image
1 parent 5167078 commit 7414dca

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM debian:bookworm as build-stage
1+
# Check the docker targets in ./Makefile to see how to use this.
2+
3+
FROM debian:bookworm AS build-stage
24

35
RUN apt-get update && apt-get install -y \
46
build-essential flex bison cmake texinfo device-tree-compiler git \
@@ -16,7 +18,7 @@ RUN make install
1618

1719
# ------------------------------------------------------------------------------
1820

19-
FROM debian:bookworm-slim as run-stage
21+
FROM debian:bookworm-slim AS run-stage
2022

2123
RUN apt-get update && apt-get install -y \
2224
build-essential flex bison cmake texinfo device-tree-compiler git \

Makefile

+15-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ AR='$(MAKEFILE_DIR)rtems/$(RTEMS_VERSION)/$(ARCH)-rtems$(RTEMS_VERSION)/bin/ar'
365365
.PHONY: blas
366366
#H Build the BLAS-LAPACKE library.
367367
blas:
368-
cp external/BLAS/make.inc $(SRC_BLAS)
368+
cp external/BLAS/make.inc $(SRC_BLAS)
369369
cd $(SRC_BLAS) && make blaslib $(BLAS_TOOLS)
370370
cd $(SRC_BLAS) && make cblaslib $(BLAS_TOOLS)
371371
cd $(SRC_BLAS) && make lapacklib $(BLAS_TOOLS)
@@ -404,3 +404,17 @@ shell:
404404
package:
405405
mkdir -p "${PACKAGE_DIR}"
406406
cd "${PREFIX}" && tar -czf "../../${PACKAGE_DIR}/${PACKAGE_PREFIX}_${OS_NAME}_${OS_VERSION}_${GRISP_TOOLCHAIN_REVISION}.tar.gz" *
407+
408+
.PHONY: docker-build
409+
#H Build the toolchain with tag 'local'
410+
docker-build:
411+
docker build -t grisp/grisp2-rtems-toolchain:local .
412+
413+
.PHONY: docker-build-push
414+
#H Build the toolchain with the given tag and push it, for example 'make docker-build-push TAG=latest'
415+
docker-build-push:
416+
@if [ -z "$(TAG)" ]; then \
417+
echo "Error: TAG is not set. Usage: make docker-build-push TAG=<tag>"; \
418+
exit 1; \
419+
fi
420+
docker build -t grisp/grisp2-rtems-toolchain:$(TAG) --push .

0 commit comments

Comments
 (0)