makefile gcc command cannot be found
Hey Everyone,
The last couple of days i'm have been trying to do some linux kernel module programming. I was trying to compile the first example "hello1". The makefile consist of the following : TARGET := hello-1 WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes INCLUDE := -isystem /lib/modules/`uname -r`/build/include CFLAGS := -O2 -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE} CC := gcc-3.0 ${TARGET}.o: ${TARGET}.c .PHONY: clean clean: rm -rf {TARGET}.o A week ago when i type the command "make" everything went well. I had problems inserting this module with insmod. I decided to change the makefile and compile it again. But now i'm getting error message "gcc command cannot be found ". I updated redhat before I got this error message. I check to to see if the gcc version is the same as in the makefile, which was not the case. I change the line "CC:= gcc-3.0 to gcc-3.2.2" but i'm still getting the same error message. Can someone tell me what i am doing wrong? I have redhat 9.0 |
Is there any reason why you're using a specific version of gcc?
Try leaving it on CC:= gcc |
I tried leaving the 3.0 out but now i getting the following error message " cannot specify -o with -c or -S and multiple compilations"
I'm follwing the examples that are written in the document. http://www.faqs.org/docs/kernel/x204.html |
Are you using the same makefile?
There is no -o in the makefile you posted. |
I'm using the same makefile only the name of the target is different
According to me, the line "${TARGET}.o: ${TARGET}.c" specifies the name of the input and the output file. At the top of the makefile has "TARGET := hello-1". I could be wrong what i just said but reading it i would think that line specifies the -o |
I copy and pasted your makefile, seems to work ok for me.
|
Strange... That it doesn't work with me.. If anyone have suggestions let me know.. i'll continue to solve this mysterious error...
|
It works fine now.. I remember a few weeks ago i compiled it i use gcc command, seeing that it was C-file. Now compiling the hello.c with the makefile. it cause conflict with the old output file, which was still in the directory.
Beginners mistake.. |
All times are GMT -5. The time now is 12:52 PM. |