[fpc-pascal] Option in Makefile to clean installed compiled units

Sven Barth pascaldragon at googlemail.com
Wed Oct 10 14:22:35 CEST 2018

Fr0sT <fr0st.brutal at gmail.com> schrieb am Mi., 10. Okt. 2018, 13:39:

> 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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20181010/5355b8e5/attachment.html>

More information about the fpc-pascal mailing list