[fpc-devel]improve makefile

Peter Vreman peter at freepascal.org
Thu Jan 15 20:03:20 CET 2004


At 19:17 15-1-2004, you wrote:
>Hi
> From several days I've try to make all fpc myself, but to do this under
>WIN98 is not so clear that it can be.
>I've found some bugs in makefile, and somebody may change FPCM to be
>generated proper MAKEFILE

What is proper? Windows is so broken for command line support, we try to 
support it as best as possible, but not to make it work less under the unix 
platforms.


>my 4 suggestion:
>
>--------1--------
>/*  current MAKEFILE
>ifdef PWD
>BASEDIR:=$(subst \,/,$(shell $(PWD)))
>ifdef inCygWin
>ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
>BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
>BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
>BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
>endif
>endif
>else
>BASEDIR=.
>endif
>/** in last line change to ..,like FPCDIR
>BASEDIR=c:/pp

Why? Fixing it to c:/pp is also not good. And it means that PWD is not 
installed so it should already give an error.


>--------2-----------
>/* current MAKEFILE
>ifdef INSTALL_FPCPACKAGE
>INSTALL_BASEDIR:=/pp
>/* I change to .., but I don't know, how it be under Linux
>INSTALL_BASEDIR:=c:/pp

Why fix it to c:/ ?


>------------3--------------
>please remove line:
>override DEFAULT_FPCDIR=..
>because it can't be pass from command line f.e: 'make all
>DEFAULT_FPCDIR=c:\fp'

This is taken from the Makefile.fpc and is only used to be able to build 
the tree without needing FPCDIR set.


>--------4-----------
>
>ifdef DEFAULT_FPCDIR
>ifeq ($(FPCDIR),wrong)
>override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
>ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
>override FPCDIR=wrong
>endif
>endif
>endif
>/*  change to :
>ifdef DEFAULT_FPCDIR
>override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
>endif

Why remove the safety check? There must be a rtl or units dir else your 
installation is broken.


Peter





More information about the fpc-devel mailing list