bless
This commit is contained in:
parent
d26952319c
commit
99b4fe9808
25
Makefile
25
Makefile
@ -14,7 +14,7 @@ LIBFT := $(LIBFT_DIR)/lib/libft.a
|
||||
|
||||
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"'
|
||||
|
||||
@ -26,24 +26,31 @@ ALPINE_IMG := $(ASSETS)/alpine.img
|
||||
ALPINE_TAR := $(ALPINE_IMG).gz
|
||||
|
||||
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/armhf/alpine-rpi-3.22.1-armhf.img.gz -O $(ALPINE_TAR)
|
||||
gunzip -c $(ALPINE_TAR) > $(ALPINE_IMG)
|
||||
wget https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/aarch64/alpine-rpi-3.22.1-aarch64.tar.gz -O $(ALPINE_TAR)
|
||||
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)
|
||||
cp $(TARGET) $(ALPINE_BIN)
|
||||
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
|
||||
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):
|
||||
make -C $(LIBFT_DIR)
|
||||
make aarch64 -C $(LIBFT_DIR)
|
||||
|
||||
$(BUILD_DIR):
|
||||
mkdir -p $@
|
||||
|
||||
BIN
headless.apkovl.tar.gz
Normal file
BIN
headless.apkovl.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user