Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2018-10

Option in Makefile to clean installed compiled units

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Fr0sT

Hi all,

when building FPC from sources, I couldn't find a command to cleanup unit binaries copied to common .\units\ dir by "install" command. Without this step build process fails.

I build FPC from sources with the following layout:

.\fpc-min - FPC release installed from distrib
.\FPC - sources from Github

and these commands in batch file (this is a minimal excerpt from my larger script):

SET Base=%~dp0%
SET FPCMin=%Base%\fpc-min\bin\i386-win32
SET FPCPath=%Base%\FPC
PUSHD "%FPCPath%"
CALL make clean || GOTO :BuildFPCErr
CALL make all || GOTO :BuildFPCErr
CALL make install INSTALL_PREFIX="%FPCPath%" || GOTO :BuildFPCErr

The problem is that "make install" copies all unit binaries to %FPCPath%\units\%platform%-%os% but "make clean" won't remove them so the next build fails on rebuilding CustApp unit (IDK why this very unit stops the process). If I add "RD /Q /S "units\%TargCPU%-%TargOS%" 2> nul" after "make clean" where %TargCPU%-%TargOS% is i386-win32, everything is fine. But I wonder if there's a built-in option to do this? I discovered some lines dealing with \units folder in makefile but its syntax just explodes my brain. I tried "cleanall" and "distclean" with no luck.

Best regards

Reply by email

Sven Barth
to Fr0sT

Fr0sT schrieb am Mi., 10. Okt. 2018, 13:39:

Show quoted text 32 lines
Hi all, when building FPC from sources, I couldn't find a command to cleanup unit binaries copied to common .\units\ dir by "install" command. Without this step build process fails. I build FPC from sources with the following layout: .\fpc-min - FPC release installed from distrib .\FPC - sources from Github and these commands in batch file (this is a minimal excerpt from my larger script): SET Base=%~dp0% SET FPCMin=%Base%\fpc-min\bin\i386-win32 SET FPCPath=%Base%\FPC PUSHD "%FPCPath%" CALL make clean || GOTO :BuildFPCErr CALL make all || GOTO :BuildFPCErr CALL make install INSTALL_PREFIX="%FPCPath%" || GOTO :BuildFPCErr The problem is that "make install" copies all unit binaries to %FPCPath%\units\%platform%-%os% but "make clean" won't remove them so the next build fails on rebuilding CustApp unit (IDK why this very unit stops the process). If I add "RD /Q /S "units\%TargCPU%-%TargOS%" 2> nul" after "make clean" where %TargCPU%-%TargOS% is i386-win32, everything is fine. But I wonder if there's a built-in option to do this? I discovered some lines dealing with \units folder in makefile but its syntax just explodes my brain. I tried "cleanall" and "distclean" with no luck.

First there is no specific option to clean what is dice with "install", because INSTALL_PREFIX might point to a non empty directory (e.g. / or /usr on *nix systems).

In addition to that "make all" does not care about what has been copied with "install".

What could be however is that you're trying to build with the newly created trunk fpc if you have that in your PATH variable. In that case either remove the directory as you said in your mail or ensure that the build process does not pick up the trunk compiler.

If that does not help, we need more information, e.g. the output of "make all".

Regards,
Sven

Reply by email

Fr0sT

Hi Sven,

Show quoted text 17 lines
First there is no specific option to clean what is dice with "install", because INSTALL_PREFIX might point to a non empty directory (e.g. / or /usr on *nix systems). In addition to that "make all" does not care about what has been copied with "install". What could be however is that you're trying to build with the newly created trunk fpc if you have that in your PATH variable. In that case either remove the directory as you said in your mail or ensure that the build process does not pick up the trunk compiler. If that does not help, we need more information, e.g. the output of "make all". Regards, Sven

Funny. Just after this report I rerun my build script without "units" folder cleanup and it seems to pass without any issue. Though I'm absolutely sure that action helped me yesterday, it's not necessary now. So I guess the subject is not actual (until some evil magic revives it occasionally).

Best regards

Reply by email