2024-03-20 07:15:38 -04:00
|
|
|
# Copyright (C) 2024 - Tillitis AB
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2022-12-15 12:27:52 -05:00
|
|
|
|
2023-03-28 08:37:21 -04:00
|
|
|
# image produced by build-image targets
|
|
|
|
BUILDIMAGE=tkey-builder-local
|
|
|
|
|
|
|
|
# default image used when running a container
|
2024-03-21 10:54:58 -04:00
|
|
|
IMAGE=ghcr.io/tillitis/tkey-builder:4
|
2023-03-28 08:37:21 -04:00
|
|
|
|
|
|
|
all:
|
|
|
|
@echo "Targets:"
|
|
|
|
@echo "run Run a shell using image '$(IMAGE)' (Podman)"
|
|
|
|
@echo "run-make Build the FPGA bitstream using image '$(IMAGE)' (Podman)"
|
2024-03-20 07:15:38 -04:00
|
|
|
@echo "run-tb Run all the testbenches using image '$(IMAGE)' (Podman)"
|
2023-03-28 08:37:21 -04:00
|
|
|
@echo "run-make-no-clean Like run-make but without cleaning first, useful for iterative firmware dev"
|
|
|
|
@echo "run-make-clean_fw Like run-make but cleans only firmware"
|
2023-08-30 08:20:41 -04:00
|
|
|
@echo "flash Program the SPI flash on the TKey - needs an existing bitstream"
|
2023-03-28 08:37:21 -04:00
|
|
|
@echo "pull Pull down the image '$(IMAGE)' (Podman)"
|
|
|
|
@echo "build-image Build a toolchain image named '$(BUILDIMAGE)' (Podman)"
|
|
|
|
@echo " A newly built image can be used like: make IMAGE=$(BUILDIMAGE) run"
|
|
|
|
@echo "docker-run Run a shell using image '$(IMAGE)' (Docker)"
|
|
|
|
@echo "docker-build-image Build a toolchain image named '$(BUILDIMAGE)' (Docker)"
|
2022-09-20 08:24:59 -04:00
|
|
|
|
|
|
|
run:
|
2023-03-28 08:37:21 -04:00
|
|
|
podman run --rm --mount type=bind,source="`pwd`/../",target=/build -w /build -it \
|
|
|
|
$(IMAGE) /usr/bin/bash
|
|
|
|
|
|
|
|
docker-run:
|
|
|
|
docker run --rm --mount type=bind,source="`pwd`/../",target=/build -w /build -it \
|
|
|
|
$(IMAGE) /usr/bin/bash
|
|
|
|
|
|
|
|
run-make:
|
|
|
|
podman run --rm --mount type=bind,source="`pwd`/../hw/application_fpga",target=/build -w /build -it \
|
|
|
|
$(IMAGE) make clean application_fpga.bin
|
|
|
|
|
2024-03-20 07:15:38 -04:00
|
|
|
run-tb:
|
|
|
|
podman run --rm --mount type=bind,source="`pwd`/../hw/application_fpga",target=/build -w /build -it \
|
2024-10-10 02:56:48 -04:00
|
|
|
$(IMAGE) make clean_tb tb
|
2024-03-20 07:15:38 -04:00
|
|
|
|
2023-03-28 08:37:21 -04:00
|
|
|
run-make-testfw:
|
|
|
|
podman run --rm --mount type=bind,source="`pwd`/../hw/application_fpga",target=/build -w /build -it \
|
|
|
|
$(IMAGE) make clean application_fpga_testfw.bin
|
|
|
|
|
|
|
|
run-make-no-clean:
|
|
|
|
podman run --rm --mount type=bind,source="`pwd`/../hw/application_fpga",target=/build -w /build -it \
|
|
|
|
$(IMAGE) make application_fpga.bin
|
2022-12-15 12:27:52 -05:00
|
|
|
|
2023-03-28 08:37:21 -04:00
|
|
|
run-make-clean_fw:
|
|
|
|
podman run --rm --mount type=bind,source="`pwd`/../hw/application_fpga",target=/build -w /build -it \
|
|
|
|
$(IMAGE) make clean_fw application_fpga.bin
|
2023-03-16 11:23:48 -04:00
|
|
|
|
2023-08-30 08:20:41 -04:00
|
|
|
flash:
|
|
|
|
podman run --rm \
|
|
|
|
--device /dev/bus/usb/$(lsusb | grep -m 1 1209:8886 | awk '{ printf "%s/%s", $2, substr($4,1,3) }') \
|
|
|
|
--mount type=bind,source="`pwd`/../hw/application_fpga",target=/build \
|
|
|
|
-w /build/hw/application_fpga \
|
|
|
|
-it $(IMAGE) tillitis-iceprog /build/application_fpga.bin
|
|
|
|
|
|
|
|
|
2023-03-28 08:37:21 -04:00
|
|
|
pull:
|
|
|
|
podman pull $(IMAGE)
|
2022-12-15 12:27:52 -05:00
|
|
|
|
2023-03-28 08:37:21 -04:00
|
|
|
build-image:
|
|
|
|
podman build -t $(BUILDIMAGE) .
|
2022-12-15 12:27:52 -05:00
|
|
|
|
2023-03-28 08:37:21 -04:00
|
|
|
docker-build-image:
|
|
|
|
docker build -t $(BUILDIMAGE) .
|