Solved Illegal variable name while doing "make -j $(sysctl -n hw.ncpu)"

Hello to everyone.

When I do a make -j $(sysctl -n hw.ncpu) inside the directory where the Makefile file is (you can see its content below) I get this error message Illegal variable name. Can someone help me to fix it, please? Thanks.

Code:
SRC_PATH?=/usr/src

DEBUG_FLAGS+=-g3

MAKE_ENV+=DEBUG_FLAGS="${DEBUG_FLAGS}"

DO_MAKE?=${MAKE_ENV} make

build: bhyve bhyvectl bhyveload libvmmapi vmm

include:
    ${DO_MAKE} -C "${SRC_PATH}/$@" -j "${.MAKE.JOBS}" clean
    ${DO_MAKE} -C "${SRC_PATH}/$@" -j "${.MAKE.JOBS}"
    ${DO_MAKE} -C "${SRC_PATH}/$@" -j "${.MAKE.JOBS}" install

bhyve bhyvectl bhyveload: libvmmapi
    ${DO_MAKE} -C "${SRC_PATH}/usr.sbin/$@" -j "${.MAKE.JOBS}" clean
    ${DO_MAKE} -C "${SRC_PATH}/usr.sbin/$@" -j "${.MAKE.JOBS}"
    ${DO_MAKE} -C "${SRC_PATH}/usr.sbin/$@" -j "${.MAKE.JOBS}" install

libvmmapi: include
    ${DO_MAKE} -C "${SRC_PATH}/lib/$@" -j "${.MAKE.JOBS}" clean
    ${DO_MAKE} -C "${SRC_PATH}/lib/$@" -j "${.MAKE.JOBS}"
    ${DO_MAKE} -C "${SRC_PATH}/lib/$@" -j "${.MAKE.JOBS}" install

vmm: libvmmapi
    mkdir -p /usr/lib/debug/boot/modules
    cp /boot/modules/$@.ko /boot/modules/$@.ko.bak || true
    ${DO_MAKE} -C "${SRC_PATH}/sys/modules/$@" -j "${.MAKE.JOBS}" clean
    ${DO_MAKE} -C "${SRC_PATH}/sys/modules/$@" -j "${.MAKE.JOBS}"
    ${DO_MAKE} -C "${SRC_PATH}/sys/modules/$@" -j "${.MAKE.JOBS}" install
    mv /boot/kernel/$@.ko /boot/kernel/$@.ko.bak || true

.PHONY: build include bhyve bhyvectl bhyveload libvvmapi vmm
 
I don't understand anything if you propose to me to read the man pages. Can you elaborate more ? I have only understood to use this character `,but I don't understand how.
 
Use make -j `sysctl -n hw.ncpu` if you're using csh(1)/tcsh(1). The C shells don't understand the $(....) notation (it's Bourne shell syntax; sh(1), bash(1), etc) and will treat it as a variable. And () are illegal characters in a variable's name. Hence the error Illegal variable name
 
ok. thanks.

# make -j `sysctl -n hw.ncpu`

Code:
make: "/usr/home/marietto/Downloads/Makefile" line 20: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 22: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 24: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 29: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 31: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 33: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 38: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 40: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 42: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 47: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 49: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 51: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 53: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 55: Invalid line type
make: "/usr/home/marietto/Downloads/Makefile" line 57: Invalid line type
make: Fatal errors encountered -- cannot continue
 
Are you still there ?
You do understand I actually have a $DAYJOB that requires my attention? I post something here IF and WHEN I have time for it. This is a forum, not a chat room.

And no, I don't know the answer. But some of my extremely limited experience with make(1) and a Makefile tells me it's probably due to indentation (i.e. spaces/tabs).
 
the indented commands have to start with a <TAB> not multiple spaces
Code:
bhyve bhyvectl bhyveload: libvmmapi
[TAB-HERE]${DO_MAKE} -C "${SRC_PATH}/usr.sbin/$@" -j "${.MAKE.JOBS}" clean
[TAB-HERE]${DO_MAKE} -C "${SRC_PATH}/usr.sbin/$@" -j "${.MAKE.JOBS}"
[TAB-HERE]${DO_MAKE} -C "${SRC_PATH}/usr.sbin/$@" -j "${.MAKE.JOBS}" install
 
the indented commands have to start with a <TAB> not multiple spaces
Code:
bhyve bhyvectl bhyveload: libvmmapi
[TAB-HERE]${DO_MAKE} -C "${SRC_PATH}/usr.sbin/$@" -j "${.MAKE.JOBS}" clean
[TAB-HERE]${DO_MAKE} -C "${SRC_PATH}/usr.sbin/$@" -j "${.MAKE.JOBS}"
[TAB-HERE]${DO_MAKE} -C "${SRC_PATH}/usr.sbin/$@" -j "${.MAKE.JOBS}" install

Bingo. thanks.
 
You do understand I actually have a $DAYJOB that requires my attention? I post something here IF and WHEN I have time for it. This is a forum, not a chat room.

You can't frustrate enthusiasm,curiosity and hunger for knowledge like this. They are sacred values. So,please,don't reply so irritated,thanks.
 
I don't understand anything if you propose to me to read the man pages.

Why not, Mario?

You seem quite able to read.

People make allowances for newbies, but will refer you to manuals more often until you leave the nest to fly.

After 1800+ posts, you're hardly a newbie anymore.

Please try easing the load on busy people by doing some of your own research.

Can you elaborate more ? I have only understood to use this character `,but I don't understand how.

Hint: in sh and csh it's not called backtick, but back quote, backquote or even backward quote, so you can search ('/' command in more or less) for those.
 
You do understand I actually have a $DAYJOB that requires my attention? I post something here IF and WHEN I have time for it. This is a forum, not a chat room..

You can't frustrate enthusiasm,curiosity and hunger for knowledge like this. They are sacred values. So,please,don't reply so irritated,thanks.

You have got to be fscking kidding, Signor Sacred.

Count yourself blessed each time he bothers replying.
 
Why not, Mario?

You seem quite able to read.

People make allowances for newbies, but will refer you to manuals more often until you leave the nest to fly.

After 1800+ posts, you're hardly a newbie anymore.

Please try easing the load on busy people by doing some of your own research.



Hint: in sh and csh it's not called backtick, but back quote, backquote or even backward quote, so you can search ('/' command in more or less) for those.

I'm able to read,yes. But to be able to read does not mean automatically to be able to understand. When I use the man pages I'm more confused than helped. That form of compact list of commands to issue without to know in which context, it's for me pretty unuseful. They haven't been written having a newbie in mind. At least partially,it is a subjective matter and above all, it depends about how our mind prefers to process data. The form in which data are exposed is an important element that our mind uses to find it's method and resources to process these data. And it's not a matter of will, but of affinity between the way information is exposed and the mindset ability to absorb or not what it reads. I find the handbook easier than the man pages. But there are people who likes more than me to wallow into the complexity :D. I love the complexity at a medium level. If I'm overhelmed by a lot of technical and unknown words,I leave. I'm looking for webpages and focused mini tutorials where are explained user cases,examples so that I can understand which kind of relations there are between the tools and the arguments used.

---> After 1800+ posts, you're hardly a newbie anymore.

ohh I would like to help someone,really. But that time is not came yet.

--->Please try easing the load on busy people by doing some of your own research.

how can you know that I don't do my own research before and/or while I'm asking ?
 
You have got to be fscking kidding, Signor Sacred.

Count yourself blessed each time he bothers replying.

very thanks brothers for all the help you gave me until now. Maybe one day we will meet and we will drink a beer together talking and laughing.
 
Back
Top