I want to be able to build my project with both the ARM ADS and GNU tools. This is relatively easy for the C files, however, it is proving very difficult (actually impossible) to do this for assembly files. Anyone know of a clever trick (pre-processor?) that allows me to maintain a single assembly source file and assemble it with either GNU GAS or ADS ?
TIA, HG
Didn't find your answer? Ask the community — no account required.
Obviously you'll have to extend it to cover GAS keywords that weren't in the code I was assembling. Just pipe the GAS file through the perl to get ADS compatible code...
#define LONG DCD #endif #if COMPILER == GNU .macro SC_FUNC32 name .code 32 .type \name,function \name: .endm
#define LONG .long #endif
Inside the source I only use macros for things that are specific to an assembler.
Two produce the actual files I'll pre-process the original source gcc -E -DCOMPILER=1 source.S >source_ads.s or gcc -E -DCOMPILER=2 source.S >source_gnu.S
Net effect: Comments are stripped if written as C comments.
After the above state you might use a simple C program or perl script to remove empty lines.
42Bastian
Do not email to bastian42@yahoo.com, it's a spam-only account :-)
Use @epost.de instead !
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.