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

Notices


Reply
  Search this Thread
Old 12-28-2004, 07:20 AM   #1
b123coder
Member
 
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 $@
clean:
rm -f *.o *~ core

This makefile is not working???
 
Old 12-28-2004, 10:11 AM   #2
linuxgeekery
Member
 
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?
 
  


Reply



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 06:34 PM
creating Makefile with multiple kernel module files b123coder Programming 0 12-26-2004 08:41 AM
module makefile for c++ in kernel 2.6 yuhuahe Linux - Software 0 04-14-2004 06:03 PM
external module makefile yuhuahe Linux - Software 0 03-19-2004 05:05 PM
Require Help in kernel programming ranendra_dutta Linux - Networking 0 07-04-2002 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:38 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