I need tutorial on Make utility on Unix.
Any help or link appreciated.
many thanks
Mirko
I need tutorial on Make utility on Unix.
Any help or link appreciated.
many thanks
Mirko
Hi,
Two main things to understand about make...
it's all based around dependancies
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.