how to setup rtl makefile? lazarus / 64-FPC development ---------------------------------------------------------------------- Key-Real · 2024-07-19 07:06 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 · 2024-07-19 07:10 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. ---------------------------------------------------------------------- marcov · 2024-07-19 07:32 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 · 2024-07-19 07:39 ok, i read the entire doc and still have no clue. pls some hints ---------------------------------------------------------------------- Thaddy · 2024-07-19 07:43 Quote from: marcov on July 19, 2024, 09:32:53 amNote 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. ---------------------------------------------------------------------- Key-Real · 2024-07-19 07:45 what enumeration? which file? ---------------------------------------------------------------------- Key-Real · 2024-07-19 07:54 there are thousands of MakeFile.fpc's in each folder one. where is that magic enumeration? ---------------------------------------------------------------------- Key-Real · 2024-07-19 08:03 this is my makefile.fpc in ./rtl/ps1 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ##   Makefile.fpc for PS1 RTL#[package]main=rtl[target]loaders=units=$(SYS]"]>BlockedNIT) si_prc  [require]nortl=y[install]fpcpackage=y[default]target=ps1cpu=mipsel[co mpiler]includedir=$(INC) $(PROCINC)sourcedir=$(INC) $(PROCINC) $(COMMO N)[prerules]RTL=..INC=../incCOMMON=$(RTL)/commonPROCINC=../$(CPU_TARGE T)UNITPREFIX=rtl # PathsOBJPASDIR=$(RTL)/objpas# Insert exception handler in system unitifdef EXCEPTIONS_IN_SYSTEMoverride FPCOPT+=-dEXCEPTIONS_IN_SYSTEMendif# Insert exception handler in system unitifdef NO_EXCEPTIONS_IN_SYSTEMoverride FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEMendif[rules]# Get the system independent include file names.# This will set the following variables :# SYSINCNAMESinclude $(INC)/makefile.incSYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))# Get the processor dependent include file names.# This will set the following variables :# CPUINCNAMESinclude $(PROCINC)/makefile.cpuSYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))# Put system unit dependencies together.SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) ## Loaders# si_prc$(PPUEXT) : $(SYS]"]>BlockedNIT)$(PPUEXT)        $(COMPILER) si_prc.pp   $fpcmake -Tps1 tells me: Processing Makefile.fpc Error: No targets set ---------------------------------------------------------------------- Thaddy · 2024-07-19 08:13 There is only one make file for the compiler. Add your compiler to the list of targets. ---------------------------------------------------------------------- Key-Real · 2024-07-19 08:15 where? which FILE? ---------------------------------------------------------------------- Key-Real · 2024-07-19 08:22 EY just tell me: 1) take ./compier/makefile.fpc (as example) 2) add ps1 (as example) to mysection(as example) ---------------------------------------------------------------------- Thaddy · 2024-07-19 08:26 yes, that should work. ---------------------------------------------------------------------- Key-Real · 2024-07-19 08:33 [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 · 2024-07-19 08:42 sorry, but I'm getting mad tell me: EDIT FILE.CFG, PUT PS1 SectionX ---------------------------------------------------------------------- Laksen · 2024-07-19 10:43 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 ---------------------------------------------------------------------- Key-Real · 2024-07-19 12:04 I done all the nesessery changes in /utils/fpcm now if I do make all CPU_TARGET=mipsel OS_TARGET=ps1 the crosscompiler is compiled but further building tells me: /home/key-real/vip-code/source/compiler/ppc fpcmake.pp -n -Fu/home/key-real/vip-code/source/rtl -FU Fatal: Can't find unit system used by fpcmake Fatal: Compilation aborted ---------------------------------------------------------------------- nickysn · 2024-07-19 12:14 What do you mean by "further building"? What are you trying to achieve? Are you trying to compile fpcmake? Then, do a 'make clean && make all' in the root fpc directory. If you're trying to do something else, please explain what and how. ---------------------------------------------------------------------- Key-Real · 2024-07-19 12:20 yes I done 'make clean && make all' he makes me a build for linux now i do 'make all CPU_TARGET=mipsel OS_TARGET=ps1' at some stage of building he tells me Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i /home/key- real/vip-code/source/compiler/ppc fpcmake.pp  -Fu/home/key-real/vip- code/source/rtl -FU Free Pascal Compiler version 3.3.1 [2024/07/19] for x86_64Copyright (c) 1993-2024 by Florian Klaempfl and othersTarget OS: Linux for x86-64Compiling fpcmake.ppFatal: Internal error 200208151Fatal: Compilation aborted which indicates that the system unit is not pre-compiled. ---------------------------------------------------------------------- nickysn · 2024-07-19 12:29 What happens if you try the following: 1) make clean && make all 2) copy the generated fpcmake somewhere outside the fpc git repository 3) make all CPU_TARGET=mipsel OS_TARGET=ps1 FPCMAKENEW=path/to/your/new/fpcmake ---------------------------------------------------------------------- Key-Real · 2024-07-19 12:33 he still tryes to compile fpcmake ---------------------------------------------------------------------- TRon · 2024-07-19 12:33 @nickysn: +1 Afaik you can't do this in one go. In order to compile the rtl you first need to update the makefile(s) but if the target isn't present yet the make process complains. ---------------------------------------------------------------------- Key-Real · 2024-07-19 12:35 but I'm building a crosscompiler. how this should affect the host? ---------------------------------------------------------------------- nickysn · 2024-07-19 12:41 It could help if you were attaching the complete build log, as well as your commands. It would be easier to answer why it's trying to build fpcmake, if we know *when* (at what stage) does it try to build it. Is it after building the compiler, is it after building the rtl, is it before building packages, is it after? Always paste more information, not less. ---------------------------------------------------------------------- Key-Real · 2024-07-19 12:45 as attachment ---------------------------------------------------------------------- TRon · 2024-07-19 13:31 Quote from: Key-Real on July 19, 2024, 02:35:33 pmbut I'm building a crosscompiler. Yes, and how do you think the cross-compiler is build ? Quotehow this should affect the host? Making the cross-compiler is not affecting the host. The host compiler needs to be aware of the (cross)-target otherwise it can't build the cross-compiler. At least I am not aware of any shortcut there e.g. it is a chicken and egg problem. ---------------------------------------------------------------------- nickysn · 2024-07-19 14:16 Key-Real, the log you've attached shows a different error. What is it that you're trying to do? What was the make command, that generated this log? ---------------------------------------------------------------------- Key-Real · 2024-07-19 14:46 I gonna clone the fresh compiler and make my step by step port, than we can look at it again.... this would take a while.....