LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-09-2003, 12:31 PM   #1
Jo_Nak
LQ Newbie
 
Registered: Jun 2003
Posts: 20

Rep: Reputation: 0
necessity of makefiles


Hi,

I was wondering if you always have to wrtie a makefile to compile and run a program or if there is a way of autogenerating them. If so, how?

Thanks a lot,
Jo_Nak
 
Old 06-09-2003, 12:58 PM   #2
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
If you just have a bunch of C source files, that needs a stupidly simple makefile, you could use a makefile generator such as genmake .

If you want to make decisions based on platform, header or library availability on the target machine ( like an installer does ) the you should read one of the makefile howto and/or rip apart a simple application that uses the configure scripts.
 
Old 06-09-2003, 01:49 PM   #3
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Rep: Reputation: 32
Well, it depends, i guess. If you wanna just compile one file you can use:
Code:
g++ -o progname progname.cpp
If you're gonna be the only one using the program I wouldn't bother writing a makefile unless it's a real pain to compile and link everything manually, but if you're gonna be distributing your program for other people to compile then you should use a makefile if it's more than one or two source files, since not everyone will know how you want it to be compiled (that's what the makefile is for).
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
makefiles wmoti Programming 5 09-21-2005 04:26 AM
Necessity of initrd in building a kernel? Erik_the_Red Linux - Newbie 3 08-13-2005 09:53 PM
Necessity of OSS+ALSA, and Program conflictions Synesthesia Linux - General 1 05-21-2005 12:09 PM
Those makefiles... boku Programming 10 03-01-2005 09:19 AM
how many cd is necessity for mandrake 10.0 to install mfeyzifar Mandriva 6 05-09-2004 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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