OSDev.org
https://forum.osdev.org/

Cross-Compiler Build Error: No rule to make target 'install'
https://forum.osdev.org/viewtopic.php?f=1&t=37036
Page 1 of 1

Author:  GameDungeon [ Thu Jul 23, 2020 3:52 pm ]
Post subject:  Cross-Compiler Build Error: No rule to make target 'install'

I am a new OS dev (I have been programming for a while now though), and I've come across some errors. I've checked the form for this error, but have not found any good info on it.

OS: 20.04 LTS

I started with: https://wiki.osdev.org/GCC_Cross-Compiler

GCC: gcc-10.2.0
binutils: binutils-2.34

I built Binutils fine, but on running make install-target-libgcc I got this error:

Code:
test@test-VirtualBox:~/scr/build-gcc$ make install-target-libgcc
/bin/bash ../gcc-10.2.0/mkinstalldirs /home/test/opt/cross /home/test/opt/cross
make[1]: Entering directory '/home/test/scr/build-gcc/i686-elf/libgcc'
make[1]: *** No rule to make target 'install'.  Stop.
make[1]: Leaving directory '/home/test/scr/build-gcc/i686-elf/libgcc'
make: *** [Makefile:12782: install-target-libgcc] Error 2

Author:  Octocontrabass [ Wed Jul 29, 2020 9:03 pm ]
Post subject:  Re: Cross-Compiler Build Error: No rule to make target 'inst

What other commands did you run up to this point? It sounds like you might have missed one, or typed something wrong.

Author:  Schol-R-LEA [ Thu Jul 30, 2020 7:42 am ]
Post subject:  Re: Cross-Compiler Build Error: No rule to make target 'inst

One thing I will recommend is to write a shell script for building the cross-compiler, as it is something you may need to do more than once. While the process isn't excessively complicated, it is sufficiently involved that doing it manually is prone to errors.

I have two scripts, one for binutils and another for gcc, which I use to update and build not just a single instance but several, to allow me to target several different architectures. However, not only am I building more than most people would need, I am also drawing directly from the development repos, which can be a dicey proposition. You may want to write a script or scripts which suit your own needs better than mine would. I'll attach mine so you can go over them, but I would advise against using them as-is.

update-binutils.sh
Code:
#!/bin/bash

HOME_DIR="/home/schol-r-lea"
BINUTILS_SRC="$HOME_DIR/Deployments/cross-dev-utils/binutils-gdb"
BINUTILS_BUILD="$BINUTILS_SRC/build"
DEST="$HOME_DIR/opt/cross"

cd $BINUTILS_SRC
git pull origin master

cd $BINUTILS_BUILD
for TARGET in "i686-elf" "x86_64-elf" \
"arm-none-eabi" "aarch64-none-elf" \
"riscv32-unknown-elf" "riscv64-unknown-elf" \
"mipsel" "mips64el"
do
  TARGET_DIR="$BINUTILS_BUILD/$TARGET"
  if [ ! -d $TARGET_DIR ]; then
     mkdir -p $TARGET_DIR
  fi
  make distclean
 
  cd $TARGET_DIR
  $BINUTILS_SRC/configure --target=$TARGET --prefix=$DEST --with-sysroot --disable-nls --disable-werror
  make
  make install
done


update-gcc.sh
Code:
#!/bin/bash

GCC_SRC="/home/schol-r-lea/Deployments/cross-dev-utils/gcc"
GCC_BUILD="$GCC_SRC/build"
DEST="/home/schol-r-lea/opt/cross"

cd $GCC_SRC
git pull origin master

cd $GCC_BUILD
for TARGET in "i686-elf" "x86_64-elf" \
"arm-none-eabi" "aarch64-none-elf" \
"riscv32-unknown-elf" "riscv64-unknown-elf" \
"mipsel" "mips64el"
do
  TARGET_DIR="$GCC_BUILD/$TARGET"
  if [ ! -d $TARGET_DIR ]; then
     mkdir -p $TARGET_DIR
  fi

  cd $TARGET_DIR
  $GCC_SRC/configure --target=$TARGET --prefix=$DEST --disable-nls \
                     --enable-languages=objc,c,d,c++,go \
                     --without-headers
  make all-gcc
  make all-target-libgcc
  make install-gcc
  make install-target-libgcc
done

Author:  GameDungeon [ Sat Aug 01, 2020 7:43 pm ]
Post subject:  Re: Cross-Compiler Build Error: No rule to make target 'inst

I submitted this about a week ago, I have since fixed it. It was one of those things were randomly a compile does not work and if you compile it again it does.

Author:  iansjack [ Sun Aug 02, 2020 4:32 am ]
Post subject:  Re: Cross-Compiler Build Error: No rule to make target 'inst

GameDungeon wrote:
It was one of those things were randomly a compile does not work and if you compile it again it does.
No, that just doesn't happen.

You did something different to make it work. In this case it doesn't probably matter what it was, but I wouldn't rely on that philosophy when developing your own applications. It's important to understand why problems are fixed rather than just relying on serendipity.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/