[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: One target, multiple possible source types
From: |
Paul D. Smith |
Subject: |
Re: One target, multiple possible source types |
Date: |
Fri, 2 Apr 2004 09:02:23 -0500 |
%% "Nathan Royer" <address@hidden> writes:
nr> I'm sure there is some way to not have to make one rule for every
nr> translation into an object that has the exact same commands, but I
nr> cannot seem to find it in the documentation and all the syntax that I've
nr> tried does not seem to work.
nr> For example I would like to create object files from assembly files that
nr> have one of many suffix's such as .asm .s .s55 etc. What I am currently
nr> doing is the following:
nr> %.obj: %.asm
nr> $(object_from_asm_command)
nr> %obj: %.s
nr> $(object_from_asm_command)
nr> %obj: %.s55
nr> $(object_from_asm_command)
There is no better way to do this, really.
If you have a lot of suffixes, and/or they change often, and you have
GNU make 3.80 or better, then you could do it with $(eval ...) inside a
loop. But the above is easier to read and understand.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist