This commit is contained in:
Your Name 2025-09-23 06:41:54 +00:00
parent d26952319c
commit 99b4fe9808
2 changed files with 16 additions and 9 deletions

View File

@ -14,7 +14,7 @@ LIBFT := $(LIBFT_DIR)/lib/libft.a
LIB := $(LIBFT) LIB := $(LIBFT)
CFLAGS := -Wall -Wextra -Werror --target=arm-linux-gnueabihf CFLAGS := -Wall -Wextra -Werror --target=aarch64-linux-musl
DOCKER_CMD := /bin/sh -c 'hello "host.docker.internal" "8000"' DOCKER_CMD := /bin/sh -c 'hello "host.docker.internal" "8000"'
@ -26,24 +26,31 @@ ALPINE_IMG := $(ASSETS)/alpine.img
ALPINE_TAR := $(ALPINE_IMG).gz ALPINE_TAR := $(ALPINE_IMG).gz
get: $(ALPINE) $(ASSETS) get: $(ALPINE) $(ASSETS)
wget https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/armhf/alpine-minirootfs-3.22.1-armhf.tar.gz -O $(MINIROOTFS) wget https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/aarch64/alpine-rpi-3.22.1-aarch64.tar.gz -O $(ALPINE_TAR)
wget https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/armhf/alpine-rpi-3.22.1-armhf.img.gz -O $(ALPINE_TAR)
gunzip -c $(ALPINE_TAR) > $(ALPINE_IMG)
rm -rf $(ALPINE)/* rm -rf $(ALPINE)/*
tar xvf $(MINIROOTFS) -C $< tar xvf $(ALPINE_TAR) -C $(ALPINE)
all: $(SRC) $(BUILD_DIR) $(LIB) get all: build copy
$(SRC) $(BUILD_DIR) $(LIB) get
$(CC) $(CFLAGS) -o $(TARGET) -static $(SRC) $(LIB) $(CC) $(CFLAGS) -o $(TARGET) -static $(SRC) $(LIB)
cp $(TARGET) $(ALPINE_BIN) cp $(TARGET) $(ALPINE_BIN)
tar czf $(MINIROOTFS) -C alpine ./ tar czf $(MINIROOTFS) -C alpine ./
docker import --platform linux/arm/v7 $(MINIROOTFS) alpine-custom:latest docker import --platform linux/arm64 $(MINIROOTFS) alpine-custom:latest
build: $(SRC) $(BUILD_DIR) $(LIB) get
$(CC) $(CFLAGS) -o $(TARGET) -static $(SRC) $(LIB)
copy: build
cp $(TARGET) $(ALPINE_BIN)
tar czf $(MINIROOTFS) -C alpine ./
docker import --platform linux/arm64 $(MINIROOTFS) alpine-custom:latest
run: all run: all
docker run --add-host=host.docker.internal:host-gateway --platform linux/arm/v7 -it alpine-custom $(DOCKER_CMD) docker run --add-host=host.docker.internal:host-gateway --platform linux/arm64 -it alpine-custom $(DOCKER_CMD)
$(LIB): $(LIB):
make -C $(LIBFT_DIR) make aarch64 -C $(LIBFT_DIR)
$(BUILD_DIR): $(BUILD_DIR):
mkdir -p $@ mkdir -p $@

BIN
headless.apkovl.tar.gz Normal file

Binary file not shown.