Discussion:
[fpc-pascal] Add assembler source file to fpmake package?
christo
2018-10-15 16:22:27 UTC
Permalink
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?

_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pas
Sven Barth via fpc-pascal
2018-10-15 18:07:40 UTC
Permalink
Post by christo
I'm trying to build a fpmake project for the RTL.
Are you aware that the RTL already has a fpmake project? It might not be
entirely up to date, but it exists.

Regards,
Sven
christo
2018-10-15 19:41:02 UTC
Permalink
Post by christo
I'm trying to build a fpmake project for the RTL.
Are you aware that the RTL already has a fpmake project? It might not
be entirely up to date, but it exists.
I somehow did not notice the existing fpmake before, it seems impossible
to miss now! Anyway, seems like some more work is still required to make
the existing fpmake usable.  It also doesn't have support for assembling
assembler source files, so my original question remains.
Sven Barth via fpc-pascal
2018-10-15 21:56:01 UTC
Permalink
Post by Sven Barth via fpc-pascal
Post by christo
I'm trying to build a fpmake project for the RTL.
Are you aware that the RTL already has a fpmake project? It might not be
entirely up to date, but it exists.
I somehow did not notice the existing fpmake before, it seems impossible
to miss now! Anyway, seems like some more work is still required to make
the existing fpmake usable. It also doesn't have support for assembling
assembler source files, so my original question remains.
Did you look at the rtl/linux/fpmake.inc file? It adds the loaders there.
Though I have not tested it and don't know if it works.

Regards,
Sven
christo
2018-10-16 05:22:26 UTC
Permalink
Post by christo
Post by christo
I'm trying to build a fpmake project for the RTL.
Are you aware that the RTL already has a fpmake project? It might
not be entirely up to date, but it exists.
I somehow did not notice the existing fpmake before, it seems
impossible to miss now! Anyway, seems like some more work is still
required to make the existing fpmake usable.  It also doesn't have
support for assembling assembler source files, so my original
question remains.
Did you look at the rtl/linux/fpmake.inc file? It adds the loaders
there. Though I have not tested it and don't know if it works.
Thanks for the hint Sven, my mistake seems to be creating a new target
for the loaders.

Loading...