Discussion:
[fpc-pascal] Option in Makefile to clean installed compiled units
Fr0sT
2018-10-09 08:11:40 UTC
Permalink
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

_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/
Sven Barth via fpc-pascal
2018-10-10 12:22:35 UTC
Permalink
Post by 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.
.\fpc-min - FPC release installed from distrib
.\FPC - sources from Github
and these commands in batch file (this is a minimal excerpt from my
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
Fr0sT
2018-10-10 13:41:43 UTC
Permalink
Hi Sven,
Post by Sven Barth via fpc-pascal
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

_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
http://

Loading...