LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 04-15-2009, 04:05 PM   #1
pgb205
Member
 
Registered: Nov 2007
Posts: 129

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, 03:58 AM   #2
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

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

obj-m += $(OBJS)

EXTRA_CFLAGS = -O2


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

clean:
        $(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, 03:25 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
This is the forcedeth Makefile, I found here
http://www.nvnews.net/vbulletin/showthread.php?t=96453
Code:
obj-m := forcedeth.o

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

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


Reply

Tags
create, makefile



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 10:00 AM
missing makefile and configure syseeker Linux - Software 4 04-04-2006 09:08 AM
Linux shell command for makefile.in to create a text file and write to it alix123 Programming 8 01-07-2005 08:18 AM
How to create a Kernel 2.6 Makefile 7.e.Q Programming 1 11-03-2004 07:47 AM
Create my own configure and Makefile Ephracis Linux - Software 1 10-11-2004 08:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:43 AM.

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