[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNU Make 3.79, consolidating dependancy lines

From: Ian Wilson
Subject: GNU Make 3.79, consolidating dependancy lines
Date: Fri, 14 May 2004 17:48:13 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007

(reposted from Comp.Unix.Programmer - apologies to anyone who saw this already)

I'm just getting to grips with Makefiles and have a question about how best to reduce redundancy in the dependancy lines.

I've read my O'Reilly book (a bit dated), skimmed the man pages and Googled a little without much success.

The software is compiled and then the object files are linked. This is a 4GL so the implicit .c .o etc stuff make knows about is not applicable.

I have something like ...
%.obj : %.src
    compile $<

fooprog_objs = foo_main.obj foo_mangle.obj foo_other.obj funky_lib.obj
barprog.objs = bar_part1.obj bar_part2.obj funky_lib.obj wow_lib.obj
bazprog.objs = bazmain.obj bazio.obj
quxprog.objs = qux.obj morequx.obj wow_lib.obj
# I also wish I knew a way to avoid so much ".obj" clutter above

fooprog.prg : ${fooprog.objs}
    link -o $@ ${fooprog.objs}

barprog.prg : ${barprog.objs}
    link -o $@ ${barprog.objs}

bazprog.prg : ${bazprog.objs}
    link -o $@ ${bazprog.objs}

quxprog.prg : ${quxprog.objs}
    link -o $@ ${quxprog.objs}
Lets say the above works.

Is there any way of merging the dependancy & command lines into some meta dependancy expression?
<anything>.prg : ${${<anything>}.objs}
    link -o $@ ${${<anything>}.objs}

Thanks for any clues.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]