Unix Make

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

many thanks
Mirko

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...

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

Hi.

Here are two ... cheers, drl

Makefile Howto - Waikato Linux Users Group

Make

@porter
@dri

many thanks guys.

cheers
Mirko