Click to See Complete Forum and Search --> : How do you compile a module with gcc?


armando86
12-17-2000, 12:56 AM
I'd like to how to compile a module with gcc.The module doesn't come with a makefile or anything is's just a raw .c file, I know I can do this with gcc but i don't know the flags. Any help would be greatly apprecaited.

------------------
majorpayne201@yahoo.com
"In a world without walls who needs windows?"

PLBlaze
12-17-2000, 03:08 PM
Compiling module is the same way as compiling kernel,just invoke make modules in /usr/src/linux and you'll see the proper way with all the flags for your system copy that command and proceed to compile your module.

Eg. gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686 -DMODULE -c ip_wccp.c

This is what it looks on mine.Hope this helps.

armando86
12-17-2000, 11:34 PM
Thank you! I'll give it a shot.

------------------
majorpayne201@yahoo.com
"In a world without walls who needs windows?"