[fpc-pascal] Add assembler source file to fpmake package?

christo christo.crause at gmail.com
Mon Oct 15 18:22:27 CEST 2018

I'm trying to build a fpmake project for the RTL.  One problem I'm 
struggling with is how to add an assembler file to the package and 
assign a custom command to be executed instead of calling the compiler.  
I've tried the following, which does call "as" but then it follows with 
an error because the compiler gets called with the assembler file which 
then generates an error:

   T := TTarget(P.Targets.Add);
   T.Name := 'linux/'+CPUToString(Defaults.CPU)+'/prt0.as';
   T.CPUs := [x86_64];
   T.OSes := [linux];
   T.Commands.AddCommand('as', '--64 -o ' + 'prt0.o ' + 
'linux/'+CPUToString(Defaults.CPU)+'/prt0.as', 'prt0.o', 'prt0.as');

Looking at the various methods of TTarget (addUnit, addFPDoc, 
addProgram, addImplicitUnit) seems to suggest that functionality for 
adding a generic file and calling an external custom command is lacking.

Any ideas or suggestions on how to get this case working?

More information about the fpc-pascal mailing list