Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Makefile targets for the Docker image #58

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM debian:bookworm as build-stage
# Check the docker targets in ./Makefile to see how to use this.

FROM debian:bookworm AS build-stage

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

# ------------------------------------------------------------------------------

FROM debian:bookworm-slim as run-stage
FROM debian:bookworm-slim AS run-stage

RUN apt-get update && apt-get install -y \
build-essential flex bison cmake texinfo device-tree-compiler git \
Expand Down
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ AR='$(MAKEFILE_DIR)rtems/$(RTEMS_VERSION)/$(ARCH)-rtems$(RTEMS_VERSION)/bin/ar'
.PHONY: blas
#H Build the BLAS-LAPACKE library.
blas:
cp external/BLAS/make.inc $(SRC_BLAS)
cp external/BLAS/make.inc $(SRC_BLAS)
cd $(SRC_BLAS) && make blaslib $(BLAS_TOOLS)
cd $(SRC_BLAS) && make cblaslib $(BLAS_TOOLS)
cd $(SRC_BLAS) && make lapacklib $(BLAS_TOOLS)
Expand Down Expand Up @@ -404,3 +404,17 @@ shell:
package:
mkdir -p "${PACKAGE_DIR}"
cd "${PREFIX}" && tar -czf "../../${PACKAGE_DIR}/${PACKAGE_PREFIX}_${OS_NAME}_${OS_VERSION}_${GRISP_TOOLCHAIN_REVISION}.tar.gz" *

.PHONY: docker-build
#H Build the toolchain with tag 'local'
docker-build:
docker build -t grisp/grisp2-rtems-toolchain:local .

.PHONY: docker-build-push
#H Build the toolchain with the given tag and push it, for example 'make docker-build-push TAG=latest'
docker-build-push:
@if [ -z "$(TAG)" ]; then \
echo "Error: TAG is not set. Usage: make docker-build-push TAG=<tag>"; \
exit 1; \
fi
docker build -t grisp/grisp2-rtems-toolchain:$(TAG) --push .
Loading