diff --git a/configure b/configure index 58f0c20e..fa7e422b 100755 --- a/configure +++ b/configure @@ -27,8 +27,20 @@ FIND=$(command -v gfind || command -v find) # Update submodules git submodule update --init 1> /dev/null -# Get files +# Make sure config.h exists on first build +if [ ! -f ".config" ]; then + util/kconfiglib/alldefconfig.py +fi + +if [ ! -f "src/lib/config.h" ]; then + util/kconfiglib/genconfig.py --header-path src/lib/config.h +fi + +# Get architecture from config arch=`sed -rn 's/\#define CONFIG_ARCH "([^"]+)"/\1/p' src/lib/config.h` + + +# Get files extensions="\.\(c\|asm\|s\|psf\)" arch_files=`$FIND -L src -type f -iregex "^.*$arch-.*$extensions" | tr '\n' ' '` files=`$FIND -L src -type f -iregex "^[^\-]*$extensions" | tr '\n' ' '` diff --git a/docs/compiling.md b/docs/compiling.md index 1d1558fd..449d9d64 100644 --- a/docs/compiling.md +++ b/docs/compiling.md @@ -59,10 +59,11 @@ In addition to the toolchain, the [NASM](https://www.nasm.us/) assembler is also Once you have that in place, you can compile Xelix using: ```bash +./configure + # Optional, if you want to customize settings: make menuconfig -./configure make ```