Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I think you can just add the CFLAGS variable into the Makefile, like this:
Code:
CFLAGS+= -O2
file:
${CC} ${CFLAGS} file.c -o file
Then, if you assign cflags in the environment, it will append the -O2 (for example) to whatever the environment defines. I've done it with some pretty simple makefiles. CFLAGS is just an environment variable, so just add it into the compile line(s).
The problem is that I don't just need to add flags to simple makefile. I have a makefile generated by configure for ready made driver. And it's so complicated for me. I can't figure out who goes where. but i only need to pass that argument for every compilation line. Which I don't even find. :s
I haven't tried that myself, but there should be a Makefile.in which configure uses as a template for the Makefile. In that file, there should be a line which starts with "COMPILE = $(CC)". I've checked 2 makefiles on separate programs and they both have it. You should be able to add $(CFLAGS) to the end of that line. There is a "proper" way, but this might work.
Makefiles are stamdardised, else the interpretter wouldn't be able to read them. grep your Makefile for CFLAGS. If it doesn't show a single response, then you're stuck, if it does, ass
Well. I have done that. and seems it's working. But I still have a problem. I am trying to compile kernel module for i486sx processor with kernel 2.6.24
The development system is Ubuntu 8.04 with 2.6.16 kernel
After throwing the compiled module on the target I am getting this error:
Quote:
insmod: cannot insert '/vntwusb.ko': invalid module format
That's the output of dmesg
Quote:
vntwusb: version magic '2.6.24-16-generic SMP mod_unload 586 ' should be '2.6.24 mod_unload 486
So is it only a kernel version problem or does the 586 and 486 also means different architectures??
And if it's a kernel version problem. Is there a way to link to that specific kernel version??
Thanks all in advance. I will keep searching. And I will update here if i found anything. I am really stucked on this one cause we purchased the wifi module for the pc/104 and I need to get it working...
ahhh btw they weren't using the CFLAGS but found them using a different variable called EXTRA_CFLAGS and that's the one I have appended the -march=i486 to.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.