In my makefile, I need to make a variable assignment based on a command line variable value. for example, I do:
make var_1=xxx
where
FAB = macrofab
# NOTE: base starts at 1 instead of 0
none := 1
seeed := 1
oshpark := 2
macrofab := 2
pcbng := 3
#NOTE: String must end with a space for word function to work
SUFFIX_DRILLS := "txt xln drl "
.PHONY: gerber
gerber:
@echo $(FAB) drill suffix is $(word $($(FAB)), $(SUFFIX_DRILLS))
Output of make is: macrofab drill suffix is xln