Page 1 of 1

problem with make file and all

Posted: Sun Feb 21, 2010 12:58 pm
by psnix
hi
how can i talk to "make" all sources are in the an address like ../kernel in the "all"?

all: $(SOURCES) link

Re: problem with make file and all

Posted: Sun Feb 21, 2010 3:04 pm
by Selenic
pswin wrote:how can i talk to "make" all sources are in the an address like ../kernel in the "all"?
I'm assuming that by this you mean "How do you tell make to run the makefile in another directory"

In that case, you just use the -C option to make (if running it from the command line) or do a 'recursive make', where one of the lines is "$(MAKE) -C [directory]" ($(MAKE) is always set to the exact make you're using, even if it's not standard make)

On the other hand, recursive make is considered harmful - basically, it tends to make it more complicated to maintain, causes unnecessary rebuilds and makes parallel builds more difficult (a legitimate example is binutils: each tool within it is built separately by a recursive make. It then does autoconf and another three or four levels of recursive make for *each* tool. Ow ow ow)

Re: problem with make file and all

Posted: Sun Feb 21, 2010 5:13 pm
by Hangin10
If you want to collect a list of all the source files in a directory, there is a makefile tutorial on the wiki that covers this (and more too! :) ).

Re: problem with make file and all

Posted: Mon Feb 22, 2010 4:01 am
by Solar
...and it is found here: Makefile