Calling $(eval) within $(eval) can lead to very unintuitive (at least to me
:) behavior. In particular, the inner $(eval) is expanded *and* executed
during the expansion of the outer $(eval). For instance (I've also attached
this example, since my email client mangled the tabs in the code below):
>
> Right. If you don't want those effects, then don't use inner
> $(eval)s! If you leave out the $(eval)s and just reference $(func2)
> and $(func3) inside the definition of func1, those issues don't arise:
>
>
> define func1
> SOME_VALUE := 1
> MY_FUNC1_VAR := $$(SOME_VALUE)
> all::
>
My targets live in a different directory than my source, and so I want to
ensure that the target directory exists before building the target. This
can be accomplished in lots of ways, but one way that I thought of was to
use order-only prerequisites for this (actually, originally I just was using
>
> I don't think this is correct. Your "comment out" example (example2.mk)
> is not accurate. To be accurate, you should comment out ONLY the
> order-only prerequisite part, like this:
>
>$(DERIVED_OBJ_DIR)/test.o: # | $(DERIVED_OBJ_DIR)
>
> Not the entire line. If you do this, you'll s