Be aware that
configure
generally produces a
Makefile
, so don't use that as your "meta" makefile name. Since this would appear to be a Linux project, you are probably using GNU make, which searches for "GNUmakefile", "makefile" and "Makefile" in that order, so you probably don't want to use those, either.
As far as I know, there's no way to pass option flags to make targets, but GNU make can access global shell variables so you can do something like this:
myMakefile:
CONFOPTS = --prefix=$(HOME)/lib --with-opt-a --with-opt-b
ifdef OPTFOO
CONFOPTS += --foo=$(OPTFOO)
endif
ifdef OPTBAR
CONFOPTS += --bar=$(OPTBAR)
endif
mylib: # as per Ricard, above
./configure $(CONFOPTS)
make
Then you would invoke this as
make -f myMakefile OPTfOO=blah OPTBAR=all