Ok. This is what I want to do.
I have c++ files under common directory.
Then I have asm/amd32 folder and
asm/amd64 folder and
asm/intel32 folder and asm/intel64 folder.
asm folders contain assembly code versions of those same files undr commond folder.
My makefile should look for asm folders and see if same filename exists there but with asm suffix S. If it does asm-file is used to create object file instead of cpp file.
Also makefile should be able to use only 32-bit asm files for 32-bit compile and 64-bit asm files for 64-bit compile.
If you understood my writings I would thank you for some help.