Maikefile error make: *** [prepare] Error 127 - c

I get the following error form the Makefile:
VERSION=`git describe --abbrev=0 --tags`
TAG=$(VERSION)
all: prepare
prepare:
$(TAG)
Error:
`git describe --abbrev=0 --tags`
/bin/sh: v1.1.2: command not found
make: *** [prepare] Error 127
What am I doing wrong?

your subshell command git describe --abbrev=0 --tags is executed an returns the string "v1.1.2". Make then tries to execute it as a program.
prepare:
echo $(TAG)
should work

Related

Linux compilation throwing error header file error

I am compiling this code (minimul linux kernel) from https://github.com/liva/minimal-linux
I am getting > make[1]: *** [Kbuild:42: include/generated/timeconst.h] Error 127
basically its make error. may be error in timeconst.h or may be its missing file.
So my question is how to find the file in the minimul-linux-master (download from above link) folder and how to debug for more info when compiling the code.
as u can see what make displays is completely useless. And I have no clue why the error is caused. there are not any other errors so I assumed all the errors or single error is in timeconst.h.
this is terminal output.
....
HOSTCC scripts/mod/sumversion.o
HOSTLD arch/x86/tools/relocs
HOSTCC scripts/mod/file2alias.o
UPD include/config/kernel.release
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CC kernel/bounds.s
CHK include/generated/timeconst.h
/bin/sh: 1: bc: not found
make[1]: *** [Kbuild:42: include/generated/timeconst.h] Error 127
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1054: prepare0] Error 2
make: *** Waiting for unfinished jobs....
HOSTLD scripts/mod/modpost
I am on host: 5.10.0-kali3-amd64
machine is x86-64
I fixed the same by comparing mine KBuild with the one defined in in the given link.
https://android.googlesource.com/kernel/msm/+/db248780101f2ca2bc3c02598917e88dfdce3207/Kbuild

Install SITL Error: what am I missing?

I am stuck with getting the SITL to install and I have tried many ways.
Please I don't know how to proceed.
I followed the instructions in
http://dev.ardupilot.com/wiki/sitl-nati ... _in_cygwin
I am able to
make px4-v2
The paths are set correctly in .bashrc
export PATH=$PATH:$HOME/ardupilot/Tools/autotest
However,
make sitl -j4
generates the following error:
$ make sitl -j4
%% libraries/AP_Common/c++.o
%% libraries/AP_Common/AP_Common.o
%% libraries/AP_Menu/AP_Menu.o
In file included from /home/Me/ardupilot/libraries/AP_Common/c++.cpp:9:0:
/home/Me/ardupilot/libraries/AP_HAL/AP_HAL.h:6:21: fatal error: stdbool.h: No such file or directory
compilation terminated.
C:/cygwin/home/Me/ardupilot/mk/build_rules.mk:27: recipe for target '/tmp/arducopter.build/libraries/AP_Common/c++.o' failed
make: *** [/tmp/arducopter.build/libraries/AP_Common/c++.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from /home/Me/ardupilot/libraries/AP_Common/AP_Common.cpp:21:0:
/home/Me/ardupilot/libraries/AP_HAL/AP_HAL.h:6:21: fatal error: stdbool.h: No such file or directory
compilation terminated.
C:/cygwin/home/Me/ardupilot/mk/build_rules.mk:27: recipe for target '/tmp/arducopter.build/libraries/AP_Common/AP_Common.o' failed
make: *** [/tmp/arducopter.build/libraries/AP_Common/AP_Common.o] Error 1
// BUILDROOT=/tmp/arducopter.build HAL_BOARD=HAL_BOARD_SITL HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_NONE TOOLCHAIN=NATIVE EXTRAFLAGS=-DGIT_VERSION="c52f16b8"
In file included from /home/Me/ardupilot/libraries/AP_Common/AP_Common.h:26:0,
from /home/Me/ardupilot/libraries/AP_Menu/AP_Menu.cpp:7:
/usr/include/stdlib.h:16:20: fatal error: stddef.h: No such file or directory
compilation terminated.
C:/cygwin/home/Me/ardupilot/mk/build_rules.mk:27: recipe for target '/tmp/arducopter.build/libraries/AP_Menu/AP_Menu.o' failed
make: *** [/tmp/arducopter.build/libraries/AP_Menu/AP_Menu.o] Error 1
Easier to use vagrant for doing this than doing manually : http://ardupilot.org/dev/docs/setting-up-sitl-using-vagrant.html
I use Ubuntu. Download the code and run it using the following steps.
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
https://github.com/ArduPilot/ardupilot.git
make sitl -j4

Building Minix 3.3 Errors

i installed minix 3.3 ,then i downloaded the source and tried to build followd this link instructions.
i got an error building minix as follows:
*** Error code 1
Stop.
make: stopped in /usr/src/gnu/usr.bin/texinfo
*** Error code 1
Stop.
make: stopped in /usr/src/gnu/usr.bin/texinfo
*** Error code 1
Stop.
make: stopped in /usr/src/gnu/usr.bin
*** Error code 1
Stop.
make: stopped in /usr/src/gnu
*** Error code 1
Stop.
make: stopped in /usr/src
*** Error code 1
Stop.
make: stopped in /usr/src
i found same problem discussed in this link ,i followd the instructions mentioned there:
#pkgin in gtexinfo
#cd /usr/src/gnu/usr.bin/texinfo
#makeinfo -I/usr/src/gnu/dist/texinfo/doc --no-split -o info-stnd.info /usr/src/gnu/dist/texinfo/doc/info-stnd.texi
#makeinfo -I/usr/src/gnu/dist/texinfo/doc --no-split -o info.info /usr/src/gnu/dist/texinfo/doc/info.texi
#makeinfo -I/usr/src/gnu/dist/texinfo/doc --no-split -o texinfo.info /usr/src/gnu/dist/texinfo/doc/texinfo.txi
#cd ../../..
#make -C gnu/usr.bin/texinfo all
at last command i recieve the following error
#make -c gnu/usr.bin/texinfo all
create texinfo/info-stnd.info
unknown option: no-version-header
*** Error code 1
stop.
make:stopped in /usr/src/gnu/usr.bin/texinfo
is there is a way to build it without errors.

Porting,Linux,C

I am getting this error while running this command
[root#himanshi busybox-1.20.2]# make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi- CONFIG_PREFIX=/home/himanshi/beagleboard_xm/target install
/home/himanshi/beagleboard_xm/build/busybox-1.20.2/scripts/gcc-version.sh: line 11: arm-unknown-linux-gnueabi-gcc: command not found
CC applets/applets.o
/bin/sh: arm-unknown-linux-gnueabi-gcc: command not found
make[1]: *** [applets/applets.o] Error 127
make: *** [applets_dir] Error 2
Infact I am getting error COMMAND NOT FOUND for this also::
make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi-
Please assist me for solving this problem.
Thank you
Himanshi
you should put the path of arm-unknown-linux-gnueabi-gcc in the PATH environment variable like this:
PATH=$PATH:/path/to/compiler
export PATH

How to fix this error in netbeans?

I get this error message. I tried to get the right things with CYGWIN, did I do something wrong? Do you need more information?
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c'
cygwin warning:
MS-DOS style path detected: build/Debug/Cygwin_4.x-Windows/hello\.d
Preferred POSIX equivalent is: build/Debug/Cygwin_4.x-Windows/hello/.d
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/playing_with_c.exe
make[2]: Entering directory `/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c'
mkdir -p dist/Debug/Cygwin_4.x-Windows
gcc -o dist/Debug/Cygwin_4.x-Windows/playing_with_c build/Debug/Cygwin_4.x-Windows/hello\ world.o build/Debug/Cygwin_4.x-Windows/main.o
nbproject/Makefile-Debug.mk:63: recipe for target `dist/Debug/Cygwin_4.x-Windows/playing_with_c.exe' failed
make[2]: Leaving directory `/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c'
nbproject/Makefile-Debug.mk:60: recipe for target `.build-conf' failed
make[1]: Leaving directory `/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
build/Debug/Cygwin_4.x-Windows/main.o: In function `main':
/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c/main.c:14: multiple definition of `_main'
build/Debug/Cygwin_4.x-Windows/hello world.o:/cygdrive/c/Users/Liam/Documents/NetBeansProjects/playing with c/hello world.c:3: first defined here
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/Cygwin_4.x-Windows/playing_with_c.exe] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 3s)
You have defined the main method in multiple places: main.c:14 and at hello world.c:3.
A program can have only 1 main method.
Either remove one of those files from the project, or remove one of the main method definitions.

Resources