[fpc-devel]Makefile layout

Peter Vreman peter at freepascal.org
Tue May 28 07:27:46 CEST 2002


> Hi!
> Why Makefile's in a FPC tree have so agly layout?
> For example:
> 
> ifndef ECHO
> ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
> ifeq ($(ECHO),)
> ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
> ifeq ($(ECHO),)
> ECHO=echo
> else
> ECHO:=$(firstword $(ECHO))
> endif
> else
> ECHO:=$(firstword $(ECHO))
> endif
> endif
> export ECHO
> 
> The following layout is more nicer (in my opinion):
> ifndef ECHO
>   ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
>   ifeq ($(ECHO),)
>     ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
>     ifeq ($(ECHO),)
>       ECHO=echo
>     else
>       ECHO:=$(firstword $(ECHO))
>     endif
>   else
>     ECHO:=$(firstword $(ECHO))
>   endif
> endif
> export ECHO
> 
> There was no problems under Linux and Windows with new layout.
> I change fpcmake to keep comments and spaces from Makefile.fpc
> and template.  No problems again. And Makefile's looks much nicer.
> 
> Can you give any comments?

I've seen some problems when the Makefile commands didn't start at the first column. Maybe
it's solved with the more recenter make versions.

The Makefiles are generated files and don't need comments in the file, because the files
are not meant to be edited. This saves some bytes and the size of the deltas between
revisions is smaller.







More information about the fpc-devel mailing list