[fpc-devel] Re: Fpc Target directory function

L L at z505.com
Wed Jan 30 08:29:30 CET 2008

> >  result:= {$I %FPCTARGETCPU%}+'-'+{$I %FPCTARGETOS%};
> Above works for my needs, just wonder if something already exists in RTL
> or if it should be added for convenience.

> It doesn't exists and i don't see a reason why it should be added. The above   
> line is simple. 

The above line:


is the most ugliest crap I've seen in Pascal code, which is why I made
the FpcTargetDir function.

FpcTargetDir is simply cleaner and more elegant.

> And there is no generic rule that says that you need to encode 
> TargetDir like cpu-os for every program.

Not for every program.. but never make assumptions about what people use 
fpc for ;-)

Fpc is a cross platform compiler and me I am working on stuff to
clean the i386-win i386-linux style directories. I am also working
on something to ship a binary Exe demos for windows, bsd, linux, 
all in one zip package. And my Exe and Elf need to be put in folders.
FpcTargetDir folder is perfect to notify people what platform the Exe
is for.

It should also come in handy for FPMAKE or you must have a function in
use like that already. 

So someone else has already found a need for it (me) along with fpmake 
authors (must have used a similar function?).

I will keep it in my own units.. but sometimes I wonder why I have all 
these useful functions that could be shipped with fpc so the public
could use it, since you never know what the public is using fpc for.
Who would have thought, for example, someone used FPC as a make build 
system. Never assume.

More information about the fpc-devel mailing list