How to define dynamic Target/Prerequisite in Makefile?

I am writing a Makefile for Cobol on Linux.My sample Makefile looks like below.
I do not want to Hardcode Program names in Makefile.Is there any way we can mention directories in Target and Prerequisites instead of File names sothat Makefile Pickup all the files in mentioned path as below.

#Path Variables
targetpath=/home/usr/user1/target
sourcepath=/home/usr/user1/source
#Target &Dependencies
all:$(targetpath)/$(sourcename).int
#Implicit Rule for compilation
$(targetpath)/%.int:$(sourcepath)/%.cbl
        cob $<  -C int=$@

================================
currently I am using following command which I can trigger thru Shell script.
-bash-3.2$ make sourcename=A
-bash-3.2$ make sourcename=B
-bash-3.2$ make sourcename=C
-bash-3.2$ make sourcename=D
looking forward for inputs on this.
Note .cbl is a extension for cobol code and .int is its exectable

Wildcards ought to work to match more than one thing in one statement, but you'd have to be careful not to get multiple targets in one rule unless that one rule can actually make all those targets.

Any more thoughts on how to achieve this??

Can you show us your makefile ( or what you have done so far) so we get a clear view of what you desire? What is the makefile for? ( compile cobol source or compile cobol compiler...) What cobol are you using?

Hi Vbe I have already posted a Makefile while starting this Post.This Makefile is to compile a cobol source.cobol under consideration is Microfocus cobol.However you can assume any standard syntax of any source as below
************************************
all:Target
Target file name:Source file name
<tab> command for compilation of source
************************************
Here am looking if it is possible to that Makefile refer to a directory which has unkonown number of files and create dependency for all based on predefined rules.eg.I have directory /home/usr/usr1 which has lets say thousan source codes.I hope this explains the scenarion.Please suggests if it is posssible this way??

And how are these thousands of source files supposed to be compiled? Individually? Separately? Compiled individually and linked as one? Or what?

These are to be compiled individually and not to be linked. A.cbl gets compiled to A.int and can be directly executed independent of other executables.

This is one of these really easy things that's made ridiculously hard because make does all substitutions backwards. Have VAR1=a/.in, and VAR2=$(VAR1:.in=.out), and it will happily substitute a/.out for a/*.in, find no files matching *.out, and become an empty string. I had to force it with $(subst) and $(wildcard).

all:dira dirb
# a/1.in, a.2.in, ... a/10.in becomes targets a/1.out, ...
dira:$(subst .in,.out,$(wildcard a/*.in))
dirb:$(subst .in,.out,$(wildcard b/*.in))

%.out:%.in
        touch $@

Granted this isn't dynamic targets but dynamic sources, but this is at least a step toward it.

$(subst) and $(wildcard) solved my Problem.Thanks a lot for the input.