Cross-Compiler Build Error: No rule to make target 'install'

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
GameDungeon
Posts: 2
Joined: Thu Jul 23, 2020 2:33 pm
Libera.chat IRC: GameDungeon

Cross-Compiler Build Error: No rule to make target 'install'

Post by GameDungeon »

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: Select all

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
Octocontrabass
Member
Member
Posts: 5572
Joined: Mon Mar 25, 2013 7:01 pm

Re: Cross-Compiler Build Error: No rule to make target 'inst

Post by Octocontrabass »

What other commands did you run up to this point? It sounds like you might have missed one, or typed something wrong.
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Cross-Compiler Build Error: No rule to make target 'inst

Post by Schol-R-LEA »

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: Select all

#!/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: Select all

#!/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
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
GameDungeon
Posts: 2
Joined: Thu Jul 23, 2020 2:33 pm
Libera.chat IRC: GameDungeon

Re: Cross-Compiler Build Error: No rule to make target 'inst

Post by GameDungeon »

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.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Cross-Compiler Build Error: No rule to make target 'inst

Post by iansjack »

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.
Post Reply