This repository has been archived on 2024-06-02. You can view files and clone it, but cannot push or open issues or pull requests.
upsilon-docker/Makefile

61 lines
1.8 KiB
Makefile
Raw Normal View History

2023-05-30 16:10:03 -04:00
.PHONY: images f4pga buildroot litex clone help attach hardware-image \
buildroot-image litex-f4pga-image hardware-container \
upsilon.tar.gz
2023-05-26 15:00:46 -04:00
help:
2023-05-26 17:09:30 -04:00
@echo 'compile commands (run in order)'
2023-05-26 15:00:46 -04:00
@echo 'make clone: clone repositories'
2023-05-29 14:39:02 -04:00
@echo 'make images: build docker images'
2023-05-30 16:10:03 -04:00
###### Images
images: hardware-image buildroot-image
2023-05-26 15:00:46 -04:00
2023-05-29 14:39:02 -04:00
hardware-image: f4pga/scripts/prepare_environment.sh litex/litex_setup.py
2023-05-30 16:10:03 -04:00
docker build -f Dockerfile.litex_f4pga -t "upsilon-litex-f4pga-env" .
2023-05-29 14:39:02 -04:00
buildroot-image: buildroot.tar.gz
docker build -f Dockerfile.buildroot -t "upsilon-buildroot-env" .
2023-05-30 16:10:03 -04:00
###### Containers
2023-05-26 17:09:30 -04:00
2023-05-30 16:10:03 -04:00
hardware-container:
docker run -d --name upsilon-hardware-container upsilon-litex-f4pga-env /bin/sh -c 'while true; do sleep 2; done'
hardware-container-copy: upsilon.tar.gz
docker cp upsilon.tar.gz upsilon-hardware-container:/home/user/upsilon.tar.gz
hardware-container-shell:
docker exec -ti upsilon-hardware-container /bin/bash -l
hardware-container-clean:
-docker container stop upsilon-hardware-container
-docker container rm upsilon-hardware-container
2023-05-26 17:09:30 -04:00
2023-05-30 16:10:03 -04:00
###### External projects
2023-05-26 17:09:30 -04:00
2023-05-26 15:00:46 -04:00
clone: f4pga buildroot litex
f4pga:
if [ ! -d 'f4pga' ]; then \
git clone https://github.com/chipsalliance/f4pga; \
fi
cd f4pga && git checkout main && git pull && \
2023-05-30 16:10:03 -04:00
git checkout -B upsilon_stable 835a40534f9efd70770d74f56f25fef6cfc6ebc6 \
tar -czvf f4pga.tar.gz f4pga
2023-05-26 15:00:46 -04:00
buildroot:
if [ ! -d 'buildroot' ]; then \
git clone https://git.buildroot.org/buildroot; \
fi
cd buildroot && git checkout master && git pull && \
git checkout -B upsilon_stable 2023.02.1
tar -czvf buildroot.tar.gz buildroot/
litex:
if [ ! -d 'litex' ]; then \
git clone https://github.com/enjoy-digital/litex; \
fi
cd litex && git checkout master && git pull && \
git checkout -B upsilon_stable c6ccb626e88168045edacced3743f6bd98746742
2023-05-30 16:10:03 -04:00
upsilon.tar.gz:
tar -czvf upsilon.tar.gz upsilon/