The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to make sound using C under UNIX trapeze UNIX for Dummies Questions & Answers 6 12-10-2007 10:14 PM
to make groupings of object using unix command cdfd123 UNIX for Dummies Questions & Answers 1 08-03-2007 12:10 PM
Make a copy of a unix HDD josramon UNIX for Dummies Questions & Answers 0 03-20-2007 07:57 AM
Make file in Unix gandhevinod UNIX Desktop for Dummies Questions & Answers 6 04-20-2005 04:15 PM
How can I make ls -l in HP-UNIX? sangjinn High Level Programming 1 09-24-2001 02:39 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-22-2007
Registered User
 

Join Date: Nov 2007
Posts: 5
Unix Make

I need tutorial on Make utility on Unix.
Any help or link appreciated.

many thanks
Mirko
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-22-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Hi,

Two main things to understand about make...

1. it's all based around dependancies

2. those dependancies all center around the date of a file.

If you have hello.c and want to build it, then create a "Makefile" as follows...

Code:
all: hello

hello.o: hello.c
      $(CC) $(CFLAGS) -c hello.c -o $@

hello: hello.o
      $(CC) $(CFLAGS) hello.o -o $@
The macros CC and CFLAGS are standard macros for your C compiler.

$@ means the target for the rule

So it will say, I want to make "all", so I want to make "hello", that depends on "hello.o" and here are the rules. Ah, I need hello.o first, and there are the rules to make that.

make (software) - Wikipedia, the free encyclopedia
Reply With Quote
  #3 (permalink)  
Old 11-22-2007
drl's Avatar
drl drl is offline
Registered User
 

Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 497
Hi.

Here are two ... cheers, drl

Makefile Howto - Waikato Linux Users Group

Make
Reply With Quote
  #4 (permalink)  
Old 11-23-2007
Registered User
 

Join Date: Nov 2007
Posts: 5
@porter
@dri

many thanks guys.

cheers
Mirko
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0