LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-07-2012, 12:48 PM   #1
rpittala
Member
 
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102
Blog Entries: 1

Rep: Reputation: Disabled
Question need of makefile info ? how the linux make file is different from simple c makefile ?


Hi Folks,
I am in need of some Makefile information. Actually, I am in little bit confusion after looking at LINUX Makefile and the C application type Makefile. what is the difference between the above Make files and how many types of Makefiles are there?

Having knowledge on application side Makefile`s and looking for application side Makefiles documents as well.

Looking forward to know useful info and some useful URL`s to study

Last edited by rpittala; 05-07-2012 at 01:10 PM. Reason: added some more details
 
Old 05-07-2012, 05:37 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Not quite clear what you mean with :
"LINUX Makefile and the C application type Makefile".

Linux is the kernel, and all kernel files are c programs.
There is a "standard" Makefile for a single kernel module :
Code:
obj-m    := hello.o

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

default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
... And then some links for all other Makefiles, etc.
http://www.gnu.org/software/autoconf/manual/index.html
http://www.gnu.org/software/autoconf/
http://www.gnu.org/software/automake/
http://sourceware.org/autobook/

http://www.freesoftwaremagazine.com/..._gnu_autotools
http://www.freesoftwaremagazine.com/...with_autotools
http://www.freesoftwaremagazine.com/..._with_autoconf

http://www.developingprogrammers.com...ools-tutorial/

http://www.wlug.org.nz/MakefileHowto
http://www.eng.hawaii.edu/Tutor/Make/
http://www.linuxplanet.com/linuxplan...orials/7093/1/
http://www.gnu.org/software/make/manual/make.html
http://www.student.cs.uwaterloo.ca/~isg/res/unix/make/
 
1 members found this post helpful.
Old 05-07-2012, 09:04 PM   #3
rpittala
Member
 
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Yes, I was talking about Linux makefile(kernel modules) as per the above MAkefile code and at the same time the below Makefile code
Code:
CC = gcc
CFLAGS = -Wall -g
OBJECTS = app.o
out.exe :$(OBJECTS)
       $(CC) $(CFLAGS) $(OBJECTS) -o out.exe
app.o : header.h app.c
       $(CC) $(CFLAGS) -c app.c
 
  


Reply


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
make: Warning: Both `makefile' and `Makefile' exist ? malli42108 Solaris / OpenSolaris 5 10-24-2009 10:09 AM
Is it mandatory to have the name of the makefile as 'Makefile' for kernal module comp narender.d Linux - Kernel 3 05-29-2009 07:26 AM
Makefile issue: "Makefile.src: File not found" m3rkury Linux - Software 1 02-22-2007 11:15 PM

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

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