On 2020-06-15 16:53, Budi wrote:
How can we have make's 'include' command in makefile not to precede
the first/default target in the actual processes?
I found it always processed the earliest, how to solve this?

E.g. in Vi type "dd" on the include line, move the cursor somewhere
below the first target/rule, then paste with "p". :)

include directives can appear anywhere in the Makefile (except, of course,
in the middle of syntax that would break due to their presence).

A rule can refer to variables that are defined later, possibly via
inclusion:

$ cat Makefile
.PHONY: foo
foo: $(OBJS)
        echo update $(OBJS)

OBJS = a b c   # this could come from an include!

$ make
echo update a b c
update a b c


Reply via email to