Cant get make files to work....

For SAMA5D2 Xplained, SAMA5D3 Xplained and SAMA5D4 Xplained

Moderator: nferre

jbsull
Posts: 3
Joined: Tue Oct 17, 2017 10:03 pm

Cant get make files to work....

Tue Oct 17, 2017 10:45 pm

Hello,
I am a newbie - I know this.

I am trying to compile the source code for the eval board - a SAMA5D2Xplained board
I am running Linux -Mint on a 32 bit machine.

My goal is to set up a development system for the eval board.
// found info on linux4sam/bin/view/Linux4SAM/LinuxKernel

I did a:
make mrproper - it worked,

but then the:
make config command has an issue.

james@james-HP-Compaq-6000-Pro-SFF-PC ~/linux-at91 $ make config
HOSTCC scripts/basic/fixdep
scripts/basic/fixdep.c:105:23: fatal error: sys/types.h: No such file or directory
compilation terminated.
scripts/Makefile.host:107: recipe for target 'scripts/basic/fixdep' failed
make[1]: *** [scripts/basic/fixdep] Error 1
Makefile:448: recipe for target 'scripts_basic' failed
make: *** [scripts_basic] Error 2

It looks like it doesn't know where to look ?

and if I try to build:
james@james-HP-Compaq-6000-Pro-SFF-PC ~/at91bootstrap $ make at91sam9x5ekdf_uboot_defconfig
conf.c:6:20: fatal error: locale.h: No such file or directory
compilation terminated.
Makefile:32: recipe for target 'conf.o' failed
make[2]: *** [conf.o] Error 1
Makefile:67: recipe for target 'config/conf' failed
make[1]: *** [config/conf] Error 2
Makefile:360: recipe for target 'at91sam9x5ekdf_uboot_defconfig' failed
make: *** [at91sam9x5ekdf_uboot_defconfig] Error 2

Something very basic is missing.....

Jim
User avatar
BlackMesa
Location: Vilnius
Posts: 9
Joined: Thu Oct 05, 2017 2:02 pm

Re: Cant get make files to work....

Wed Oct 18, 2017 7:56 am

"Make: No such file or directory" error always depends on which directory you are sitting in.
You must sit in directory where is Makefile.

I don't see the file you are trying to compile, so I cant say much... As I understand you are trying to compile Bootstrap...
You can open Makefile to see if there is something about parameter "config". Are you sure it is not named "menuconfig"?

If I'm right that you try to make bootstrap, you should look in at91bootstrap/boards/yourboard/ for exact file name, which to use in $ make at91sam9x5ekdf_uboot_defconfig .

$ make menuconfig works only after you made $ make at91sam9x5ekdf_uboot_defconfig correctly, because first you have to generate default configurations with $ make at91sam9x5ekdf_uboot_defconfig , then you can make advanced changes with $ make menuconfig if you need.
blue_z
Location: USA
Posts: 1550
Joined: Thu Apr 19, 2007 10:15 pm

Re: Cant get make files to work....

Thu Oct 19, 2017 12:24 am

jbsull wrote:I am a newbie - I know this.
So learn How To Ask Questions The Smart Way.

jbsull wrote:I am trying to compile the source code for the eval board - a SAMA5D2Xplained board
That's an ambiguous statement. There is not just a single piece of "source code". There is source code for many programs in many projects that can be built for that board.

jbsull wrote:I did a:
make mrproper - it worked,

but then the:
make config command has an issue.

james@james-HP-Compaq-6000-Pro-SFF-PC ~/linux-at91 $ make config
HOSTCC scripts/basic/fixdep
scripts/basic/fixdep.c:105:23: fatal error: sys/types.h: No such file or directory
compilation terminated.
scripts/Makefile.host:107: recipe for target 'scripts/basic/fixdep' failed
make[1]: *** [scripts/basic/fixdep] Error 1
Makefile:448: recipe for target 'scripts_basic' failed
make: *** [scripts_basic] Error 2
The proper way to provide a description of a problem is to actually write a sentence (or more) of what you're trying to do. A console log is appropriate, but without any description it has no context.
Only because there is one salient directory name in the the shell prompt is there a clue as to what you're trying to build.

jbsull wrote:and if I try to build:
james@james-HP-Compaq-6000-Pro-SFF-PC ~/at91bootstrap $ make at91sam9x5ekdf_uboot_defconfig
conf.c:6:20: fatal error: locale.h: No such file or directory
compilation terminated.
Makefile:32: recipe for target 'conf.o' failed
make[2]: *** [conf.o] Error 1
Makefile:67: recipe for target 'config/conf' failed
make[1]: *** [config/conf] Error 2
Makefile:360: recipe for target 'at91sam9x5ekdf_uboot_defconfig' failed
make: *** [at91sam9x5ekdf_uboot_defconfig] Error 2
Again you fail to provide context.
Apparently you should get credit for actually reading a README file, but blindly following an example when you actually have a different board is bizarre.

jbsull wrote:Something very basic is missing.....
Yes, what is missing is salient information in your post as to how you may have setup (if at all) your build environment on your host machine. Cross compiling a kernel or bootloader requires a proper build environment before you type any `make` command.

Regards
jbsull
Posts: 3
Joined: Tue Oct 17, 2017 10:03 pm

Re: Cant get make files to work....

Thu Oct 19, 2017 3:31 pm

CONTEXT:

I was attempting to follow the instructions at:

https://www.at91.com/linux4sam/bin/view ... edMainPage

in section:

Play with the demo

Build From source code

Setup ARM Cross Compiler
and
Build AT91Bootstrap from sources

They must be making an assumption - that eludes me.

HOW DO I CHECK THE ENVIRONMENT FOR PROPER SETUP ?
User avatar
BlackMesa
Location: Vilnius
Posts: 9
Joined: Thu Oct 05, 2017 2:02 pm

Re: Cant get make files to work....

Fri Oct 20, 2017 9:36 am

For building bootstrap in linux system you need only Cross Compiler: gcc-arm-linux-gnueabi
Maybe build-essential: apt-get install build-essential.

After you have these, go to root directory of bootstrap (e.g. at91bootstrap) using "cd" command in terminal http://www.rapidtables.com/code/linux/cd.htm. If you are in right directory, you have to see Makefile with "ls" command.

Then write these commands:
make mrproper
make sama5d2_xplaineddf_uboot_defconfig for exact name look at at91bootstrap/boards/sama5d2_xplained/ directory, there will be some different files for different memory locations, everything is explained https://www.at91.com/linux4sam/bin/view ... edMainPage
make menuconfig (if you need to change some parameters in bootstrap. If you want load u-boot files, you don't need this command, skip it)
export CROSS_COMPILE=arm-linux-gnueabi- use with "sudo" or "su" if it answers that you don't have permissions.
make if everything OK, the "binaries" directory must appear in "at91bootstrap" folder.

In linux mint commands "sudo", "apt-get" can be named differently, google for it. Also in different linux distros commands to install (example: sudo apt-get install build-essential) can be different or even you must install it manual way (from tar.gz for example).

In later posts write what you did and what output you get.
blue_z
Location: USA
Posts: 1550
Joined: Thu Apr 19, 2007 10:15 pm

Re: Cant get make files to work....

Tue Oct 24, 2017 2:54 am

jbsull wrote:CONTEXT:
I was attempting to follow the instructions at:
https://www.at91.com/linux4sam/bin/view ... edMainPage

in section:
Play with the demo
Build From source code
Setup ARM Cross Compiler
and
Build AT91Bootstrap from sources
Your claim of attempting to follow "the instructions" is contradicted by your description of commands that you entered. The commands that you used are not mentioned, and salient commands seem to have been omitted.

That guide that you cite is not ideal in that you cannot skip around any steps. If you're not familiar with cross-compiling, then you must follow each and every step in the order shown.

jbsull wrote:They must be making an assumption - that eludes me.
That guide makes the assumption that you will perform each step, in the given sequence, in one session.
Apparently, based on your vague description, you haven't done that. You skipped to the kernel first, and didn't follow the proper steps.

jbsull wrote:HOW DO I CHECK THE ENVIRONMENT FOR PROPER SETUP ?
Don't shout.

The shell command to display the environment is `printenv`.
The salient environment variables for cross-compiling are PATH, ARCH, and CROSS_COMPILE.
Of course you would also need a toolchain (which, among other things, you fail to mention).

Regards
jbsull
Posts: 3
Joined: Tue Oct 17, 2017 10:03 pm

Re: Cant get make files to work....

Fri Oct 27, 2017 10:57 pm

Hello,

Problem Solved.

I can now build ./binaries/sama5d2_xplained-sdcardboot-uboot-3.8.9.elf

Apparently I was missing a package - "ncurses-dev"

sudo apt-get update
sudo apt-get install ncurses-dev

Once I did this, I could run the configuration "make menuconfig"
and everything was much happier.

I am not sure what I could have done to figure this out more quickly.

Thanks for the help.

Jim

Return to “SAMA5 Xplained”

Who is online

Users browsing this forum: No registered users and 1 guest