Page 1 of 1

Makefile issue

Posted: Sat Sep 13, 2008 2:46 am
by neonek
Hello ! I'm new to this board so hello all !
I've got a problem. I wrote makefile for my OS but it won't work. I had tested simple makefile:

Code: Select all

all:
	@echo Hello
It works but this makefile won't work:

Code: Select all

all:
	hello
hello:
	@echo Hello
I've got no idea why it won't work. Please help me.

Re: Makefile issue

Posted: Sat Sep 13, 2008 2:59 am
by cr2
What isn't working?

Re: Makefile issue

Posted: Sat Sep 13, 2008 3:06 am
by xyzzy
Target dependencies must be on the same line as the target name (or on separate lines separated with a backslash). Try this:

Code: Select all

all: hello

hello:
	@echo Hello
Or this:

Code: Select all

all: \
	hello

hello:
	@echo Hello

Re: Makefile issue

Posted: Sat Sep 13, 2008 3:10 am
by neonek
Thanks, AlexExtreme. My mistake.