Recent

Author Topic: how to setup rtl makefile?  (Read 1954 times)

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
how to setup rtl makefile?
« on: July 19, 2024, 09:06:13 am »
what to do for achieving

make all OS_TARGET=ps1 CPU_TARGET=mips


I'm not clear what make files have to be changed.
He tells me:
Makefile:252: *** The Makefile doesn't support target mips-ps1, please run fpcmake first.  Stop.

fpcmake -Tmips-ps1
tells me:
Error: No targets set


pls Step by Step explain, thx :)

Thaddy

  • Hero Member
  • *****
  • Posts: 15555
  • Censorship about opinions does not belong here.
Re: how to setup rtl makefile?
« Reply #1 on: July 19, 2024, 09:10:21 am »
make should be called from fpcmake, you should not try to edit or write your own makefile.
fpcmake is well documented.
https://www.freepascal.org/docs-html/prog/progap5.html

Really, pay attention to that and make sure you are familiar with that if you want to write your own compiler.
« Last Edit: July 19, 2024, 09:15:53 am by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11732
  • FPC developer.
Re: how to setup rtl makefile?
« Reply #2 on: July 19, 2024, 09:32:53 am »
Note that fpcmake may need modifications for architectures and maybe even OSes too. IIRC there is a loop in there that enumerates all of them

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: how to setup rtl makefile?
« Reply #3 on: July 19, 2024, 09:39:58 am »
ok, i read the entire doc and still have no clue.

pls some hints

Thaddy

  • Hero Member
  • *****
  • Posts: 15555
  • Censorship about opinions does not belong here.
Re: how to setup rtl makefile?
« Reply #4 on: July 19, 2024, 09:43:36 am »
Note that fpcmake may need modifications for architectures and maybe even OSes too. IIRC there is a loop in there that enumerates all of them
@Key-real,
There is your answer: make sure your compiler is in the enumeration.
If I smell bad code it usually is bad code and that includes my own code.

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: how to setup rtl makefile?
« Reply #5 on: July 19, 2024, 09:45:43 am »
what enumeration?
which file?

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: how to setup rtl makefile?
« Reply #6 on: July 19, 2024, 09:54:26 am »
there are thousands of MakeFile.fpc's
in each folder one.

where is that magic enumeration?

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: how to setup rtl makefile?
« Reply #7 on: July 19, 2024, 10:03:43 am »
this is my makefile.fpc in ./rtl/ps1


Code: Pascal  [Select][+][-]
  1. #
  2. #   Makefile.fpc for PS1 RTL
  3. #
  4. [package]
  5. main=rtl
  6. [target]
  7. loaders=
  8. units=$(SYSTEMUNIT) si_prc
  9.  
  10. [require]
  11. nortl=y
  12. [install]
  13. fpcpackage=y
  14. [default]
  15. target=ps1
  16. cpu=mipsel
  17. [compiler]
  18. includedir=$(INC) $(PROCINC)
  19. sourcedir=$(INC) $(PROCINC) $(COMMON)
  20. [prerules]
  21. RTL=..
  22. INC=../inc
  23. COMMON=$(RTL)/common
  24. PROCINC=../$(CPU_TARGET)
  25. UNITPREFIX=rtl
  26.  
  27. # Paths
  28. OBJPASDIR=$(RTL)/objpas
  29. # Insert exception handler in system unit
  30. ifdef EXCEPTIONS_IN_SYSTEM
  31. override FPCOPT+=-dEXCEPTIONS_IN_SYSTEM
  32. endif
  33. # Insert exception handler in system unit
  34. ifdef NO_EXCEPTIONS_IN_SYSTEM
  35. override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM
  36. endif
  37. [rules]
  38. # Get the system independent include file names.
  39. # This will set the following variables :
  40. # SYSINCNAMES
  41. include $(INC)/makefile.inc
  42. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  43. # Get the processor dependent include file names.
  44. # This will set the following variables :
  45. # CPUINCNAMES
  46. include $(PROCINC)/makefile.cpu
  47. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  48. # Put system unit dependencies together.
  49. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  50.  
  51. #
  52. # Loaders
  53. #
  54.  
  55. si_prc$(PPUEXT) : $(SYSTEMUNIT)$(PPUEXT)
  56.         $(COMPILER) si_prc.pp
  57.  
  58.  


$fpcmake -Tps1
tells me:
Processing Makefile.fpc
Error: No targets set

Thaddy

  • Hero Member
  • *****
  • Posts: 15555
  • Censorship about opinions does not belong here.
Re: how to setup rtl makefile?
« Reply #8 on: July 19, 2024, 10:13:15 am »
There is only one make file for the compiler. Add your compiler to the list of targets.
If I smell bad code it usually is bad code and that includes my own code.

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: how to setup rtl makefile?
« Reply #9 on: July 19, 2024, 10:15:54 am »
where? which FILE?

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: how to setup rtl makefile?
« Reply #10 on: July 19, 2024, 10:22:19 am »
EY

just tell me:
1)
take ./compier/makefile.fpc (as example)
2)
add ps1 (as example) to mysection(as example)

Thaddy

  • Hero Member
  • *****
  • Posts: 15555
  • Censorship about opinions does not belong here.
Re: how to setup rtl makefile?
« Reply #11 on: July 19, 2024, 10:26:50 am »
yes, that should work.
If I smell bad code it usually is bad code and that includes my own code.

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: how to setup rtl makefile?
« Reply #12 on: July 19, 2024, 10:33:09 am »
[key-real@arch source]$ make rtl CPU_TARGET=mipsel OS_TARGET=ps1
Makefile:252: *** The Makefile doesn't support target mipsel-ps1, please run fpcmake first.  Stop.
[key-real@arch source]$ fpcmake -Tps1
Processing Makefile.fpc
Error: No targets set
[key-real@arch source]$

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: how to setup rtl makefile?
« Reply #13 on: July 19, 2024, 10:42:34 am »
sorry, but I'm getting mad :(

tell me:

EDIT FILE.CFG,
PUT PS1 SectionX

Laksen

  • Hero Member
  • *****
  • Posts: 776
    • J-Software
Re: how to setup rtl makefile?
« Reply #14 on: July 19, 2024, 12:43:53 pm »
It's not a single place. It's likely many places. Look at how support for the "embedded" or "freertos" target is done for example. Search for all strings "freertos" that aren't from autogenerated files and you'll get an idea about places where you need to add your custom target

A good place to start is to add ps1 in utils/fpcm/fpcmmain.pp

 

TinyPortal © 2005-2018