How to perform a logical AND in makefile. if I run make test It works as expected
it gives the output Both PARAMETERS are required. If one of the parameter is missing It should still give the same output but its not working that way for example if I run make test PARAM1=abc it should output Both PARAMETERS are required.How can I mandate both the parameters.
%/test:
ifeq ($(PARAM1)$(PARAM2),)
@echo "Both PARAMETERS are required"
@exit 1
endif
@echo "Do Something $(PARAM1) $(PARAM2)"
I have tried the below code and it gives the error *** missing separator. Stop. I am not familiar with makefile any help is appreciated.
%/test:
@# $(or $(and $(PARAME1),$(PARAM2)),$(error Both PARAMETERS must be set))
@>&2 echo "Do Something $(PARAM1),$(PARAME2)"