Makefile?
You can get a list of inputs and a shell script that generates the name of the output file to generate goals, dependencies, and rules using the GNU make functions:
all :
inputs := in1.c in2.txt in3 sub/in1.c
outputs :=
define make_dependency
${1} : ${2}
outputs += ${1}
endef
$(foreach in,${inputs},$(eval $(call make_dependency,$(shell echo ${in}.out),${in})))
${outputs} : % : ${common}
@echo "making $@ from $<"
all : ${outputs}
.PHONY : all
Conclusion:
$ make
making in1.c.out from in1.c
making in2.txt.out from in2.txt
making in3.out from in3
making sub/in1.c.out from sub/in1.c
The above makefile uses little use of the powerful GNU make: construct $(eval $(call ...)). He asks make to expand the macro to create a piece of text, and then evaluate that piece of text as part of the makefile, i.e. Make generates a makefile of flies.
source
share