meta: If a filed called '.arch' exists, use it as ARCH by default

This commit is contained in:
K. Lange 2022-02-06 21:17:20 +09:00
parent 592fd1ca26
commit 31a83e919b
3 changed files with 11 additions and 1 deletions

1
.gitignore vendored
View File

@ -32,3 +32,4 @@
/image.iso
/boot/mbr.sys
/bootstub
/.arch

View File

@ -3,7 +3,7 @@ TOOLCHAIN=util
BASE=base
export PATH := $(shell $(TOOLCHAIN)/activate.sh)
ARCH ?= x86_64
ARCH ?= $(shell $(TOOLCHAIN)/arch.sh)
include build/${ARCH}.mk

9
util/arch.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ -e "$DIR/../.arch" ]; then
cat "$DIR/../.arch"
exit 0
fi
echo "x86_64"