Is there a way to reassign the value of the Makefile variable inside the target body?
What I'm trying to do is add extra flags to compile debugging:
%.erl: %.beam $(ERLC) $(ERLFLAGS) -o ebin $< test: clean debug_compile_flag compile compile_test debug_compile: $(ERLCFLAGS) += -DTEST
So, if I call the test target, I would like to clear the environment, add new flags (for example, -DTEST to existing ones), compile all the code again (first sources, then test modules).
I do not want to copy / paste the code to compile with some new flags, since there is a lot of logic.
Is there an easy way to override the value of a variable so that I can reuse existing code?
makefile target
paulgray Apr 26 '10 at 8:21 2010-04-26 08:21
source share