Recent

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

ccrause

  • Hero Member
  • *****
  • Posts: 970
Re: add new targets to make
« Reply #15 on: April 22, 2024, 01:59:06 pm »
Code: Pascal  [Select][+][-]
  1. $ make rtl CPU_TARGET=mipsel OS_TARGET=ps1
  2. make -C rtl all
  3. ...

and this after $make clean

You should have a working cross compiler before compiling the RTL, to specify the cross compiler to use for compiling the RTL:
Code: Text  [Select][+][-]
  1. $ make rtl  CPU_TARGET=mipsel OS_TARGET=ps1 FPC=./compiler/ppcrossmipsel

Quote
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.

These make options are supported by the MakeFile in the root folder of fpc, the folder that contains ./compiler ./rtl ./packages etc.

Key-Real

  • Sr. Member
  • ****
  • Posts: 372
Re: add new targets to make
« Reply #16 on: April 22, 2024, 02:20:08 pm »
ok, now I'm confused

Code: Pascal  [Select][+][-]
  1. [key-real@arch source]$ ./compiler/ppcrossmipsel test.pas -Fu./rtl/ps1 -Fu./rtl/inc -Tps1 -a -XP/usr/local/mipsel-unknown-elf/bin/mipsel-unknown-elf- -Cfnone
  2. Warning: Source OS Redefined!
  3. Free Pascal Compiler version 3.3.1 [2024/04/22] for mipsel
  4. Copyright (c) 1993-2024 by Florian Klaempfl and others
  5. Target OS: PlayStation 1 for MIPSEL
  6. Compiling test.pas
  7. test.pas(1,6) Error: Compilation raised exception internally
  8. Fatal: Compilation aborted
  9. An unhandled exception occurred at $00000000004EE58A:
  10. EAccessViolation: Access violation
  11.   $00000000004EE58A  push,  line 1935 of symdef.pas
  12.  
  13. [key-real@arch source]$ make rtl CPU_TARGET=mipsel OS_TARGET=ps1 FPC=./compiler/ppcrossmipsel
  14. make -C rtl all
  15. make[1]: Entering directory '/home/key-real/vip-code/source/rtl'
  16. Makefile:136: *** Compiler ./compiler/ppcrossmipsel not found.  Stop.
  17. make[1]: Leaving directory '/home/key-real/vip-code/source/rtl'
  18. make: *** [Makefile:3095: rtl] Error 2
  19. [key-real@arch source]$
  20.  
the first call is to prove the compiler exists. btw. the error has noting to do with the rtl

compiler not found?

Laksen

  • Hero Member
  • *****
  • Posts: 785
    • J-Software
Re: add new targets to make
« Reply #17 on: April 22, 2024, 02:22:50 pm »
Code: [Select]
Entering directory '/home/key-real/vip-code/source/rtl'
Makefile:136: *** Compiler ./compiler/ppcrossmipsel not found.  Stop

It's changing directory to "/home/key-real/vip-code/source/rtl". It's telling you that "/home/key-real/vip-code/source/rtl/compiler/ppcrossmipsel" doesn't exist

Just pass the full path to the compiler in the FPC variable

Key-Real

  • Sr. Member
  • ****
  • Posts: 372
Re: add new targets to make
« Reply #18 on: April 22, 2024, 02:28:29 pm »
I'm going crazy

Code: Pascal  [Select][+][-]
  1. [key-real@arch source]$ make rtl CPU_TARGET=mipsel OS_TARGET=ps1 FPC=/home/key-real/vip-code/source/compiler/ppcrossmipsel
  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'
  6.  

Laksen

  • Hero Member
  • *****
  • Posts: 785
    • J-Software
Re: add new targets to make
« Reply #19 on: April 22, 2024, 02:31:23 pm »
Did you clean first?

Key-Real

  • Sr. Member
  • ****
  • Posts: 372
Re: add new targets to make
« Reply #20 on: April 22, 2024, 02:34:14 pm »
Code: Pascal  [Select][+][-]
  1. $ make clean
  2. $ make compiler_cycle CPU_TARGET=mipsel OS_TARGET=ps1 OPTNEW="-gl"
  3. $ make rtl CPU_TARGET=mipsel OS_TARGET=ps1 FPC=/home/key-real/vip-code/source/compiler/ppcrossmipsel

Laksen

  • Hero Member
  • *****
  • Posts: 785
    • J-Software
Re: add new targets to make
« Reply #21 on: April 22, 2024, 02:37:46 pm »
Try and give CPU_TARGET and OS_TARGET to the clean command as well

Key-Real

  • Sr. Member
  • ****
  • Posts: 372
Re: add new targets to make
« Reply #22 on: April 22, 2024, 02:39:51 pm »
the same

Laksen

  • Hero Member
  • *****
  • Posts: 785
    • J-Software
Re: add new targets to make
« Reply #23 on: April 22, 2024, 02:41:31 pm »
Then maybe it's the compiler_cycle that builds the rtl, not sure.. But what if you just run "make -C rtl clean" before the make rtl command?

Key-Real

  • Sr. Member
  • ****
  • Posts: 372
Re: add new targets to make
« Reply #24 on: April 22, 2024, 02:42:38 pm »
the same.


what is the path for the compiled rtl?

Laksen

  • Hero Member
  • *****
  • Posts: 785
    • J-Software
Re: add new targets to make
« Reply #25 on: April 22, 2024, 02:46:54 pm »
rtl/units/<cpu>-<os>/

Key-Real

  • Sr. Member
  • ****
  • Posts: 372
Re: add new targets to make
« Reply #26 on: April 22, 2024, 02:52:52 pm »
nothing there

ccrause

  • Hero Member
  • *****
  • Posts: 970
Re: add new targets to make
« Reply #27 on: April 22, 2024, 04:29:52 pm »
Code: [Select]
Entering directory '/home/key-real/vip-code/source/rtl'
Makefile:136: *** Compiler ./compiler/ppcrossmipsel not found.  Stop

It's changing directory to "/home/key-real/vip-code/source/rtl". It's telling you that "/home/key-real/vip-code/source/rtl/compiler/ppcrossmipsel" doesn't exist

Just pass the full path to the compiler in the FPC variable

My apologies to Key-Real, I forgot that the FPC variable needs to be an absolute path.

ccrause

  • Hero Member
  • *****
  • Posts: 970
Re: add new targets to make
« Reply #28 on: April 22, 2024, 04:58:53 pm »
Code: Pascal  [Select][+][-]
  1. [key-real@arch source]$ make rtl CPU_TARGET=mipsel OS_TARGET=ps1 FPC=/home/key-real/vip-code/source/compiler/ppcrossmipsel
  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'
  6.  

You declare that mispel-ps1 is a valid makefile target at the top of rtl/MakeFile, but you still need to define the specific actions that make needs to take. To get started, search for mipsel-linux and see what is defined for that. I would think you need the following two entries at least:
Code: GNU make  [Select][+][-]
  1. ifeq ($(CPU_OS_TARGET),mipsel-ps1)
  2. override TARGET_DIRS+=ps1
  3. endif
  4.  
  5. ifeq ($(CPU_OS_TARGET),mipsel-ps1)
  6. TARGET_DIRS_PS1=1

Then search for TARGET_DIRS_LINUX.  Towards the end of the MakeFile there is a long section starting with:
Code: GNU make  [Select][+][-]
  1. ifdef TARGET_DIRS_LINUX
  2. linux_all:
  3.         $(MAKE) -C linux all

Clone this section and create a similar structure for TARGET_DIRS_PS1 that refers to ps1 in place of linux. NOTE: this is all untested!

This is a very manual process that can easily lead to mistakes.  Eventually you have to learn how to use the fpcm tool.  This tool takes an input file (MakeFile.fpc) that basically just give a list of target folders and expand it into a proper MakeFile.  But fpcm also needs updating to be aware of your new target combination before it will all work together.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11935
  • FPC developer.
Re: add new targets to make
« Reply #29 on: April 22, 2024, 09:32:20 pm »
Note that makefile patches won't be accepted as they are mostly generated from Makefile.fpc.

This is done by adding the target to the program fpcmake (utils\fpcm), which also has a templates (utils\fpcm\fpcmake.ini) that might need modification.

 

TinyPortal © 2005-2018