Missing fpc Makefile on Linux Mint lazarus / 1-Linux ---------------------------------------------------------------------- penttila · 2016-09-23 03:04 Hi, I have a Linux Mint 18 Cinnamon 64bit (based on Ubuntu 16.04) PC where I would like to cross compile a Lazarus pascal project to a 32bit- linux program. It has Lazarus-1.6, fpc-3.0.0 and fpc-source-3.0.0 packages installed on it from the official Linux Mint repository. On the http://wiki.freepascal.org/Cross_compiling#From_Linux_x64_to_Li nux_i386 web page I find some useful information how to set up my environment. It says to execute the "sudo make all CPU_TARGET=i386" command but I have no Makefiles in /usr/share/fpcsrc/, only several Makefile.fpc under it. I know that with fpcmake (probably with "fpcmake -rw Tall") the missing Makefiles can be generated but I haven't find any exact description about it! Does anybody has any experience in which directory and with what kind of parameters do I have to run fpcmake to create all the required Makefiles in the whole directory structure recursively? Thanks for your help! ---------------------------------------------------------------------- Leledumbo · 2016-09-23 09:34 Doing it on the top level directory will recursively do for all other folders. ---------------------------------------------------------------------- Thaddy · 2016-09-23 10:38 For now, don't run fpmake or the fpc?make, just run make.... make clean all install for example.... ---------------------------------------------------------------------- penttila · 2016-09-23 15:47 Quote from: Leledumbo on September 23, 2016, 11:34:43 amDoing it on the top level directory will recursively do for all other folders. @Leledumbo: I have taken your advice but the result is questionable. When running it In the  compiler/ subdirectory, I got a nice Makefile parallel with Makefile.fpt in compliler/utils/ppuutils. On the other hand running it in packages/ I havn't got any makefile neither in packages/amunits nor in packages/amunits/utilunits although both contains a makefile.fpc file! Furthermore when I run the "sudo make all CPU_TARGET=i386" command for the rtl/ subdirectory I got this nice error msg bellow: xxx@afo /usr/share/fpcsrc/3.0.0 $ sudo make all CPU_TARGET=i386 [sudo] xxx password: make: *** No rule to make target 'all'.  Stop. xxx@afo /usr/share/fpcsrc/3.0.0/rtl $ sudo make all CPU_TARGET=i386 make -C linux all make[1]: Entering directory '/usr/share/fpcsrc/3.0.0/rtl/linux' Makefile:3486: ../i386/makefile.cpu: No such file or directory make[1]: *** No rule to make target '../i386/makefile.cpu'.  Stop. make[1]: Leaving directory '/usr/share/fpcsrc/3.0.0/rtl/linux' Makefile:1946: recipe for target 'linux_all' failed make: *** [linux_all] Error 2 Am I doing something wrong? ---------------------------------------------------------------------- Leledumbo · 2016-09-23 17:03 Quote from: penttila on September 23, 2016, 05:47:13 pmAm I doing something wrong? And if you do it in /usr/share/fpcsrc/3.0.0? Alternatively, you might want to get sources from the freepascal svn instead of mint repository.  I always use that and it has all makefiles pregenerated with fpcmake -Tall. ---------------------------------------------------------------------- penttila · 2016-09-24 06:55 @Leledumbo: of course I tried to run both of these commands from the base directory but without any success (that's why I tried to run them from the subdirectories): xxx@afo /usr/share/fpcsrc/3.0.0 $ fpcmake -rw -Tall Processing makefile.fpc Error: Unable to open file "makefile.fpc" xxx@afo /usr/share/fpcsrc/3.0.0 $ sudo make all CPU_TARGET=i386 [sudo] xxx psw: make: *** No rule to make target 'all'.  Stop. I will try to install the sources from the freepascal svn and will report the result. Thanks for your help. ---------------------------------------------------------------------- Leledumbo · 2016-09-24 15:11 Quote from: penttila on September 24, 2016, 08:55:41 am@Leledumbo: of course I tried to run both of these commands from the base directory but without any success (that's why I tried to run them from the subdirectories): xxx@afo /usr/share/fpcsrc/3.0.0 $ fpcmake -rw -Tall Processing makefile.fpc Error: Unable to open file "makefile.fpc" I believe this distribution package has no permission to be writable by normal users (normal, but not something a non-experienced user would expect). chmod-ing the whole directory tree to 666 (for files) and 777 (for directories) should fix it. ---------------------------------------------------------------------- penttila · 2016-09-26 16:45 QuoteI believe this distribution package has no permission to be writable by normal users (normal, but not something a non-experienced user would expect). chmod-ing the whole directory tree to 666 (for files) and 777 (for directories) should fix it. @Leledumbo: Changing permission doesn't help as the makefile.fpc itself is missing. With this solution bellow I was able to "make" the cross compiler although I was not able to verify the result: 1) delete the whole /usr/share/fpcsrc/3.0.0 directory tree 2) download and unpack fpc-3.0.0.source.tar.gz from freepascal.org in /usr/share/fpcsrc/ 3) rename the created /usr/share/fpcsrc/fpc-3.0.0 directory to /usr/share/fpcsrc/3.0.0 4) now fpc compilation will be OK:    cd /usr/share/fpcsrc/3.0.0    sudo make all CPU_TARGET=i386    sudo make crossinstall CPU_TARGET=i386 5) the new fp compiler is /usr/local/lib/fpc/3.0.0/ppcross386 (I think), make a link to it:    cd /usr/bin    sudo ln --symbolic -T /usr/local/lib/fpc/3.0.0/ppcross386 ./ppc386 Unfortunately the result was such a different and chaotic directory tree where my Lazarus project was not able to find the external references. I tried to modify it step by step but at the end I gave it up. An additional reason of fail can also be that my original source package was developed with fpc-2.4 and it seems so that there were a lot of changes also in the libraries. Anyhow thanks for all of your help! ---------------------------------------------------------------------- Leledumbo · 2016-09-27 06:30 Quote from: penttila on September 26, 2016, 06:45:20 pm@Leledumbo: Changing permission doesn't help as the makefile.fpc itself is missing. Let's assume the package is simply broken then, you might want to report it upstream. Quote from: penttila on September 26, 2016, 06:45:20 pmWith this solution bellow I was able to "make" the cross compiler although I was not able to verify the result: ...    sudo ln --symbolic -T /usr/local/lib/fpc/3.0.0/ppcross386 ./ppc386 No, make the symbolic link name the same as the original one. For cross compiling, fpc driver will look for ppcrossXXX instead of ppcXXX, the naming is intentional. ---------------------------------------------------------------------- penttila · 2016-09-27 08:38 QuoteLet's assume the package is simply broken then, you might want to report it upstream. To file a bug or use a mailing-list in debian is so complicated, that I don't want to do it at the moment. QuoteNo, make the symbolic link name the same as the original one. For cross compiling, fpc driver will look for ppcrossXXX instead of ppcXXX, the naming is intentional. You are right! This link was already created automatically. (But once - during my struggling - the compiler was missing this file so I added it.)