Forum > FPC development

how to setup makefiles

(1/2) > >>

Key-Real:
I cloned the official fpc source.

1)
It's for me not allowed to push my branch.

How should I work the right way?
I was told to work on an different branch of the source not on main. Push my changes.

2)
And I have to setup the makefiles for compilation.

Key-Real:
1) I was told to fork the official FPC source and create an own branch, so it can be easy merged to the source when finally finished

2) I'm parallel writing a doc about porting. The first step:


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---1) Setup the make files          add the new build target to fpcmake:                 - You need to extend the ./utils/fpcm/fpcmmain.pp:                         insert the new Target in                                 type TOS=(..., ps1); section. (about line 100)                                 don't forget to insert it also to OSStr(about line 135) and OSSufix(about line 144) constants.                                 add at the end of the table OSCpuPossible a new os/cpu entry (about line 207)                          rebuild your native compiler                                $make all                                $sudo make install                         now fpcmake can generate make files.          add to ./compiler/Makefile.fpc:                                NO_NATIVE_COMPILER_OS_LIST (about line 44)                        your target system, ps1                this indicates, there is no native compiler for your target          time to rebuild all make files:           you have to run the fpcmake in all folders of the fpc sources          after that          to build the rtl make files you have to execute ./regenmakefiles.sh in ./rtl          to build the packages you have to execute ./regenmakefiles.sh in ./packages           to simplify all touse steps execute my script                $./mk.sh 
this mk.sh:

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- #! /bin/shset -eFPCMAKE=/usr/local/bin/fpcmake find . -name Makefile.fpc | xargs $FPCMAKE -Tall  cd ./rtl./regenmakefiles.shcd ./.. cd ./packages./regenmakefiles.shcd ./.. cd ./utils/build/$FPCMAKE -Tall -s -o Makefile.pkg Makefile.fpccd ./../.. cd ./packages/build/$FPCMAKE -Tall -s -o Makefile.pkg Makefile.fpccd ./../.. 

are this Steps correct? Did I forgot something?


My goal it to achieve the complete build cycle by using:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---$make all CPU_TARGET=mipsel OS_TARGET=ps1 OPT="-O- -CR -glv" CROSSOPT="-O- -g-" ALLOW_WARNINGS=1

Key-Real:
I putted the compiler together again, now on this brunch:

https://gitlab.com/Key-Real/source/-/tree/ps1


make all CPU_TARGET=mipsel OS_TARGET=ps1

tells me:

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Compiling /run/media/key-real/E3AF-F107/code/source/packages/fcl-process/src/pipes.ppprocess.inc(82,7) Warning: Symbol "TProcess.ApplicationName" is deprecatedprocess.inc(82,34) Warning: Symbol "TProcess.CommandLine" is deprecatedprocess.inc(78,3) Note: Local variable "E2" not usedprocessbody.inc(810,28) Warning: Symbol "TProcess.SetCommandLine" is deprecatedprocessbody.inc(853,28) Warning: Symbol "TProcess.SetCommandLine" is deprecatedprocessbody.inc(256,12) Error: Forward declaration not solved "DetectXTerm:System.AnsiString;"process.pp(103,1) Fatal: There were 1 errors compiling module, stoppingFatal: Compilation aborted 

I knew its not a make fault, but somebody has ideas?

Laksen:
https://gitlab.com/Key-Real/source/-/blob/ps1/packages/fcl-process/fpmake.pp#L28

You will likely have to exclude most other packages as well. Look for how it's done for the embedded target

Also your makefile regeneration step can be shortened to running "fpcmake -Tall -r" in the fpc root directory

TRon:

--- Quote from: Key-Real on July 26, 2024, 08:49:04 am ---I cloned the official fpc source.

1)
It's for me not allowed to push my branch.

How should I work the right way?
I was told to work on an different branch of the source not on main. Push my changes.

--- End quote ---
Indeed you need to make a clone of the official sources in your own repo.

Then create a new branch, make your changes in that branch and commit those changes first locally then to your (own) remote repo.

Make sure the changes for each commit are clean, clear and made in small steps an which allows for someone else to follow exactly what you did. Accompany your commits with good descriptions.

It is best to split up several stages of the porting process into several commits so that in case there is an issue it can be detected early and easily.

If you want to then you can also use multiple branches on top of each other but that can over-complicate things.

You can then later do a merge request for someone in the team to review your changes and apply them. If there are issues then they usually will be mentioned and that you need to take care of them before the merge request is honoured (that is why it is a good idea to make small merge requests and break up your branch into different smaller commits, or even several branches).

The most important part is to try and not break any existing functionality (unless the breakage occurs in/at your own target)  :)

Merge requests will be accepted quicker when they are simple, clean/clear and small.

Navigation

[0] Message Index

[#] Next page

Go to full version