I work with a Makefile generated by an external tool (Netbeans), where I can not change the logic of the main target, but I am able to \"inject\" logic in a target that is execu
Just expanding a bit on @Ken's excellent response. You can also do this:
ifeq ("test", "test")
postinstall:
@echo "test = test"
else
postinstall:
@echo "test != test"
endif
You can have the all target do nothing if a variable is not set:
ifeq ($(SOME_VAR),)
$(info SOME_VAR not set!)
all:
else
all: target1 target2 targetetc
endif