Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-15-2009, 05:05 PM   #1
Registered: Nov 2007
Posts: 124

Rep: Reputation: 15
Makefile missing for .c file. How to create

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.
Old 04-16-2009, 04:58 AM   #2
Senior Member
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,533

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
The most basic Makefile would perhaps look something like (note, this is a home-made Makefile):
SRCS   = forcedeth.c
OBJS   = $(SRCS:.c=.o)

obj-m += $(OBJS)


        $(MAKE) -C /lib/modules/`uname -r`/build M=$(PWD) modules

        $(MAKE) -C /lib/modules/`uname -r`/build M=$(PWD) clean
        $(RM) Module.markers modules.order
However, since I do not know anything about 'forcedeth.c' nor any dependencies it may have with other modules, I doubt this Makefile will work, but nevertheless, you may want to give it a try.

Btw, I am surprised that your kernel does not offer the forcedeth driver, since it appears that many modern Linux distros offer it with their kernels. Is it possible that your kernel has the source for 'forcedeth.c', but that it is not being built because of your kernel configuration? It would verify this first before proceeding down another path.
Old 04-18-2009, 04:25 AM   #3
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,738

Rep: Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318
This is the forcedeth Makefile, I found here
obj-m := forcedeth.o

KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
So it seems rather simple to do, no dependencies mentioned ?


create, makefile

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
any tool that will create Makefile b123coder Programming 4 04-06-2006 11:00 AM
missing makefile and configure syseeker Linux - Software 4 04-04-2006 10:08 AM
Linux shell command for to create a text file and write to it alix123 Programming 8 01-07-2005 09:18 AM
How to create a Kernel 2.6 Makefile 7.e.Q Programming 1 11-03-2004 08:47 AM
Create my own configure and Makefile Ephracis Linux - Software 1 10-11-2004 09:00 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration