Skip to content

Commit 2d48b45

Browse files
committed
some fixes
1 parent 66ee46f commit 2d48b45

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
submodules: recursive
2626

2727
- name: Configure
28-
run: ./configure --enable-O2 --enable-asan
28+
run: ./configure --enable-cross --enable-O2 --enable-asan
2929

3030
- name: Build and test
3131
shell: bash

Makefile

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,14 +539,19 @@ distclean: clean
539539
.PHONY: all cross fp-libs clean test test-aeabi-host test-legacy tar tags ETAGS doc distclean install uninstall FORCE
540540

541541
# Container image settings (auto-detect docker or podman)
542-
# For GHCR: set DOCKER_REGISTRY=ghcr.io and DOCKER_IMAGE_NAME=username/repo
543-
DOCKER_REGISTRY ?= localhost
544-
DOCKER_IMAGE_NAME ?= tinycc-armv8m
542+
DOCKER_REGISTRY ?= ghcr.io
543+
DOCKER_IMAGE_NAME ?= matgla/tinycc-armv8m
545544
DOCKER_IMAGE_TAG ?= latest
546545
DOCKER_FULL_IMAGE = $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)
547546

548547
# Detect available container runtime (prefer podman, fallback to docker)
549-
CONTAINER_RUNTIME := $(shell command -v podman 2>/dev/null || command -v docker 2>/dev/null)
548+
# User can override with: make docker-start CONTAINER_RUNTIME=docker
549+
CONTAINER_RUNTIME := $(shell \
550+
if command -v podman >/dev/null 2>&1 && podman info >/dev/null 2>&1; then \
551+
echo podman; \
552+
elif command -v docker >/dev/null 2>&1; then \
553+
echo docker; \
554+
fi)
550555
ifeq ($(CONTAINER_RUNTIME),)
551556
$(warning No container runtime found. Please install docker or podman.)
552557
endif
@@ -571,6 +576,17 @@ endif
571576
docker-build: container-build
572577
docker-push: container-push
573578

579+
# Pull and start container interactively with current directory mounted
580+
docker-start:
581+
ifeq ($(CONTAINER_RUNTIME),)
582+
$(error No container runtime found. Please install docker or podman.)
583+
else
584+
@echo "Pulling container image with $(CONTAINER_RUNTIME): $(DOCKER_FULL_IMAGE)"
585+
$(CONTAINER_RUNTIME) pull $(DOCKER_FULL_IMAGE)
586+
@echo "Starting container with $(CONTAINER_RUNTIME)..."
587+
$(CONTAINER_RUNTIME) run -it --rm -v $(CURDIR):/workspace $(DOCKER_FULL_IMAGE)
588+
endif
589+
574590
help:
575591
@echo "make"
576592
@echo " build native compiler (from separate objects)"
@@ -602,6 +618,8 @@ help:
602618
@echo " build and push container image to registry"
603619
@echo " docker-build (legacy alias)"
604620
@echo " docker-push (legacy alias)"
621+
@echo " docker-start"
622+
@echo " pull and start container interactively (mounts current dir to /workspace)"
605623
@echo "Custom configuration:"
606624
@echo " The makefile includes a file 'config-extra.mak' if it is present."
607625
@echo " This file may contain some custom configuration. For example to"

0 commit comments

Comments
 (0)