Here's a simple Makefile that uses the concept of multiple targets to create an arbitrary number of executables where the value of the macro EXECUTABLE_NAME is assigned dynamically depending on the name of the executable built:
executables = foo bar baz
all: $(executables)
foo bar baz: prog.c
gcc -DEXECUTABLE_NAME=\"$@\" $< -o $@