This might just be a beginner's problem, but I can't find anything like it in any documentation, so maybe you could help. My code uses system-dependent extensions for files (specifically matlab mex files) I've made it so autoconf determines which extension to use, and I have suffix rules set up. It stores it in the variable MEX_END. I want to be able to use that variable in my 'Makefile.am's to do something like foo_$(MEX_END)_SOURCES = foo.c bar.c .... etc. everything I try ends up producing a message about bad macro names. Is there an easier way? Thanks for any help.