OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 2:11 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Cross-Compiler Build Error: No rule to make target 'install'
PostPosted: Thu Jul 23, 2020 3:52 pm 
Offline

Joined: Thu Jul 23, 2020 2:33 pm
Posts: 2
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


Top
 Profile  
 
 Post subject: Re: Cross-Compiler Build Error: No rule to make target 'inst
PostPosted: Wed Jul 29, 2020 9:03 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5145
What other commands did you run up to this point? It sounds like you might have missed one, or typed something wrong.


Top
 Profile  
 
 Post subject: Re: Cross-Compiler Build Error: No rule to make target 'inst
PostPosted: Thu Jul 30, 2020 7:42 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
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

_________________
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.


Top
 Profile  
 
 Post subject: Re: Cross-Compiler Build Error: No rule to make target 'inst
PostPosted: Sat Aug 01, 2020 7:43 pm 
Offline

Joined: Thu Jul 23, 2020 2:33 pm
Posts: 2
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.


Top
 Profile  
 
 Post subject: Re: Cross-Compiler Build Error: No rule to make target 'inst
PostPosted: Sun Aug 02, 2020 4:32 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4597
Location: Chichester, UK
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 258 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group