Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-28-2004, 08:20 AM   #1
Registered: Nov 2004
Location: india
Distribution: Fedora core 1
Posts: 67

Rep: Reputation: 15
Require a Makefile for kernel module programs

I have created 3 modules yesterday where main.c modules uses function exported by exporting_module1.c
Also exporting_module1.c uses function exported by exporting_module2.c?
I am not getting how to write a Makefile for that can anybody help me?
what error i get when write a makefile is that

error: syntax error before "this_object_must_be_defined_as_export_objs_in_the_Makefile"
warning: data definition has no type or storage class

these are the errors that occur because of adding statement EXPORT_SYMBOL(exporting_fun1);
What i try to write a Makefile is
KERNELDIR = /usr/src/linux-2.4.22-1.2115.nptl
CFLAGS = -I$(KERNELDIR)/include -Wall
all: all.o

export-objs =: exporting_module1.o exporting_module2.o
all.o: using_module.o exporting_module1.o exporting_module2.o exporting_module1.h exporting_module2.h
$(LD) -r $^ -o $@
rm -f *.o *~ core

This makefile is not working???
Old 12-28-2004, 11:11 AM   #2
Registered: Jul 2004
Location: Austin, Texas!
Distribution: Gentoo
Posts: 121

Rep: Reputation: 15
Well, first, the this_object_must_be_defined_as_export_objs_in_the_Makefile looks like a comment in the Makefile. Is it commented out? Also, have you ever tried something called automake?


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
[Error] Kernel Module : No kernel module build environment saman007uk Debian 7 09-09-2006 07:34 PM
creating Makefile with multiple kernel module files b123coder Programming 0 12-26-2004 09:41 AM
module makefile for c++ in kernel 2.6 yuhuahe Linux - Software 0 04-14-2004 07:03 PM
external module makefile yuhuahe Linux - Software 0 03-19-2004 06:05 PM
Require Help in kernel programming ranendra_dutta Linux - Networking 0 07-04-2002 08:35 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:19 PM.

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