Recent

Author Topic: add new targets to make  (Read 2814 times)

Key-Real

  • Full Member
  • ***
  • Posts: 242
add new targets to make
« on: April 21, 2024, 09:19:50 am »
What you think about adding

make compiler  CPU_TARGET=mipsel OS_TARGET=linux
make rtl  CPU_TARGET=mipsel OS_TARGET=linux

to the main make (root fpc dir) ?

TRon

  • Hero Member
  • *****
  • Posts: 2663
Re: add new targets to make
« Reply #1 on: April 21, 2024, 10:36:56 am »
Note that mips(el) linux targets are already present in trunk makefile

Key-Real

  • Full Member
  • ***
  • Posts: 242
Re: add new targets to make
« Reply #2 on: April 21, 2024, 10:38:46 am »
no, i mean

make compile
make rtl

the CPU_TARGET=mipsel OS_TARGET=linux is just an example

TRon

  • Hero Member
  • *****
  • Posts: 2663
Re: add new targets to make
« Reply #3 on: April 21, 2024, 10:48:42 am »
Then I am afraid I do not understand what you mean.

compiler and rtl are already (sub)targets. E.g. it should already work as mentioned in your first post.

Key-Real

  • Full Member
  • ***
  • Posts: 242
Re: add new targets to make
« Reply #4 on: April 21, 2024, 10:54:49 am »
ups, sorry, i  mean

make crosscomplier CPU_TARGET=mipsel OS_TARGET=linux
make crossrtl CPU_TARGET=mipsel OS_TARGET=linux

TRon

  • Hero Member
  • *****
  • Posts: 2663
Re: add new targets to make
« Reply #5 on: April 21, 2024, 11:17:48 am »
Ah ok that makes a bit more sense :)

But, what is your aim there ? To create a cross-compiler and corresponding rtl and packages ? because that is also already present in the makefile.

The makefile is 'clever' enough that providing the cpu and os target makes the build-process cross-compile.

You can select to either build a native compiler for the selected target or build a cross-compiler (and corresponding rtl/packages) for your current host.

Key-Real

  • Full Member
  • ***
  • Posts: 242
Re: add new targets to make
« Reply #6 on: April 21, 2024, 11:28:20 am »
wanna create the cross-compiler and corss-rtl separately.
till now i have to do make all <targets>

TRon

  • Hero Member
  • *****
  • Posts: 2663
Re: add new targets to make
« Reply #7 on: April 21, 2024, 12:13:14 pm »
wanna create the cross-compiler and corss-rtl separately.
tbh I do not know if that is even possible for a cross-compiler. For sure you can create ("only") the compiler but the cross-units will be build as well in that case.

Quote
till now i have to do make all <targets>
Why ?

It is possible to use make crossinstall or any of the predefined cross-targets (or use CROSSINSTALL=1) in combination with your target OS/CPU and only the necessary parts will be build. Also make sure to provide FPC or PP so that the (native host) compiler isn't (re-)build each time.

Laksen

  • Hero Member
  • *****
  • Posts: 758
    • J-Software
Re: add new targets to make
« Reply #8 on: April 21, 2024, 12:37:10 pm »
A trick you can do is to figure out the command the makefile does to compile a specific unit just by looking through the called commands during execution. Then just keep calling that or setting those args as the launching parameters in Lazarus for the compiler project (e.g ppcmipsel.lpi) together with the specific working directory

Key-Real

  • Full Member
  • ***
  • Posts: 242
Re: add new targets to make
« Reply #9 on: April 21, 2024, 08:45:25 pm »
I'm developing a new Taraget on which only crosscompiling is possible.

So when I need to recompile the crosscompiler i allways do
make all <target>

it runs and gives me the compiler, the rtl and the packages.

I thought it would be nice not every time build all thouse things, but do it separatly

PascalDragon

  • Hero Member
  • *****
  • Posts: 5508
  • Compiler Developer
Re: add new targets to make
« Reply #10 on: April 21, 2024, 09:02:23 pm »
I thought it would be nice not every time build all thouse things, but do it separatly

Simply build the MIPS compiler from within Lazarus and do a corresponding make all inside the rtl directory, passing the compiler as FPC=$(pwd)/../compiler/mips/pp or FPC=Full\Path\To\compiler\mips\pp.exe on Windows.

Key-Real

  • Full Member
  • ***
  • Posts: 242
Re: add new targets to make
« Reply #11 on: April 21, 2024, 09:19:41 pm »
:)

I don't use Lazarus, I compile form the command line

PascalDragon

  • Hero Member
  • *****
  • Posts: 5508
  • Compiler Developer
Re: add new targets to make
« Reply #12 on: April 21, 2024, 09:49:06 pm »
You can just as well compile the compiler manually. Essentially its fpc -FUmips/units -Fumips -Fusystems -FEmips -opp -DMIPSEL (not tested right now, so it might be incomplete, but I had done that in the past already).

ccrause

  • Hero Member
  • *****
  • Posts: 892
Re: add new targets to make
« Reply #13 on: April 22, 2024, 08:36:37 am »
I'm developing a new Taraget on which only crosscompiling is possible.

So when I need to recompile the crosscompiler i allways do
make all <target>

it runs and gives me the compiler, the rtl and the packages.

I thought it would be nice not every time build all thouse things, but do it separatly

The make targets compiler_cycle will bootstrap just the target compiler, rtl will build just the RTL, and packages just the packages.  You can combine the building compiler and RTL using build_base.  None of these options are listed for make help, so it may disappear at some point.

Key-Real

  • Full Member
  • ***
  • Posts: 242
Re: add new targets to make
« Reply #14 on: April 22, 2024, 08:53:45 am »
Yes, It is exactly what I'm looking for!

Code: Pascal  [Select][+][-]
  1. $make compiler_cycle CPU_TARGET=mipsel OS_TARGET=ps1

works perfect

but:
Code: Pascal  [Select][+][-]
  1. $ make rtl CPU_TARGET=mipsel OS_TARGET=ps1
  2. make -C rtl all
  3. make[1]: Entering directory '/home/key-real/vip-code/source/rtl'
  4. make[1]: Nothing to be done for 'all'.
  5. make[1]: Leaving directory '/home/key-real/vip-code/source/rtl'

and this after $make clean

and
in the compiler root dir:
Code: Pascal  [Select][+][-]
  1. $ make rtl CPU_TARGET=mipsel OS_TARGET=ps1
  2. make: *** No rule to make target 'rtl'.  Stop.

and in the rtl dir:

Code: Pascal  [Select][+][-]
  1. [key-real@arch rtl]$ $make all CPU_TARGET=mipsel OS_TARGET=ps1
  2. make: Nothing to be done for 'all'.
  3.  
  4. and
  5.  
  6. $ make rtl CPU_TARGET=mipsel OS_TARGET=ps1
  7. make: *** No rule to make target 'rtl'.  Stop.

 

TinyPortal © 2005-2018