[SOLVED] Why is my assignment operation not working in GNU make files?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
@TB0ne, When I am able to reproduce the problem with a simple make file. Why do you need an actual make file?
Either answer questions and provide details or don't...if you don't, there's NOTHING we can help you with. AGAIN:
You have *TEN YEARS* experience with this so far.
You WILL NOT answer questions (command(s) you've used? Exact messages??)
You mention both Solaris and RHEL...the makefile syntax is different as you well know.
Want help??? Then answer the questions asked, and provide the makefile. Otherwise, figure it out yourself, because we can't help you until you actually give us answers.
@TB0ne, When I am able to reproduce the problem with a simple make file. Why do you need an actual make file?
The makefile works in a quite unusual way, not like a script or progrmming language. Therefore posting only one line of a makefile is completely pointless.
From the other hand I think a line like this:
is either incorrect or just not copied properly.
I guess the fist := should be a : (without =), but this is only a wild guess and probably won't solve anything. Without knowing the other parts of the makefile hard to say anything.
You may try to use the -p flag too (if you wish)
Code:
# instead of
make all <some args>
# add a -p:
make all <some args> -p
The makefile works in a quite unusual way, not like a script or progrmming language. Therefore posting only one line of a makefile is completely pointless.
From the other hand I think a line like this:
is either incorrect or just not copied properly.
I guess the fist := should be a : (without =), but this is only a wild guess and probably won't solve anything. Without knowing the other parts of the makefile hard to say anything.
You may try to use the -p flag too (if you wish)
Code:
# instead of
make all <some args>
# add a -p:
make all <some args> -p
Agreed; but someone with a decade of experience with makefiles (such as the OP) should be well aware of how they work.
I do need you to understand that solaris and RHEL are NOT THE SAME!
The compiler is different, the pre-compiler is different, the make syntax is different, the header files may be different, etc.
This is not an error in the OS used, or in the Makefile. This is an error in understanding by the user who cannot visualize that different OSes are in fact different in many ways under the hood.
Why are the results different you ask? Because you are working on a different OS. Plain and simple.
If you want the same results on 2 different machines they must have almost all the relevant software identical on each.
@TBone It actually worked for me when I placed : (without =) at the starting and the problem I came across was that when I used the same operation (i.e., with :=)on GNU make version on Solaris 3.81 it worked without any problem.
@TBone It actually worked for me when I placed : (without =) at the starting and the problem I came across was that when I used the same operation (i.e., with :=)on GNU make version on Solaris 3.81 it worked without any problem.
Those who have scolded me, Calm Yourself. Thanks to those who suggested solutions with limited code.
So when you read the error message and modified things, it actually worked??? Good to know. Again, you telling us this is absolutely meaningless, since no one here (or anyone who comes across this thread) will know the CONTEXT OF WHAT YOU DID OR WHY. Again, you've had TEN YEARS of working with things like this, and have been asked repeatedly to post information, but don't.
Again: no one here can tell why what you did worked, since you've given no one any details.
Actually @TBOne, he did say what worked, (though you have to read between the lines to know what distro and version).
He said that replacing the ":=" with ":" worked, while the ":=" worked on Solaris 3.81. He seems to imply that the change was required for solaris 3.82 but does not clearly say that.
I went back over the thread and in post #10 he clearly states it was failing for RHEL 7.9. His final post obfuscates that by blathering on about different versions of solaris.
Last edited by computersavvy; 08-09-2022 at 08:14 PM.
All I wanted from the above example was the status of variable when it is updated : suppose to print "-tPPCE200Z7NEF -WDDFP=G"
what else you guys were expecting with GNU make ? @computersavvy open your eyes now and see
since the value of the variable (not status) may depend on the target you build that echo can only print the actual value of it and not the value used during the compilation (which can be the same but also can be different).
So would be nice to learn how does it really work and understand (open your eyes now and see).
All I wanted from the above example was the status of variable when it is updated : suppose to print "-tPPCE200Z7NEF -WDDFP=G" what else you guys were expecting with GNU make ? @computersavvy open your eyes now and see
Seriously??? How many threads (including this one) have you been asked to provide information in??? Two pages now...you STILL don't provide the full makefile, despite being asked numerous times. Saying "I placed : (without =)" is pointless. No one coming across this thread is going to know WHY you did that, what you were trying to do, etc.
AGAIN: you have been working with makefiles for *TEN YEARS*, and asking about Clearmake/Solaris/RHEL during that time, yet don't seem to 'open your eyes' to getting told to provide full details, that Solaris is NOT the same as RHEL, and that makefiles between the two are actually going to require WORK from you to function.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.