makefile question

All:

I’m doing some engineering calculations and my program “ugunn” uses a “UDAT” file to output a “UOUT” file. Since these take quite awhile to run, I’d like to queue them up in multiple directories and use “make -j4” to process 4 at a time until a batch of “n” runs (100?) are completed.

I’ve done this before with suffixes and it works well with implicit dependencies, but the explicit doesn’t work too well.

My makefile so far is:

clear out all suffixes

.SUFFIXES:

UGUNN = ~/bin/ugunn

UDATS = ${shell ls -d */UDAT}

UOUTS = $(addsuffix UOUT,$(dir ${shell ls -d */UDAT}))

$(UOUTS): $(UDATS)
echo $(UDATS); echo $<; echo $(dir $<); cd $(dir $<);
$(UGUNN) > /dev/null ;

all: $(UOUTS)

any help or suggestions will be well recieved:'(