Это сделает это. Это можно сделать более элегантно, если есть больше ограничений, которые вы можете наложить на варианты.
COMP = compiler
OBJECTS = file1 \
file2 \
file3 \
file4 \
file5 \
file6 \
file7 \
file8 \
file9 \
file10
# This isn't terribly elegant, but it is quite general.
# If the variations you have in mind are more regular, such as
# changing only file5 and file9 for all executables, then there
# are tidier ways to do it.
OBJECTS1 := $(OBJECTS)
OBJECTS1 := $(patsubst file5,file5_s1,$(OBJECTS1))
OBJECTS1 := $(patsubst file9,file9_s1,$(OBJECTS1))
OBJECTS2 := $(OBJECTS)
OBJECTS2 := $(patsubst file5,file5_s2,$(OBJECTS2))
OBJECTS2 := $(patsubst file9,file9_s2,$(OBJECTS2))
all: bin/executable_s1 bin/executable_s2
# It looks a little clumsy to include the path in the target,
# but the idea is that the target should be what it's actually making,
# which is bin/executable_s1, not executable_s1.
bin/executable_s1: $(OBJECTS1)
bin/executable_s2: $(OBJECTS2)
bin/executable_%:
$(COMP) $^ -o $@