Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Makefile missing for .c file. How to create

0 views
Skip to first unread message

asdf

unread,
Apr 15, 2009, 6:11:03 PM4/15/09
to
I have a forcedeth.c (ver 0.62) code that i need to compile against a
running kernel, and there are no rpms that i know for my distro(centos 5.3)
Usually there is a Makefile in the directory but not this time, there is
only forcedeth.c file. I'm not sure how to creat a makefile so that i could
do ./configure;make;make install

thanks in advance for help.

The Natural Philosopher

unread,
Apr 15, 2009, 8:26:00 PM4/15/09
to
I found this on google

"I've been able to update to the latest forcedeth 0.60 in the following
way I'm going to describe.

Before all:
-I'm using kernel 2.6.15-27-amd64-k8, so change version numbers
accordingly to yours;

1)Download latest nvidia nforce package
2)For Dapper, I suggest you using forcedeth.c file contained under
Fedora5 folder of the downloaded package
3)Install build-essential plus linux-headers-2.6.15-27-amd64-k8
4)Copy forcedeth.c into some folder, e.g. /home/willytp/forcedeth
5)Into this folder, make a file called "Makefile" containing the
following line:
obj-m := forcedeth.o
6)Into this folder, execute the following command:
make -C /usr/src/linux-headers-2.6.15-27-amd64-k8/ SUBDIRS=$PWD modules
7)Copy the just created forcedeth.ko module into
/lib/modules/2.6.15-27-amd64-k8/kernel/drivers/net/
overwriting the old one
8)Execute this command: sudo depmod -a
9)Make a new initrd image: go into /boot/ folder, locate your initrd
image, save it name, delete the file, and execute the following command:
mkinitramfs -o initrd.img-2.6.15-27-amd64-k8
10)Cross fingers and reboot ;)
"

Unruh

unread,
Apr 15, 2009, 8:42:05 PM4/15/09
to
asdf <as...@adsf.com> writes:

Well you could create a makefile, or you could just do
gcc forcedeth.c -o forcedeth
and compile it directly. (That is presumably all the makefile would do.)
Once you knowit works,
cp forcedeth /usr/local/bin
chmos a+rx /usr/local/bin/forcedeth
(assuming you want anyone to be able to run it)

The Natural Philosopher

unread,
Apr 15, 2009, 8:49:44 PM4/15/09
to
forcedeth is a loadable object module.

Its is not a an executable by itself.

Azeem

unread,
Apr 16, 2009, 12:27:02 AM4/16/09
to
I assume this is a device driver for NVIDIA NIC card? If so, it is
going to be a little difficult since this is a kernel module and not a
normal userspace program. I have never compiled a device driver not
supported by the OS but perhaps if you download the e1000 driver from
sourceforge, you can look at their Makefile on how to compile a device
driver. Once its compiled, its as simple as typing insmod forcedeth as
root to load it. I think you can get lots of information from here
aboI assume this is a device driver for NVIDIA NIC card? If so, it is
going to be a little difficult since this is a kernel module and not a
normal userspace program. I have never compiled a device driver not
supported by the OS but perhaps if you download the e1000 driver from
sourceforge, you can look at their Makefile on how to compile a device
driver. Once its compiled, its as simple as typing insmod forcedeth as
root to load it. I think you can get lots of information from here
about compiling device drivers:

http://lwn.net/Kernel/LDD3/

Sorry I cannot be a better help.:

Azeem

Micko

unread,
Apr 16, 2009, 12:05:58 PM4/16/09
to
> Usually there is a Makefile in the directory but not this time, there is
> only forcedeth.c file. I'm not sure how to creat a makefile so that i
> could

I think that
gcc forcedeth.c -o forcedeth
is enough..

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4014 (20090416) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


Thomas Richter

unread,
Apr 16, 2009, 5:23:16 PM4/16/09
to

It's usually not that easy. The source must fit to the kernel you use as
details in the interface changes from version to version. I would
rather suggest to pull the sources from a new kernel from www.kernel.org
and re-compile that for your needs, including the forcedeth driver in
the configuration.

So long,
Thomas

Bob Tennent

unread,
Apr 16, 2009, 5:32:03 PM4/16/09
to

If the code is in the source tree for the CentOS kernel, you should get
the relevant src.rpm, edit the config, and build a binary rpm for the
whole kernel. It is also possible to compile just a module but it's
rather more complicated.

Bob T.

Joe Beanfish

unread,
Apr 17, 2009, 1:36:33 PM4/17/09
to

If the project only contains the one c file then you probably don't
need such a complicated build. Just compile it after viewing it to
see if there are comments at the top describing how to build.

cc -o forcedeth forcedeth.c

Maxwell Lol

unread,
Apr 17, 2009, 9:38:33 PM4/17/09
to
Joe Beanfish <j...@nospam.duh> writes:

> If the project only contains the one c file then you probably don't
> need such a complicated build. Just compile it after viewing it to
> see if there are comments at the top describing how to build.
>
> cc -o forcedeth forcedeth.c

if that's the case, just type
make forcedeth

MC Dooligan

unread,
Apr 25, 2009, 9:51:33 PM4/25/09
to

Sounds like trouble. You're gonna need to do a lot of doc reading;)

Peace and Cheer

0 new messages