From 87d843fbbd52192512b39783ed7115a367486506 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 13 Jan 2000 11:34:26 +0000 Subject: [PATCH] * better package dep creation --- utils/fpcmake.inc | 779 +++++++++++++++++++++++----------------------- utils/fpcmake.ini | 522 +++++++++++++++---------------- utils/fpcmake.pp | 207 ++++++------ 3 files changed, 749 insertions(+), 759 deletions(-) diff --git a/utils/fpcmake.inc b/utils/fpcmake.inc index d93d57920b..437c72c83f 100644 --- a/utils/fpcmake.inc +++ b/utils/fpcmake.inc @@ -181,154 +181,31 @@ const fpcmakeini : array[0..114,1..240] of char=( '# Pre Settings'#010+ '#####################################################################'#010+ #010+ + #010+ '[usersettings]'#010+ '#####################################################################'#010+ '# User Settings'#010+ - '###############','#####################################################'+ + '##############','######################################################'+ '#'#010+ #010+ + #010+ '[postsettings]'#010+ '#####################################################################'#010+ '# Post Settings'#010+ '#####################################################################'#010+ #010+ #010+ - '[dir_defaul','t]'#010+ + '[shelltoo','ls]'#010+ '#####################################################################'#010+ - '# Default Directories'#010+ - '#####################################################################'#010+ - #010+ - '# set the prefix directory where to install everything'#010+ - 'ifndef PREFIXINSTAL','LDIR'#010+ - 'ifdef inlinux'#010+ - 'PREFIXINSTALLDIR=/usr'#010+ - 'else'#010+ - 'PREFIXINSTALLDIR=/pp'#010+ - 'endif'#010+ - 'endif'#010+ - 'export PREFIXINSTALLDIR'#010+ - #010+ - #010+ - '[dir_install]'#010+ - '#####################################################################'#010+ - '# Install Directories'#010+ - '#############################','#######################################'+ - '#'#010+ - #010+ - '# set the base directory where to install everything'#010+ - 'ifndef BASEINSTALLDIR'#010+ - 'ifdef inlinux'#010+ - 'BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)'#010+ - 'else'#010+ - 'BASEINSTALLDIR=$(PREFIXINSTALLDIR)'#010+ - 'endif'#010+ - 'endif',#010+ - #010+ - '# set the directory where to install the binaries'#010+ - 'ifndef BININSTALLDIR'#010+ - 'ifdef inlinux'#010+ - 'BININSTALLDIR=$(PREFIXINSTALLDIR)/bin'#010+ - 'else'#010+ - 'BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)'#010+ - 'endif'#010+ - 'endif'#010+ - #010+ - '# set the directory where to install the units.'#010, - 'ifndef UNITINSTALLDIR'#010+ - 'UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)'#010+ - 'ifdef UNITSUBDIR'#010+ - 'UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)'#010+ - 'endif'#010+ - 'endif'#010+ - #010+ - '# Where to install shared libraries'#010+ - 'ifndef LIBINSTALLDIR'#010+ - 'ifdef inlinux'#010+ - 'LIBINSTALLDIR=$(P','REFIXINSTALLDIR)/lib'#010+ - 'else'#010+ - 'LIBINSTALLDIR=$(UNITINSTALLDIR)'#010+ - 'endif'#010+ - 'endif'#010+ - #010+ - '# Where the source files will be stored'#010+ - 'ifndef SOURCEINSTALLDIR'#010+ - 'ifdef inlinux'#010+ - 'SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)'#010+ - 'else'#010+ - 'SOURCEINSTALLDIR=$(BASEINS','TALLDIR)/source'#010+ - 'endif'#010+ - 'endif'#010+ - #010+ - '# Where the doc files will be stored'#010+ - 'ifndef DOCINSTALLDIR'#010+ - 'ifdef inlinux'#010+ - 'DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)'#010+ - 'else'#010+ - 'DOCINSTALLDIR=$(BASEINSTALLDIR)/doc'#010+ - 'endif'#010+ - 'endif'#010+ - #010+ - '# Where the some extra (data',')files will be stored'#010+ - 'ifndef DATAINSTALLDIR'#010+ - 'DATAINSTALLDIR=$(BASEINSTALLDIR)'#010+ - 'endif'#010+ - #010+ - #010+ - '[dir_gcclib]'#010+ - '# On linux, try to find where libgcc.a is.'#010+ - 'ifdef inlinux'#010+ - 'ifndef GCCLIBDIR'#010+ - 'GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '#039'{ print'+ - ' $','$4 } '#039'`)'#010+ - 'endif'#010+ - 'endif'#010+ - 'export GCCLIBDIR'#010+ - #010+ - #010+ - '[dir_otherlib]'#010+ - '# Where to find other libraries'#010+ - 'ifdef inlinux'#010+ - 'ifndef OTHERLIBDIR'#010+ - 'OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '#039'{ ORS=" '+ - '"; print $1 }'#039')'#010+ - 'endif'#010+ - 'endif'#010+ - 'export OTHERLIBDIR'#010+ - #010+ - #010+ - '[redi','r]'#010+ - '#####################################################################'#010+ - '# Redirection'#010+ - '#####################################################################'#010+ - #010+ - '# Release ? Then force OPT and don'#039't use extra opts via commandlin'+ - 'e'#010+ - 'ifndef REDIRFI','LE'#010+ - 'REDIRFILE=log'#010+ - 'endif'#010+ - #010+ - 'ifdef REDIR'#010+ - 'ifndef inlinux'#010+ - 'override FPC=redir -eo $(FPC)'#010+ - 'endif'#010+ - '# set the verbosity to max'#010+ - 'override FPCOPT+=-va'#010+ - 'override REDIR:= >> $(REDIRFILE)'#010+ - 'endif'#010+ - #010+ - #010+ - '[shelltools]'#010+ - '###################################################','#################'+ - '#'#010+ '# Shell tools'#010+ '#####################################################################'#010+ #010+ '# echo'#010+ 'ifndef ECHO'#010+ - 'ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))'#010+ + 'ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHP','ATH)))'+ + ')'#010+ 'ifeq ($(ECHO),)'#010+ - 'ECHO:=$(strip $(wildcard $(adds','uffix /echo$(EXEEXT),$(SEARCHPATH))))'+ - #010+ + 'ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))'#010+ 'ifeq ($(ECHO),)'#010+ 'ECHO:=echo'#010+ 'else'#010+ @@ -341,12 +218,12 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ '# To copy pograms'#010+ 'ifndef COPY'#010+ - 'COPY:=cp -fp'#010+ + 'COPY:=c','p -fp'#010+ 'endif'#010+ #010+ '# Copy a whole tree'#010+ 'ifndef COPYTREE'#010+ - 'COPYTR','EE:=cp -rfp'#010+ + 'COPYTREE:=cp -rfp'#010+ 'endif'#010+ #010+ '# To move pograms'#010+ @@ -364,10 +241,10 @@ const fpcmakeini : array[0..114,1..240] of char=( 'DELTREE:=rm -rf'#010+ 'endif'#010+ #010+ - '# To install files'#010+ + '# T','o install files'#010+ 'ifndef INSTALL'#010+ 'ifdef inlinux'#010+ - 'INSTALL:=i','nstall -m 644'#010+ + 'INSTALL:=install -m 644'#010+ 'else'#010+ 'INSTALL:=$(COPY)'#010+ 'endif'#010+ @@ -382,10 +259,10 @@ const fpcmakeini : array[0..114,1..240] of char=( 'endif'#010+ 'endif'#010+ #010+ - '# To make a directory.'#010+ + '# To make a direc','tory.'#010+ 'ifndef MKDIR'#010+ 'ifdef inlinux'#010+ - 'MKDIR:=install -m 755 ','-d'#010+ + 'MKDIR:=install -m 755 -d'#010+ 'else'#010+ 'MKDIR:=ginstall -m 755 -d'#010+ 'endif'#010+ @@ -394,152 +271,13 @@ const fpcmakeini : array[0..114,1..240] of char=( 'export ECHO COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR'#010+ #010+ #010+ - '[command_begin]'#010+ - '#####################################################################'#010+ - '# Compiler Command Line'#010+ - '#############','#######################################################'+ - '#'#010+ - #010+ - '# Load commandline OPTDEF and add FPC_CPU define'#010+ - 'override FPCOPTDEF:=-d$(CPU_TARGET)'#010+ - #010+ - '# Load commandline OPT and add target and unit dir to be sure'#010+ - 'ifneq ($(OS_TARGET),$(OS_SOURCE))'#010, - 'override FPCOPT+=-T$(OS_TARGET)'#010+ - 'endif'#010+ - #010+ - '[command_needopt]'#010+ - 'ifdef NEEDOPT'#010+ - 'override FPCOPT+=$(NEEDOPT)'#010+ - 'endif'#010+ - #010+ - #010+ - '[command_needunit]'#010+ - 'ifdef NEEDUNITDIR'#010+ - 'override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))'#010+ - 'endif'#010+ - #010+ - #010+ - '[command_unitsdir]'#010+ - 'ifdef UNITSDIR'#010+ - 'overr','ide FPCOPT+=-Fu$(UNITSDIR)'#010+ - 'endif'#010+ - #010+ - #010+ - '[command_needlib]'#010+ - 'ifdef NEEDLIBDIR'#010+ - 'override FPCOPT+=$(addprefix -Fl,$(NEEDLIBDIR))'#010+ - 'endif'#010+ - #010+ - #010+ - '[command_needobj]'#010+ - 'ifdef NEEDOBJDIR'#010+ - 'override FPCOPT+=$(addprefix -Fo,$(NEEDOBJDIR))'#010+ - 'endif'#010+ - #010+ - #010+ - '[command_needinc]'#010+ - 'ifdef',' NEEDINCDIR'#010+ - 'override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))'#010+ - 'endif'#010+ - #010+ - '[command_gcclib]'#010+ - '# Add GCC lib path if asked'#010+ - 'ifdef GCCLIBDIR'#010+ - 'override FPCOPT+=-Fl$(GCCLIBDIR)'#010+ - 'endif'#010+ - #010+ - '[command_otherlib]'#010+ - '# Add Other dirs path if asked'#010+ - 'ifdef OTHERLIBDIR'#010+ - 'over','ride FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))'#010+ - 'endif'#010+ - #010+ - '[command_target]'#010+ - '# Target dirs'#010+ - 'ifdef TARGETDIR'#010+ - 'override FPCOPT+=-FE$(TARGETDIR)'#010+ - 'endif'#010+ - #010+ - '[command_unittarget]'#010+ - 'ifdef UNITTARGETDIR'#010+ - 'override FPCOPT+=-FU$(UNITTARGETDIR)'#010+ - 'endif'#010+ - #010+ - '[command_end]'#010+ - '# ','Smartlinking'#010+ - 'ifdef SMARTLINK'#010+ - 'override FPCOPT+=-CX'#010+ - 'endif'#010+ - #010+ - '# Debug'#010+ - 'ifdef DEBUG'#010+ - 'override FPCOPT+=-g -dDEBUG'#010+ - 'endif'#010+ - #010+ - '# Release mode (strip, optimize and don'#039't load ppc386.cfg)'#010+ - 'ifdef RELEASE'#010+ - 'override FPCOPT+=-Xs -OG2p3 -n'#010+ - 'endif'#010+ - #010+ - '# Verbose setting','s (warning,note,info)'#010+ - 'ifdef VERBOSE'#010+ - 'override FPCOPT+=-vwni'#010+ - 'endif'#010+ - #010+ - '# Add commandline options'#010+ - 'ifdef OPT'#010+ - 'override FPCOPT+=$(OPT)'#010+ - 'endif'#010+ - 'ifdef UNITDIR'#010+ - 'override FPCOPT+=$(addprefix -Fu,$(UNITDIR))'#010+ - 'endif'#010+ - 'ifdef LIBDIR'#010+ - 'override FPCOPT+=$(addprefix -','Fl,$(LIBDIR))'#010+ - 'endif'#010+ - 'ifdef OBJDIR'#010+ - 'override FPCOPT+=$(addprefix -Fo,$(OBJDIR))'#010+ - 'endif'#010+ - 'ifdef INCDIR'#010+ - 'override FPCOPT+=$(addprefix -Fi,$(INCDIR))'#010+ - 'endif'#010+ - #010+ - '# Add defines from FPCOPTDEF to FPCOPT'#010+ - 'ifdef FPCOPTDEF'#010+ - 'override FPCOPT+=$(FPCOPTDEF)'#010+ - 'endif'#010+ - #010+ - '#',' Error file ?'#010+ - 'ifdef ERRORFILE'#010+ - 'override FPCOPT+=-Fr$(ERRORFILE)'#010+ - 'endif'#010+ - #010+ - '# Was a config file specified ?'#010+ - 'ifdef CFGFILE'#010+ - 'override FPCOPT+=@$(CFGFILE)'#010+ - 'endif'#010+ - #010+ - '# For win32 the options are passed using the file fpcext.cmd'#010+ - 'ifndef FPCEXTCMD'#010+ - 'FPCEXTCMD=','fpcext.cmd'#010+ - 'endif'#010+ - 'ifeq ($(OS_SOURCE),win32)'#010+ - 'override TMPVAR:=$(shell "$(DEL) $(FPCEXTCMD)")'#010+ - 'override TMPVAR:=$(foreach A,$(FPCOPT),$(shell "$(ECHO) $(A) >> $(FPCE'+ - 'XTCMD)"))'#010+ - 'override FPCOPT:=@$(FPCEXTCMD)'#010+ - 'endif'#010+ - #010+ - '# Compiler commandline'#010+ - 'override',' COMPILER:=$(FPC) $(FPCOPT)'#010+ - #010+ - #010+ '[tool_default]'#010+ - '#####################################################################'#010+ + '#####################################################','###############'+ + '#'#010+ '# Default Tools'#010+ '#####################################################################'#010+ #010+ - '# assembler, redefine it if cross comp','iling'#010+ + '# assembler, redefine it if cross compiling'#010+ 'ifndef AS'#010+ 'AS=as'#010+ 'endif'#010+ @@ -549,7 +287,7 @@ const fpcmakeini : array[0..114,1..240] of char=( 'LD=ld'#010+ 'endif'#010+ #010+ - '# ppas.bat / ppas.sh'#010+ + '# ppas.bat / p','pas.sh'#010+ 'ifdef inlinux'#010+ 'PPAS=ppas.sh'#010+ 'else'#010+ @@ -561,13 +299,13 @@ const fpcmakeini : array[0..114,1..240] of char=( 'endif'#010+ #010+ '# also call ppas if with command option -s'#010+ - 'if','eq (,$(findstring -s ,$(COMPILER)))'#010+ + 'ifeq (,$(findstring -s ,$(COMPILER)))'#010+ 'EXECPPAS='#010+ 'else'#010+ 'EXECPPAS:=@$(PPAS)'#010+ 'endif'#010+ #010+ - '# ldconfig to rebuild .so cache'#010+ + '# ldconfig to rebuild',' .so cache'#010+ 'ifdef inlinux'#010+ 'LDCONFIG=ldconfig'#010+ 'else'#010+ @@ -577,14 +315,14 @@ const fpcmakeini : array[0..114,1..240] of char=( '[tool_ppdep]'#010+ '# ppdep'#010+ 'ifndef PPDEP'#010+ - 'PPDEP:=$(strip $(wildcard $(addsuffix /ppde','p$(EXEEXT),$(SEARCHPATH))'+ - '))'#010+ + 'PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))'+ + #010+ 'ifeq ($(PPDEP),)'#010+ 'PPDEP='#010+ 'else'#010+ 'PPDEP:=$(firstword $(PPDEP))'#010+ 'endif'#010+ - 'endif'#010+ + 'endif'#010, 'export PPDEP'#010+ #010+ '[tool_ppumove]'#010+ @@ -592,7 +330,7 @@ const fpcmakeini : array[0..114,1..240] of char=( 'ifndef PPUMOVE'#010+ 'PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH'+ '))))'#010+ - 'ifeq ($(PPUMO','VE),)'#010+ + 'ifeq ($(PPUMOVE),)'#010+ 'PPUMOVE='#010+ 'else'#010+ 'PPUMOVE:=$(firstword $(PPUMOVE))'#010+ @@ -601,27 +339,27 @@ const fpcmakeini : array[0..114,1..240] of char=( 'export PPUMOVE'#010+ #010+ '[tool_ppufiles]'#010+ - '# ppufiles'#010+ + '#',' ppufiles'#010+ 'ifndef PPUFILES'#010+ 'PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPA'+ 'TH))))'#010+ 'ifeq ($(PPUFILES),)'#010+ 'PPUFILES='#010+ 'else'#010+ - 'PPUF','ILES:=$(firstword $(PPUFILES))'#010+ + 'PPUFILES:=$(firstword $(PPUFILES))'#010+ 'endif'#010+ 'endif'#010+ 'export PPUFILES'#010+ #010+ '[tool_data2inc]'#010+ '# data2inc'#010+ - 'ifndef DATA2INC'#010+ + 'ifndef DATA','2INC'#010+ 'DATA2INC:=$(strip $(wildcard $(addsuffix /data2inc$(EXEEXT),$(SEARCHPA'+ 'TH))))'#010+ 'ifeq ($(DATA2INC),)'#010+ 'DATA2INC='#010+ 'else'#010+ - 'DATA2INC:=$(firstword $(D','ATA2INC))'#010+ + 'DATA2INC:=$(firstword $(DATA2INC))'#010+ 'endif'#010+ 'endif'#010+ 'export DATA2INC'#010+ @@ -629,7 +367,8 @@ const fpcmakeini : array[0..114,1..240] of char=( '[tool_diff]'#010+ '# diff'#010+ 'ifndef DIFF'#010+ - 'DIFF:=$(strip $(wildcard $(addsuffix /diff$(EXEEXT),$(SEARCHPATH))))'#010+ + 'DIFF:=$(strip $(wildcard $(a','ddsuffix /diff$(EXEEXT),$(SEARCHPATH))))'+ + #010+ 'ifeq ($(DIFF),)'#010+ 'DIFF='#010+ 'else'#010+ @@ -640,11 +379,11 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ '[tool_cmp]'#010+ '# cmp'#010+ - 'ifnde','f CMP'#010+ + 'ifndef CMP'#010+ 'CMP:=$(strip $(wildcard $(addsuffix /cmp$(EXEEXT),$(SEARCHPATH))))'#010+ 'ifeq ($(CMP),)'#010+ 'CMP='#010+ - 'else'#010+ + 'else'#010, 'CMP:=$(firstword $(CMP))'#010+ 'endif'#010+ 'endif'#010+ @@ -653,7 +392,7 @@ const fpcmakeini : array[0..114,1..240] of char=( '[tool_sed]'#010+ '# Sed'#010+ 'ifndef SED'#010+ - 'SED:=$(strip $(wildcard $(addsuffix /sed$(EXEEXT),$(SEARCHPATH)))',')'#010+ + 'SED:=$(strip $(wildcard $(addsuffix /sed$(EXEEXT),$(SEARCHPATH))))'#010+ 'ifeq ($(SED),)'#010+ 'SED='#010+ 'else'#010+ @@ -663,19 +402,19 @@ const fpcmakeini : array[0..114,1..240] of char=( 'export SED'#010+ #010+ '[tool_upx]'#010+ - '# Look if UPX is found for go32v2 and win32. We can'#039't use $UPX bec'+ - 'uase'#010+ + '# Look if U','PX is found for go32v2 and win32. We can'#039't use $UPX b'+ + 'ecuase'#010+ '# upx uses that one itself (PFV)'#010+ 'ifndef UPXPROG'#010+ 'ifeq ($(OS_TARGET),go32v2)'#010+ - 'UPXPROG',':=1'#010+ + 'UPXPROG:=1'#010+ 'endif'#010+ 'ifeq ($(OS_TARGET),win32)'#010+ 'UPXPROG:=1'#010+ 'endif'#010+ 'ifdef UPXPROG'#010+ - 'UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))'+ - #010+ + 'UPXPROG:=$(strip $(wildcard $(a','ddsuffix /upx$(EXEEXT),$(SEARCHPATH))'+ + '))'#010+ 'ifeq ($(UPXPROG),)'#010+ 'UPXPROG='#010+ 'else'#010+ @@ -685,18 +424,19 @@ const fpcmakeini : array[0..114,1..240] of char=( 'UPXPROG='#010+ 'endif'#010+ 'endif'#010+ - 'expo','rt UPXPROG'#010+ + 'export UPXPROG'#010+ #010+ '[tool_date]'#010+ '# gdate/date'#010+ 'ifndef DATE'#010+ - 'DATE:=$(strip $(wildcard $(addsuffix /date$(EXEEXT),$(SEARCHPATH))))'#010+ + 'DATE:=$(strip $(wildcard $(addsuffix /date$(EXEEX','T),$(SEARCHPATH))))'+ + #010+ 'ifeq ($(DATE),)'#010+ 'DATE:=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH))))'#010+ 'ifeq ($(DATE),)'#010+ 'DATE='#010+ 'else'#010+ - 'DATE:=$(fi','rstword $(DATE))'#010+ + 'DATE:=$(firstword $(DATE))'#010+ 'endif'#010+ 'else'#010+ 'DATE:=$(firstword $(DATE))'#010+ @@ -705,7 +445,7 @@ const fpcmakeini : array[0..114,1..240] of char=( 'export DATE'#010+ #010+ 'ifdef DATE'#010+ - 'DATESTR:=$(shell $(DATE) +%Y%m%d)'#010+ + 'DATESTR',':=$(shell $(DATE) +%Y%m%d)'#010+ 'else'#010+ 'DATESTR='#010+ 'endif'#010+ @@ -713,12 +453,12 @@ const fpcmakeini : array[0..114,1..240] of char=( '[tool_zip]'#010+ '# ZipProg, you can'#039't use Zip as the var name (PFV)'#010+ 'ifndef ZIPPROG'#010+ - 'ZIPPROG:=$(strip ','$(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))'+ - '))'#010+ + 'ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))'+ + #010+ 'ifeq ($(ZIPPROG),)'#010+ 'ZIPPROG='#010+ 'else'#010+ - 'ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r'#010+ + 'ZIPPROG:=$(','firstword $(ZIPPROG)) -D9 -r'#010+ 'endif'#010+ 'endif'#010+ 'export ZIPPROG'#010+ @@ -729,10 +469,10 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ #010+ '[extensions]'#010+ - '######################################','##############################'+ - '#'#010+ - '# Default extensions'#010+ '#####################################################################'#010+ + '# Default extensions'#010+ + '#############################################','#######################'+ + '#'#010+ #010+ '# Default needed extensions (Go32v2,Linux)'#010+ 'LOADEREXT=.as'#010+ @@ -741,14 +481,14 @@ const fpcmakeini : array[0..114,1..240] of char=( 'OEXT=.o'#010+ 'ASMEXT=.s'#010+ 'SMARTEXT=.sl'#010+ - 'STAT','ICLIBEXT=.a'#010+ + 'STATICLIBEXT=.a'#010+ 'SHAREDLIBEXT=.so'#010+ 'RSTEXT=.rst'#010+ 'PACKAGESUFFIX='#010+ 'FPCMADE=fpcmade'#010+ #010+ '# Go32v1'#010+ - 'ifeq ($(OS_TARGET),go32v1)'#010+ + 'ifeq ($(OS_TARGE','T),go32v1)'#010+ 'PPUEXT=.pp1'#010+ 'OEXT=.o1'#010+ 'ASMEXT=.s1'#010+ @@ -759,14 +499,14 @@ const fpcmakeini : array[0..114,1..240] of char=( 'FPCMADE=fpcmade.v1'#010+ 'endif'#010+ #010+ - '# Go32v','2'#010+ + '# Go32v2'#010+ 'ifeq ($(OS_TARGET),go32v2)'#010+ 'PACKAGESUFFIX=go32'#010+ 'FPCMADE=fpcmade.dos'#010+ 'endif'#010+ #010+ '# Linux'#010+ - 'ifeq ($(OS_TARGET),linux)'#010+ + 'ifeq ($(OS_TARG','ET),linux)'#010+ 'PACKAGESUFFIX=linux'#010+ 'FPCMADE=fpcmade.lnx'#010+ 'endif'#010+ @@ -777,14 +517,14 @@ const fpcmakeini : array[0..114,1..240] of char=( 'OEXT=.ow'#010+ 'ASMEXT=.sw'#010+ 'SMARTEXT=.slw'#010+ - 'STAT','ICLIBEXT=.aw'#010+ + 'STATICLIBEXT=.aw'#010+ 'SHAREDLIBEXT=.dll'#010+ 'PACKAGESUFFIX=w32'#010+ 'FPCMADE=fpcmade.w32'#010+ 'endif'#010+ #010+ '# OS/2'#010+ - 'ifeq ($(OS_TARGET),os2)'#010+ + 'ifeq ($(OS_TARG','ET),os2)'#010+ 'PPUEXT=.ppo'#010+ 'ASMEXT=.so2'#010+ 'OEXT=.oo2'#010+ @@ -795,23 +535,23 @@ const fpcmakeini : array[0..114,1..240] of char=( 'FPCMADE=fpcmade.os2'#010+ 'endif'#010+ #010+ - '# lib','rary prefix'#010+ + '# library prefix'#010+ 'LIBPREFIX=lib'#010+ 'ifeq ($(OS_TARGET),go32v2)'#010+ 'LIBPREFIX='#010+ 'endif'#010+ 'ifeq ($(OS_TARGET),go32v1)'#010+ - 'LIBPREFIX='#010+ + 'L','IBPREFIX='#010+ 'endif'#010+ #010+ '# determine which .pas extension is used'#010+ 'ifndef PASEXT'#010+ 'ifdef EXEOBJECTS'#010+ - 'override TESTPAS:=$(strip $(wildcard $(addsuffix .pas',',$(firstword $('+ - 'EXEOBJECTS)))))'#010+ + 'override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(EX'+ + 'EOBJECTS)))))'#010+ 'else'#010+ - 'override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(UN'+ - 'ITOBJECTS)))))'#010+ + 'override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstw','ord $('+ + 'UNITOBJECTS)))))'#010+ 'endif'#010+ 'ifeq ($(TESTPAS),)'#010+ 'PASEXT=.pp'#010+ @@ -820,8 +560,273 @@ const fpcmakeini : array[0..114,1..240] of char=( 'endif'#010+ 'endif'#010+ #010+ + #010+ + '[dir_default]'#010+ + '#####################################################################'#010+ + '# Default Directories'#010+ + '############################################','########################'+ + '#'#010+ + #010+ + '# set the prefix directory where to install everything'#010+ + 'ifndef PREFIXINSTALLDIR'#010+ + 'ifdef inlinux'#010+ + 'PREFIXINSTALLDIR=/usr'#010+ + 'else'#010+ + 'PREFIXINSTALLDIR=/pp'#010+ + 'endif'#010+ + 'endif'#010+ + 'export PREFIXINSTALLDIR'#010+ + #010+ + #010+ + '[dir_install]'#010+ + '####################','################################################'+ + '#'#010+ + '# Install Directories'#010+ + '#####################################################################'#010+ + #010+ + '# set the base directory where to install everything'#010+ + 'ifndef BASEINSTALLDIR'#010+ + 'ifdef inlinux'#010+ + 'BASEINST','ALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)'#010+ + 'else'#010+ + 'BASEINSTALLDIR=$(PREFIXINSTALLDIR)'#010+ + 'endif'#010+ + 'endif'#010+ + #010+ + '# set the directory where to install the binaries'#010+ + 'ifndef BININSTALLDIR'#010+ + 'ifdef inlinux'#010+ + 'BININSTALLDIR=$(PREFIXINSTALLDIR)/bin'#010+ + 'else'#010+ + 'BININSTAL','LDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)'#010+ + 'endif'#010+ + 'endif'#010+ + #010+ + '# set the directory where to install the units.'#010+ + 'ifndef UNITINSTALLDIR'#010+ + 'UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET)'#010+ + 'ifdef UNITSUBDIR'#010+ + 'UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR)'#010, + 'endif'#010+ + 'endif'#010+ + #010+ + '# Where to install shared libraries'#010+ + 'ifndef LIBINSTALLDIR'#010+ + 'ifdef inlinux'#010+ + 'LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib'#010+ + 'else'#010+ + 'LIBINSTALLDIR=$(UNITINSTALLDIR)'#010+ + 'endif'#010+ + 'endif'#010+ + #010+ + '# Where the source files will be stored'#010+ + 'ifndef SOURCEINSTALLDIR'#010+ + 'ifde','f inlinux'#010+ + 'SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)'#010+ + 'else'#010+ + 'SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source'#010+ + 'endif'#010+ + 'endif'#010+ + #010+ + '# Where the doc files will be stored'#010+ + 'ifndef DOCINSTALLDIR'#010+ + 'ifdef inlinux'#010+ + 'DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/','fpc-$(FPC_VERSION)'#010+ + 'else'#010+ + 'DOCINSTALLDIR=$(BASEINSTALLDIR)/doc'#010+ + 'endif'#010+ + 'endif'#010+ + #010+ + '# Where the some extra (data)files will be stored'#010+ + 'ifndef DATAINSTALLDIR'#010+ + 'DATAINSTALLDIR=$(BASEINSTALLDIR)'#010+ + 'endif'#010+ + #010+ + #010+ + '[dir_gcclib]'#010+ + '# On linux, try to find where libgcc.a is','.'#010+ + 'ifdef inlinux'#010+ + 'ifndef GCCLIBDIR'#010+ + 'GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '#039'{ print'+ + ' $$4 } '#039'`)'#010+ + 'endif'#010+ + 'endif'#010+ + 'export GCCLIBDIR'#010+ + #010+ + #010+ + '[dir_otherlib]'#010+ + '# Where to find other libraries'#010+ + 'ifdef inlinux'#010+ + 'ifndef OTHERLIBDIR'#010+ + 'OTHERLIBDIR:=$(shel','l grep -v "^\#" /etc/ld.so.conf | awk '#039'{ ORS='+ + '" "; print $1 }'#039')'#010+ + 'endif'#010+ + 'endif'#010+ + 'export OTHERLIBDIR'#010+ + #010+ + #010+ + '[redir]'#010+ + '#####################################################################'#010+ + '# Redirection'#010+ + '####################################################','################'+ + '#'#010+ + #010+ + '# Release ? Then force OPT and don'#039't use extra opts via commandlin'+ + 'e'#010+ + 'ifndef REDIRFILE'#010+ + 'REDIRFILE=log'#010+ + 'endif'#010+ + #010+ + 'ifdef REDIR'#010+ + 'ifndef inlinux'#010+ + 'override FPC=redir -eo $(FPC)'#010+ + 'endif'#010+ + '# set the verbosity to max'#010+ + 'override FPCOPT+=-va'#010+ + 'over','ride REDIR:= >> $(REDIRFILE)'#010+ + 'endif'#010+ + #010+ + '[command_begin]'#010+ + '#####################################################################'#010+ + '# Compiler Command Line'#010+ + '#####################################################################'#010+ + #010+ + '# Load commandline OPTD','EF and add FPC_CPU define'#010+ + 'override FPCOPTDEF:=-d$(CPU_TARGET)'#010+ + #010+ + '# Load commandline OPT and add target and unit dir to be sure'#010+ + 'ifneq ($(OS_TARGET),$(OS_SOURCE))'#010+ + 'override FPCOPT+=-T$(OS_TARGET)'#010+ + 'endif'#010+ + #010+ + '[command_needopt]'#010+ + 'ifdef NEEDOPT'#010+ + 'override F','PCOPT+=$(NEEDOPT)'#010+ + 'endif'#010+ + #010+ + #010+ + '[command_needunit]'#010+ + 'ifdef NEEDUNITDIR'#010+ + 'override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))'#010+ + 'endif'#010+ + #010+ + #010+ + '[command_unitsdir]'#010+ + 'ifdef UNITSDIR'#010+ + 'override FPCOPT+=-Fu$(UNITSDIR)'#010+ + 'endif'#010+ + #010+ + #010+ + '[command_needlib]'#010+ + 'ifdef NEEDLIBDIR'#010+ + 'override FP','COPT+=$(addprefix -Fl,$(NEEDLIBDIR))'#010+ + 'endif'#010+ + #010+ + #010+ + '[command_needobj]'#010+ + 'ifdef NEEDOBJDIR'#010+ + 'override FPCOPT+=$(addprefix -Fo,$(NEEDOBJDIR))'#010+ + 'endif'#010+ + #010+ + #010+ + '[command_needinc]'#010+ + 'ifdef NEEDINCDIR'#010+ + 'override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))'#010+ + 'endif'#010+ + #010+ + '[command_gccli','b]'#010+ + '# Add GCC lib path if asked'#010+ + 'ifdef GCCLIBDIR'#010+ + 'override FPCOPT+=-Fl$(GCCLIBDIR)'#010+ + 'endif'#010+ + #010+ + '[command_otherlib]'#010+ + '# Add Other dirs path if asked'#010+ + 'ifdef OTHERLIBDIR'#010+ + 'override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))'#010+ + 'endif'#010+ + #010+ + '[command_target]'#010+ + '# Target dir','s'#010+ + 'ifdef TARGETDIR'#010+ + 'override FPCOPT+=-FE$(TARGETDIR)'#010+ + 'endif'#010+ + #010+ + '[command_unittarget]'#010+ + 'ifdef UNITTARGETDIR'#010+ + 'override FPCOPT+=-FU$(UNITTARGETDIR)'#010+ + 'endif'#010+ + #010+ + '[command_end]'#010+ + '# Smartlinking'#010+ + 'ifdef SMARTLINK'#010+ + 'override FPCOPT+=-CX'#010+ + 'endif'#010+ + #010+ + '# Debug'#010+ + 'ifdef DEBUG'#010+ + 'over','ride FPCOPT+=-g -dDEBUG'#010+ + 'endif'#010+ + #010+ + '# Release mode (strip, optimize and don'#039't load ppc386.cfg)'#010+ + 'ifdef RELEASE'#010+ + 'override FPCOPT+=-Xs -OG2p3 -n'#010+ + 'endif'#010+ + #010+ + '# Verbose settings (warning,note,info)'#010+ + 'ifdef VERBOSE'#010+ + 'override FPCOPT+=-vwni'#010+ + 'endif'#010+ + #010+ + '# Add commandli','ne options'#010+ + 'ifdef OPT'#010+ + 'override FPCOPT+=$(OPT)'#010+ + 'endif'#010+ + 'ifdef UNITDIR'#010+ + 'override FPCOPT+=$(addprefix -Fu,$(UNITDIR))'#010+ + 'endif'#010+ + 'ifdef LIBDIR'#010+ + 'override FPCOPT+=$(addprefix -Fl,$(LIBDIR))'#010+ + 'endif'#010+ + 'ifdef OBJDIR'#010+ + 'override FPCOPT+=$(addprefix -Fo,$(OBJDIR))'#010+ + 'endi','f'#010+ + 'ifdef INCDIR'#010+ + 'override FPCOPT+=$(addprefix -Fi,$(INCDIR))'#010+ + 'endif'#010+ + #010+ + '# Add defines from FPCOPTDEF to FPCOPT'#010+ + 'ifdef FPCOPTDEF'#010+ + 'override FPCOPT+=$(FPCOPTDEF)'#010+ + 'endif'#010+ + #010+ + '# Error file ?'#010+ + 'ifdef ERRORFILE'#010+ + 'override FPCOPT+=-Fr$(ERRORFILE)'#010+ + 'endif'#010+ + #010+ + '# Was a con','fig file specified ?'#010+ + 'ifdef CFGFILE'#010+ + 'override FPCOPT+=@$(CFGFILE)'#010+ + 'endif'#010+ + #010+ + '# For win32 the options are passed using the file fpcext.cmd'#010+ + 'ifndef FPCEXTCMD'#010+ + 'FPCEXTCMD=fpcext.cmd'#010+ + 'endif'#010+ + 'ifeq ($(OS_SOURCE),win32)'#010+ + 'override TMPVAR:=$(shell "$(DEL) $(FPC','EXTCMD)")'#010+ + 'override TMPVAR:=$(foreach A,$(FPCOPT),$(shell "$(ECHO) $(A) >> $(FPCE'+ + 'XTCMD)"))'#010+ + 'override FPCOPT:=@$(FPCEXTCMD)'#010+ + 'endif'#010+ + #010+ + '# Compiler commandline'#010+ + 'override COMPILER:=$(FPC) $(FPCOPT)'#010+ + #010+ + #010+ '[standardrules]'#010+ - '#####################################','###############################'+ + '###################################','#################################'+ '#'#010+ '# Standard rules'#010+ '#####################################################################'#010+ @@ -829,7 +834,7 @@ const fpcmakeini : array[0..114,1..240] of char=( '[packagedependrules]'#010+ '#####################################################################'#010+ '# Package depends'#010+ - '##########','##########################################################'+ + '########','############################################################'+ '#'#010+ #010+ '[loaderrules]'#010+ @@ -837,7 +842,7 @@ const fpcmakeini : array[0..114,1..240] of char=( '# Loaders'#010+ '#####################################################################'#010+ #010+ - '.PHONY: fpc_lo','aders'#010+ + '.PHONY: fpc_','loaders'#010+ #010+ '%$(OEXT): %$(LOADEREXT)'#010+ ' $(AS) -o $*$(OEXT) $<'#010+ @@ -847,7 +852,7 @@ const fpcmakeini : array[0..114,1..240] of char=( 'override SHOWINSTALLTARGET+=fpc_loaders_showinstall'#010+ 'override INSTALLTARGET+=fpc_loaders_install'#010+ #010+ - 'override ','LOADEROFILES:=$(addsuffix $(OEXT),$(LOADEROBJECTS))'#010+ + 'overrid','e LOADEROFILES:=$(addsuffix $(OEXT),$(LOADEROBJECTS))'#010+ #010+ 'fpc_loaders: $(LOADEROFILES)'#010+ #010+ @@ -858,7 +863,7 @@ const fpcmakeini : array[0..114,1..240] of char=( ' @$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(LOADEROFILES)'+ ')'#010+ #010+ - 'fpc_loa','ders_install:'#010+ + 'fpc_l','oaders_install:'#010+ ' $(MKDIR) $(UNITINSTALLDIR)'#010+ ' $(INSTALL) $(LOADEROFILES) $(UNITINSTALLDIR)'#010+ #010+ @@ -866,7 +871,7 @@ const fpcmakeini : array[0..114,1..240] of char=( '[unitrules]'#010+ '#####################################################################'#010+ '# Units'#010+ - '##############################################','######################'+ + '############################################','########################'+ '#'#010+ #010+ '.PHONY: fpc_units'#010+ @@ -877,7 +882,7 @@ const fpcmakeini : array[0..114,1..240] of char=( 'override INSTALLPPUFILES+=$(UNITPPUFILES)'#010+ 'override CLEANPPUFILES+=$(UNITPPUFILES)'#010+ #010+ - 'fpc_units: $(UNITPPUFI','LES)'#010+ + 'fpc_units: $(UNITPPU','FILES)'#010+ #010+ #010+ #010+ @@ -888,7 +893,7 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ '.PHONY: fpc_exes'#010+ #010+ - 'override EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))'#010, + 'override EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS)',')'#010+ 'override EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))'#010+ #010+ 'override ALLTARGET+=fpc_exes'#010+ @@ -899,7 +904,7 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ #010+ '[rstrules]'#010+ - '#################################','###################################'+ + '###############################','#####################################'+ '#'#010+ '# Resource strings'#010+ '#####################################################################'#010+ @@ -910,14 +915,14 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ #010+ '[examplerules]'#010+ - '####','################################################################'+ + '##','##################################################################'+ '#'#010+ '# Examples'#010+ '#####################################################################'#010+ #010+ '.PHONY: fpc_examples fpc_test'#010+ #010+ - 'override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS','))'#010+ + 'override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(EXAMPLEOBJEC','TS))'#010+ 'override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS))'#010+ #010+ 'override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)'#010+ @@ -929,7 +934,7 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ #010+ '[compilerules]'#010+ - '###########################################','#########################'+ + '#########################################','###########################'+ '#'#010+ '# General compile rules'#010+ '#####################################################################'#010+ @@ -939,7 +944,7 @@ const fpcmakeini : array[0..114,1..240] of char=( '$(FPCMADE): $(ALLTARGET)'#010+ ' @$(ECHO) Compiled > $(FPCMADE)'#010+ #010+ - 'fpc_packages:',' $(addsuffix _package,$(COMPILEPACKAGES))'#010+ + 'fpc_package','s: $(COMPILEPACKAGES)'#010+ #010+ 'fpc_all: fpc_packages $(FPCMADE)'#010+ #010+ @@ -950,8 +955,8 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ '.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp'#010+ #010+ - '%$(PPUEXT): %','.pp'#010+ - ' $(COMPILER) $< $(REDIR)'#010+ + '%$(PPUEXT): %.pp'#010+ + ' $(COMPIL','ER) $< $(REDIR)'#010+ ' $(EXECPASS)'#010+ #010+ '%$(PPUEXT): %.pas'#010+ @@ -963,8 +968,8 @@ const fpcmakeini : array[0..114,1..240] of char=( ' $(EXECPASS)'#010+ #010+ '%$(EXEEXT): %.pas'#010+ - ' $(COMPILER) $< $','(REDIR)'#010+ - ' $(EXECPASS)'#010+ + ' $(COMPILER) $< $(REDIR)'#010+ + ' $(EX','ECPASS)'#010+ #010+ #010+ '[libraryrules]'#010+ @@ -974,7 +979,7 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ '.PHONY: fpc_smart fpc_shared'#010+ #010+ - '# Default shar','edlib units are all unit objects'#010+ + '# Default sharedlib units are all ','unit objects'#010+ 'ifndef SHAREDLIBUNITOBJECTS'#010+ 'SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)'#010+ 'endif'#010+ @@ -987,7 +992,7 @@ const fpcmakeini : array[0..114,1..240] of char=( 'ifndef LIBNAME'#010+ ' @$(ECHO) "LIBNAME not set"'#010+ 'else'#010+ - ' ',' $(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)'#010+ + ' $(PPUMOVE) $(SHARE','DLIBUNITOBJECTS) -o$(LIBNAME)'#010+ 'endif'#010+ 'else'#010+ ' @$(ECHO) "Shared Libraries not supported"'#010+ @@ -997,7 +1002,7 @@ const fpcmakeini : array[0..114,1..240] of char=( '[installrules]'#010+ '#####################################################################'#010+ '# Install rules'#010+ - '####################','################################################'+ + '########################################','############################'+ '#'#010+ #010+ '.PHONY: fpc_showinstall fpc_install'#010+ @@ -1008,14 +1013,14 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ 'ifdef INSTALLPPUFILES'#010+ 'ifdef PPUFILES'#010+ - 'ifdef inlinux'#010, - 'INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))'#010+ + 'ifdef inlinux'#010+ + 'INSTALLPPULINKFILES:','=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))'#010+ 'INSTALLPPULIBFILES:=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))'#010+ 'else'#010+ 'INSTALLPPULINKFILES:=$(shell $(PPUFILES) $(INSTALLPPUFILES))'#010+ 'endif'#010+ 'else'#010+ - 'INSTALLPPULINKFILES:=$(wildcard $','(subst $(PPUEXT),$(OEXT),$(INSTALLP'+ + 'INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(O','EXT),$(INSTALLP'+ 'PUFILES)))'#010+ 'endif'#010+ 'endif'#010+ @@ -1026,14 +1031,14 @@ const fpcmakeini : array[0..114,1..240] of char=( 'S))'#010+ 'endif'#010+ 'ifdef INSTALLPPUFILES'#010+ - ' @$(ECHO) -e',' $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUF'+ + ' @$(ECHO) -e $(addprefix "\n"$(U','NITINSTALLDIR)/,$(INSTALLPPUF'+ 'ILES))'#010+ 'ifneq ($(INSTALLPPULINKFILES),)'#010+ ' @$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULIN'+ 'KFILES))'#010+ 'endif'#010+ 'ifneq ($(INSTALLPPULIBFILES),)'#010+ - ' @$(ECHO) -e $(addprefix "\n"','$(LIBINSTALLDIR)/,$(INSTALLPPULI'+ + ' @$(ECHO) -e $(addprefix "\n"$(LIBINSTALLDIR)/,$(','INSTALLPPULI'+ 'BFILES))'#010+ 'endif'#010+ 'endif'#010+ @@ -1045,7 +1050,7 @@ const fpcmakeini : array[0..114,1..240] of char=( 'fpc_install: $(INSTALLTARGET)'#010+ '# Create UnitInstallFiles'#010+ 'ifdef INSTALLEXEFILES'#010+ - ' ',' $(MKDIR) $(BININSTALLDIR)'#010+ + ' $(MKDIR) $(BI','NINSTALLDIR)'#010+ '# Compress the exes if upx is defined'#010+ 'ifdef UPXPROG'#010+ ' -$(UPXPROG) $(INSTALLEXEFILES)'#010+ @@ -1053,14 +1058,14 @@ const fpcmakeini : array[0..114,1..240] of char=( ' $(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)'#010+ 'endif'#010+ 'ifdef INSTALLPPUFILES'#010+ - ' $(MKDIR) $(UNITI','NSTALLDIR)'#010+ - ' $(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)'#010+ + ' $(MKDIR) $(UNITINSTALLDIR)'#010+ + ' $','(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)'#010+ 'ifneq ($(INSTALLPPULINKFILES),)'#010+ ' $(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)'#010+ 'endif'#010+ 'ifneq ($(INSTALLPPULIBFILES),)'#010+ ' $(MKDIR) $(LIBINSTALLDIR)'#010+ - ' $(','INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)'#010+ + ' $(INSTALL) $(INSTALLPP','ULIBFILES) $(LIBINSTALLDIR)'#010+ 'endif'#010+ 'endif'#010+ 'ifdef EXTRAINSTALLFILES'#010+ @@ -1070,7 +1075,7 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ #010+ '[sourceinstallrules]'#010+ - '##################################','##################################'+ + '######################################################','##############'+ '#'#010+ '# Source install rules'#010+ '#####################################################################'#010+ @@ -1079,7 +1084,7 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ 'fpc_sourceinstall: clean'#010+ ' $(MKDIR) $(SOURCEINSTALLDIR)'#010+ - ' $(COPYTREE) $','(BASEDIR) $(SOURCEINSTALLDIR)'#010+ + ' $(COPYTREE) $(BASEDIR) $(SOURCEIN','STALLDIR)'#010+ #010+ '[zipinstallrules]'#010+ '#####################################################################'#010+ @@ -1088,10 +1093,10 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ '.PHONY: fpc_zipinstall fpc_zipinstalladd'#010+ #010+ - '# ','Temporary path to pack a file'#010+ + '# Temporary path to pa','ck a file'#010+ 'ifndef PACKDIR'#010+ 'ifndef inlinux'#010+ - 'PACKDIR=pack_tmp'#010+ + 'PACKDIR=$(BASEDIR)/pack_tmp'#010+ 'else'#010+ 'PACKDIR=/tmp/fpc-pack'#010+ 'endif'#010+ @@ -1102,8 +1107,8 @@ const fpcmakeini : array[0..114,1..240] of char=( 'DESTZIPDIR:=$(BASEDIR)'#010+ 'endif'#010+ #010+ - '# Maybe create default zipname from packagenam','e'#010+ - 'ifndef ZIPNAME'#010+ + '# Maybe create default zipname from packagename'#010+ + 'ifndef ','ZIPNAME'#010+ 'ifdef PACKAGENAME'#010+ 'ZIPNAME=$(PACKAGENAME)$(PACKAGESUFFIX)'#010+ 'endif'#010+ @@ -1116,8 +1121,8 @@ const fpcmakeini : array[0..114,1..240] of char=( 'endif'#010+ 'endif'#010+ #010+ - '# Note: This will not remove the zipfile fir','st'#010+ - 'fpc_zipinstalladd:'#010+ + '# Note: This will not remove the zipfile first'#010+ + 'fpc_zi','pinstalladd:'#010+ 'ifndef ZIPNAME'#010+ ' @$(ECHO) "Please specify ZIPNAME!"'#010+ ' @exit 1'#010+ @@ -1125,7 +1130,7 @@ const fpcmakeini : array[0..114,1..240] of char=( ' $(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)'#010+ 'ifdef inlinux'#010+ ' gzip -d $(DESTZIPDIR)/$(ZIPNAME).tar.gz'#010+ - ' cd $(PACKDIR',') ; tar rv --file $(DESTZIPDIR)/$(ZIPNAME).tar *'+ + ' cd $(PACKDIR) ; tar r','v --file $(DESTZIPDIR)/$(ZIPNAME).tar *'+ ' ; cd $(BASEDIR)'#010+ ' gzip $(DESTZIPDIR)/$(ZIPNAME).tar'#010+ 'else'#010+ @@ -1135,7 +1140,7 @@ const fpcmakeini : array[0..114,1..240] of char=( ' $(DELTREE) $(PACKDIR)'#010+ 'endif'#010+ #010+ - '# First',' remove the zip and then install'#010+ + '# First remove t','he zip and then install'#010+ 'fpc_zipinstall:'#010+ 'ifndef ZIPNAME'#010+ ' @$(ECHO) "Please specify ZIPNAME!"'#010+ @@ -1144,7 +1149,7 @@ const fpcmakeini : array[0..114,1..240] of char=( ' $(DEL) $(DESTZIPDIR)/$(ZIPNAME)'#010+ ' $(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)'#010+ 'ifdef inlinux'#010+ - ' ',' cd $(PACKDIR) ; tar cvz --file $(DESTZIPDIR)/$(ZIPNAME).tar.'+ + ' cd',' $(PACKDIR) ; tar cvz --file $(DESTZIPDIR)/$(ZIPNAME).tar.'+ 'gz * ; cd $(BASEDIR)'#010+ 'else'#010+ ' cd $(PACKDIR) ; $(ZIPPROG) $(DESTZIPDIR)/$(ZIPNAME) * ; cd $(B'+ @@ -1155,7 +1160,7 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ #010+ '[cleanrules]'#010+ - '############','########################################################'+ + '#####################','###############################################'+ '#'#010+ '# Clean rules'#010+ '#####################################################################'#010+ @@ -1163,7 +1168,7 @@ const fpcmakeini : array[0..114,1..240] of char=( '.PHONY: fpc_clean fpc_cleanall'#010+ #010+ 'ifdef EXTRACLEANUNITS'#010+ - 'override CLEANPPUFILES+=$(addsuffix $(PPUEX','T),$(EXTRACLEANUNITS))'#010+ + 'override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTR','ACLEANUNITS))'#010+ 'endif'#010+ #010+ 'ifdef CLEANPPUFILES'#010+ @@ -1175,8 +1180,8 @@ const fpcmakeini : array[0..114,1..240] of char=( 'endif'#010+ 'endif'#010+ #010+ - 'fpc_clean: $(CLEANTARGET)',#010+ - 'ifdef CLEANEXEFILES'#010+ + 'fpc_clean: $(CLEANTARGET)'#010+ + 'ifdef CL','EANEXEFILES'#010+ ' -$(DEL) $(CLEANEXEFILES)'#010+ 'endif'#010+ 'ifdef CLEANPPUFILES'#010+ @@ -1186,8 +1191,8 @@ const fpcmakeini : array[0..114,1..240] of char=( ' -$(DEL) $(CLEANPPULINKFILES)'#010+ 'endif'#010+ 'ifdef CLEANRSTFILES'#010+ - ' -$(DEL) $(CLEANRSTFI','LES)'#010+ - 'endif'#010+ + ' -$(DEL) $(CLEANRSTFILES)'#010+ + 'endi','f'#010+ 'ifdef EXTRACLEANFILES'#010+ ' -$(DEL) $(EXTRACLEANFILES)'#010+ 'endif'#010+ @@ -1197,14 +1202,14 @@ const fpcmakeini : array[0..114,1..240] of char=( 'ifdef CLEANEXEFILES'#010+ ' -$(DEL) $(CLEANEXEFILES)'#010+ 'endif'#010+ - ' ',' -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICL'+ + ' -$(DEL) ','*$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICL'+ 'IBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)'#010+ ' -$(DELTREE) *$(SMARTEXT)'#010+ ' -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTCMD) $(REDIRFILE)'#010+ #010+ #010+ '[dependrules]'#010+ - '#########################','###########################################'+ + '##################################','##################################'+ '#'#010+ '# Depend rules'#010+ '#####################################################################'#010+ @@ -1216,7 +1221,7 @@ const fpcmakeini : array[0..114,1..240] of char=( #010+ #010+ '[inforules]'#010+ - '###############################','#####################################'+ + '########################################','############################'+ '#'#010+ '# Info rules'#010+ '#####################################################################'#010+ @@ -1225,9 +1230,9 @@ const fpcmakeini : array[0..114,1..240] of char=( 'nfo \'#010+ ' fpc_dirinfo'#010+ #010+ - 'fpc_info: $(INFOTARG','ET)'#010+ + 'fpc_info: $(INFOTARGET)'#010+ #010+ - '[info_cfg]'#010+ + '[inf','o_cfg]'#010+ 'fpc_infocfg:'#010+ ' @$(ECHO)'#010+ ' @$(ECHO) == Configuration info =='#010+ @@ -1235,7 +1240,7 @@ const fpcmakeini : array[0..114,1..240] of char=( ' @$(ECHO) FPC....... $(FPC)'#010+ ' @$(ECHO) Version... $(FPC_VERSION)'#010+ ' @$(ECHO) CPU....... $(CPU_TARGET)'#010+ - ' @$(','ECHO) Source.... $(OS_SOURCE)'#010+ + ' @$(ECHO) So','urce.... $(OS_SOURCE)'#010+ ' @$(ECHO) Target.... $(OS_TARGET)'#010+ ' @$(ECHO)'#010+ #010+ @@ -1246,7 +1251,7 @@ const fpcmakeini : array[0..114,1..240] of char=( ' @$(ECHO) == Directory info =='#010+ ' @$(ECHO)'#010+ 'ifdef NEEDGCCLIB'#010+ - ' @$(ECHO) G','CC library is needed.'#010+ + ' @$(ECHO) GCC librar','y is needed.'#010+ 'endif'#010+ 'ifdef NEEDOTHERLIB'#010+ ' @$(ECHO) Other library is needed.'#010+ @@ -1254,7 +1259,7 @@ const fpcmakeini : array[0..114,1..240] of char=( ' @$(ECHO) Basedir......... $(BASEDIR)'#010+ ' @$(ECHO)'#010+ ' @$(ECHO) GCC library..... $(GCCLIBDIR)'#010+ - ' @$(ECHO) Other library..','. $(OTHERLIBDIR)'#010+ + ' @$(ECHO) Other library... $(OTHER','LIBDIR)'#010+ ' @$(ECHO)'#010+ 'endif'#010+ #010+ @@ -1266,7 +1271,7 @@ const fpcmakeini : array[0..114,1..240] of char=( ' @$(ECHO) Pwd....... $(PWD)'#010+ ' @$(ECHO) Echo...... $(ECHO)'#010+ 'ifdef PPDEP'#010+ - ' @$(ECHO) ',' PPDep..... $(PPDEP)'#010+ + ' @$(ECHO) PPDep...','.. $(PPDEP)'#010+ 'endif'#010+ 'ifdef PPUMOVE'#010+ ' @$(ECHO) PPUMove... $(PPUMOVE)'#010+ @@ -1278,7 +1283,7 @@ const fpcmakeini : array[0..114,1..240] of char=( ' @$(ECHO) Data2Inc.. $(DATA2INC)'#010+ 'endif'#010+ 'ifdef SED'#010+ - ' @$(ECHO) S','ed....... $(SED)'#010+ + ' @$(ECHO) Sed.......',' $(SED)'#010+ 'endif'#010+ 'ifdef DATE'#010+ ' @$(ECHO) Date...... $(DATE)'#010+ @@ -1291,8 +1296,8 @@ const fpcmakeini : array[0..114,1..240] of char=( 'endif'#010+ 'ifdef UPXPROG'#010+ ' @$(ECHO) Upx....... $(UPXPROG)'#010+ - 'end','if'#010+ - 'ifdef ZIPPROG'#010+ + 'endif'#010+ + 'ifdef ','ZIPPROG'#010+ ' @$(ECHO) Zip....... $(ZIPPROG)'#010+ 'endif'#010+ ' @$(ECHO)'#010+ @@ -1303,13 +1308,13 @@ const fpcmakeini : array[0..114,1..240] of char=( ' @$(ECHO) == Object info =='#010+ ' @$(ECHO)'#010+ ' @$(ECHO) LoaderObjects..... $(LOADEROBJECTS)'#010+ - ' ',' @$(ECHO) UnitObjects....... $(UNITOBJECTS)'#010+ + ' @$(E','CHO) UnitObjects....... $(UNITOBJECTS)'#010+ ' @$(ECHO) ExeObjects........ $(EXEOBJECTS)'#010+ ' @$(ECHO)'#010+ ' @$(ECHO) ExtraCleanUnits... $(EXTRACLEANUNITS)'#010+ ' @$(ECHO) ExtraCleanFiles... $(EXTRACLEANFILES)'#010+ - ' @$(','ECHO)'#010+ - ' @$(ECHO) ExtraInstallUnits. $(EXTRAINSTALLUNITS)'#010+ + ' @$(ECHO)'#010+ + ' ',' @$(ECHO) ExtraInstallUnits. $(EXTRAINSTALLUNITS)'#010+ ' @$(ECHO) ExtraInstallFiles. $(EXTRAINSTALLFILES)'#010+ ' @$(ECHO)'#010+ #010+ @@ -1317,8 +1322,8 @@ const fpcmakeini : array[0..114,1..240] of char=( 'fpc_infoinstall:'#010+ ' @$(ECHO)'#010+ ' @$(ECHO) == Install info =='#010+ - ' @$(ECH','O)'#010+ - 'ifdef DATE'#010+ + ' @$(ECHO)'#010+ + 'ifdef ','DATE'#010+ ' @$(ECHO) DateStr.............. $(DATESTR)'#010+ 'endif'#010+ 'ifdef PACKAGENAME'#010+ @@ -1326,16 +1331,16 @@ const fpcmakeini : array[0..114,1..240] of char=( 'endif'#010+ ' @$(ECHO) PackageSuffix........ $(PACKAGESUFFIX)'#010+ ' @$(ECHO)'#010+ - ' @$(ECHO)',' BaseInstallDir....... $(BASEINSTALLDIR)'#010+ + ' @$(ECHO) BaseIns','tallDir....... $(BASEINSTALLDIR)'#010+ ' @$(ECHO) BinInstallDir........ $(BININSTALLDIR)'#010+ ' @$(ECHO) LibInstallDir........ $(LIBINSTALLDIR)'#010+ ' @$(ECHO) UnitInstallDir....... $(UNITINSTALLDIR)'#010+ - ' @$(ECHO) SourceIn','stallDir..... $(SOURCEINSTALLDIR)'#010+ + ' @$(ECHO) SourceInstallDir.','.... $(SOURCEINSTALLDIR)'#010+ ' @$(ECHO) DocInstallDir........ $(DOCINSTALLDIR)'#010+ ' @$(ECHO) DataInstallDir....... $(DATAINSTALLDIR)'#010+ ' @$(ECHO)'#010+ ' @$(ECHO) DestZipDir........... $(DESTZIPDIR)'#010+ - ' @$(ECHO) Zi','pName.............. $(ZIPNAME)'#010+ + ' @$(ECHO) ZipName....','.......... $(ZIPNAME)'#010+ ' @$(ECHO)'#010+ #010+ '[localmakefile]'#010+ @@ -1343,7 +1348,7 @@ const fpcmakeini : array[0..114,1..240] of char=( '# Local Makefile'#010+ '#####################################################################'#010+ #010+ - 'ifneq ($(wildcard',' fpcmake.loc),)'#010+ + 'ifneq ($(wildcard fpcmake.','loc),)'#010+ 'include fpcmake.loc'#010+ 'endif'#010+ #010+ diff --git a/utils/fpcmake.ini b/utils/fpcmake.ini index 0b196ffa0c..10e627ff85 100644 --- a/utils/fpcmake.ini +++ b/utils/fpcmake.ini @@ -170,137 +170,19 @@ endif # Pre Settings ##################################################################### + [usersettings] ##################################################################### # User Settings ##################################################################### + [postsettings] ##################################################################### # Post Settings ##################################################################### -[dir_default] -##################################################################### -# Default Directories -##################################################################### - -# set the prefix directory where to install everything -ifndef PREFIXINSTALLDIR -ifdef inlinux -PREFIXINSTALLDIR=/usr -else -PREFIXINSTALLDIR=/pp -endif -endif -export PREFIXINSTALLDIR - - -[dir_install] -##################################################################### -# Install Directories -##################################################################### - -# set the base directory where to install everything -ifndef BASEINSTALLDIR -ifdef inlinux -BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION) -else -BASEINSTALLDIR=$(PREFIXINSTALLDIR) -endif -endif - -# set the directory where to install the binaries -ifndef BININSTALLDIR -ifdef inlinux -BININSTALLDIR=$(PREFIXINSTALLDIR)/bin -else -BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET) -endif -endif - -# set the directory where to install the units. -ifndef UNITINSTALLDIR -UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET) -ifdef UNITSUBDIR -UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR) -endif -endif - -# Where to install shared libraries -ifndef LIBINSTALLDIR -ifdef inlinux -LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib -else -LIBINSTALLDIR=$(UNITINSTALLDIR) -endif -endif - -# Where the source files will be stored -ifndef SOURCEINSTALLDIR -ifdef inlinux -SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION) -else -SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source -endif -endif - -# Where the doc files will be stored -ifndef DOCINSTALLDIR -ifdef inlinux -DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION) -else -DOCINSTALLDIR=$(BASEINSTALLDIR)/doc -endif -endif - -# Where the some extra (data)files will be stored -ifndef DATAINSTALLDIR -DATAINSTALLDIR=$(BASEINSTALLDIR) -endif - - -[dir_gcclib] -# On linux, try to find where libgcc.a is. -ifdef inlinux -ifndef GCCLIBDIR -GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`) -endif -endif -export GCCLIBDIR - - -[dir_otherlib] -# Where to find other libraries -ifdef inlinux -ifndef OTHERLIBDIR -OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }') -endif -endif -export OTHERLIBDIR - - -[redir] -##################################################################### -# Redirection -##################################################################### - -# Release ? Then force OPT and don't use extra opts via commandline -ifndef REDIRFILE -REDIRFILE=log -endif - -ifdef REDIR -ifndef inlinux -override FPC=redir -eo $(FPC) -endif -# set the verbosity to max -override FPCOPT+=-va -override REDIR:= >> $(REDIRFILE) -endif - - [shelltools] ##################################################################### # Shell tools @@ -376,144 +258,6 @@ endif export ECHO COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR -[command_begin] -##################################################################### -# Compiler Command Line -##################################################################### - -# Load commandline OPTDEF and add FPC_CPU define -override FPCOPTDEF:=-d$(CPU_TARGET) - -# Load commandline OPT and add target and unit dir to be sure -ifneq ($(OS_TARGET),$(OS_SOURCE)) -override FPCOPT+=-T$(OS_TARGET) -endif - -[command_needopt] -ifdef NEEDOPT -override FPCOPT+=$(NEEDOPT) -endif - - -[command_needunit] -ifdef NEEDUNITDIR -override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR)) -endif - - -[command_unitsdir] -ifdef UNITSDIR -override FPCOPT+=-Fu$(UNITSDIR) -endif - - -[command_needlib] -ifdef NEEDLIBDIR -override FPCOPT+=$(addprefix -Fl,$(NEEDLIBDIR)) -endif - - -[command_needobj] -ifdef NEEDOBJDIR -override FPCOPT+=$(addprefix -Fo,$(NEEDOBJDIR)) -endif - - -[command_needinc] -ifdef NEEDINCDIR -override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR)) -endif - -[command_gcclib] -# Add GCC lib path if asked -ifdef GCCLIBDIR -override FPCOPT+=-Fl$(GCCLIBDIR) -endif - -[command_otherlib] -# Add Other dirs path if asked -ifdef OTHERLIBDIR -override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR)) -endif - -[command_target] -# Target dirs -ifdef TARGETDIR -override FPCOPT+=-FE$(TARGETDIR) -endif - -[command_unittarget] -ifdef UNITTARGETDIR -override FPCOPT+=-FU$(UNITTARGETDIR) -endif - -[command_end] -# Smartlinking -ifdef SMARTLINK -override FPCOPT+=-CX -endif - -# Debug -ifdef DEBUG -override FPCOPT+=-g -dDEBUG -endif - -# Release mode (strip, optimize and don't load ppc386.cfg) -ifdef RELEASE -override FPCOPT+=-Xs -OG2p3 -n -endif - -# Verbose settings (warning,note,info) -ifdef VERBOSE -override FPCOPT+=-vwni -endif - -# Add commandline options -ifdef OPT -override FPCOPT+=$(OPT) -endif -ifdef UNITDIR -override FPCOPT+=$(addprefix -Fu,$(UNITDIR)) -endif -ifdef LIBDIR -override FPCOPT+=$(addprefix -Fl,$(LIBDIR)) -endif -ifdef OBJDIR -override FPCOPT+=$(addprefix -Fo,$(OBJDIR)) -endif -ifdef INCDIR -override FPCOPT+=$(addprefix -Fi,$(INCDIR)) -endif - -# Add defines from FPCOPTDEF to FPCOPT -ifdef FPCOPTDEF -override FPCOPT+=$(FPCOPTDEF) -endif - -# Error file ? -ifdef ERRORFILE -override FPCOPT+=-Fr$(ERRORFILE) -endif - -# Was a config file specified ? -ifdef CFGFILE -override FPCOPT+=@$(CFGFILE) -endif - -# For win32 the options are passed using the file fpcext.cmd -ifndef FPCEXTCMD -FPCEXTCMD=fpcext.cmd -endif -ifeq ($(OS_SOURCE),win32) -override TMPVAR:=$(shell "$(DEL) $(FPCEXTCMD)") -override TMPVAR:=$(foreach A,$(FPCOPT),$(shell "$(ECHO) $(A) >> $(FPCEXTCMD)")) -override FPCOPT:=@$(FPCEXTCMD) -endif - -# Compiler commandline -override COMPILER:=$(FPC) $(FPCOPT) - - [tool_default] ##################################################################### # Default Tools @@ -790,6 +534,264 @@ PASEXT=.pas endif endif + +[dir_default] +##################################################################### +# Default Directories +##################################################################### + +# set the prefix directory where to install everything +ifndef PREFIXINSTALLDIR +ifdef inlinux +PREFIXINSTALLDIR=/usr +else +PREFIXINSTALLDIR=/pp +endif +endif +export PREFIXINSTALLDIR + + +[dir_install] +##################################################################### +# Install Directories +##################################################################### + +# set the base directory where to install everything +ifndef BASEINSTALLDIR +ifdef inlinux +BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION) +else +BASEINSTALLDIR=$(PREFIXINSTALLDIR) +endif +endif + +# set the directory where to install the binaries +ifndef BININSTALLDIR +ifdef inlinux +BININSTALLDIR=$(PREFIXINSTALLDIR)/bin +else +BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET) +endif +endif + +# set the directory where to install the units. +ifndef UNITINSTALLDIR +UNITINSTALLDIR=$(BASEINSTALLDIR)/units/$(OS_TARGET) +ifdef UNITSUBDIR +UNITINSTALLDIR:=$(UNITINSTALLDIR)/$(UNITSUBDIR) +endif +endif + +# Where to install shared libraries +ifndef LIBINSTALLDIR +ifdef inlinux +LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib +else +LIBINSTALLDIR=$(UNITINSTALLDIR) +endif +endif + +# Where the source files will be stored +ifndef SOURCEINSTALLDIR +ifdef inlinux +SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION) +else +SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source +endif +endif + +# Where the doc files will be stored +ifndef DOCINSTALLDIR +ifdef inlinux +DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION) +else +DOCINSTALLDIR=$(BASEINSTALLDIR)/doc +endif +endif + +# Where the some extra (data)files will be stored +ifndef DATAINSTALLDIR +DATAINSTALLDIR=$(BASEINSTALLDIR) +endif + + +[dir_gcclib] +# On linux, try to find where libgcc.a is. +ifdef inlinux +ifndef GCCLIBDIR +GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '{ print $$4 } '`) +endif +endif +export GCCLIBDIR + + +[dir_otherlib] +# Where to find other libraries +ifdef inlinux +ifndef OTHERLIBDIR +OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }') +endif +endif +export OTHERLIBDIR + + +[redir] +##################################################################### +# Redirection +##################################################################### + +# Release ? Then force OPT and don't use extra opts via commandline +ifndef REDIRFILE +REDIRFILE=log +endif + +ifdef REDIR +ifndef inlinux +override FPC=redir -eo $(FPC) +endif +# set the verbosity to max +override FPCOPT+=-va +override REDIR:= >> $(REDIRFILE) +endif + +[command_begin] +##################################################################### +# Compiler Command Line +##################################################################### + +# Load commandline OPTDEF and add FPC_CPU define +override FPCOPTDEF:=-d$(CPU_TARGET) + +# Load commandline OPT and add target and unit dir to be sure +ifneq ($(OS_TARGET),$(OS_SOURCE)) +override FPCOPT+=-T$(OS_TARGET) +endif + +[command_needopt] +ifdef NEEDOPT +override FPCOPT+=$(NEEDOPT) +endif + + +[command_needunit] +ifdef NEEDUNITDIR +override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR)) +endif + + +[command_unitsdir] +ifdef UNITSDIR +override FPCOPT+=-Fu$(UNITSDIR) +endif + + +[command_needlib] +ifdef NEEDLIBDIR +override FPCOPT+=$(addprefix -Fl,$(NEEDLIBDIR)) +endif + + +[command_needobj] +ifdef NEEDOBJDIR +override FPCOPT+=$(addprefix -Fo,$(NEEDOBJDIR)) +endif + + +[command_needinc] +ifdef NEEDINCDIR +override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR)) +endif + +[command_gcclib] +# Add GCC lib path if asked +ifdef GCCLIBDIR +override FPCOPT+=-Fl$(GCCLIBDIR) +endif + +[command_otherlib] +# Add Other dirs path if asked +ifdef OTHERLIBDIR +override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR)) +endif + +[command_target] +# Target dirs +ifdef TARGETDIR +override FPCOPT+=-FE$(TARGETDIR) +endif + +[command_unittarget] +ifdef UNITTARGETDIR +override FPCOPT+=-FU$(UNITTARGETDIR) +endif + +[command_end] +# Smartlinking +ifdef SMARTLINK +override FPCOPT+=-CX +endif + +# Debug +ifdef DEBUG +override FPCOPT+=-g -dDEBUG +endif + +# Release mode (strip, optimize and don't load ppc386.cfg) +ifdef RELEASE +override FPCOPT+=-Xs -OG2p3 -n +endif + +# Verbose settings (warning,note,info) +ifdef VERBOSE +override FPCOPT+=-vwni +endif + +# Add commandline options +ifdef OPT +override FPCOPT+=$(OPT) +endif +ifdef UNITDIR +override FPCOPT+=$(addprefix -Fu,$(UNITDIR)) +endif +ifdef LIBDIR +override FPCOPT+=$(addprefix -Fl,$(LIBDIR)) +endif +ifdef OBJDIR +override FPCOPT+=$(addprefix -Fo,$(OBJDIR)) +endif +ifdef INCDIR +override FPCOPT+=$(addprefix -Fi,$(INCDIR)) +endif + +# Add defines from FPCOPTDEF to FPCOPT +ifdef FPCOPTDEF +override FPCOPT+=$(FPCOPTDEF) +endif + +# Error file ? +ifdef ERRORFILE +override FPCOPT+=-Fr$(ERRORFILE) +endif + +# Was a config file specified ? +ifdef CFGFILE +override FPCOPT+=@$(CFGFILE) +endif + +# For win32 the options are passed using the file fpcext.cmd +ifndef FPCEXTCMD +FPCEXTCMD=fpcext.cmd +endif +ifeq ($(OS_SOURCE),win32) +override TMPVAR:=$(shell "$(DEL) $(FPCEXTCMD)") +override TMPVAR:=$(foreach A,$(FPCOPT),$(shell "$(ECHO) $(A) >> $(FPCEXTCMD)")) +override FPCOPT:=@$(FPCEXTCMD) +endif + +# Compiler commandline +override COMPILER:=$(FPC) $(FPCOPT) + + [standardrules] ##################################################################### # Standard rules @@ -902,7 +904,7 @@ fpc_test: examples $(FPCMADE): $(ALLTARGET) @$(ECHO) Compiled > $(FPCMADE) -fpc_packages: $(addsuffix _package,$(COMPILEPACKAGES)) +fpc_packages: $(COMPILEPACKAGES) fpc_all: fpc_packages $(FPCMADE) @@ -1046,7 +1048,7 @@ fpc_sourceinstall: clean # Temporary path to pack a file ifndef PACKDIR ifndef inlinux -PACKDIR=pack_tmp +PACKDIR=$(BASEDIR)/pack_tmp else PACKDIR=/tmp/fpc-pack endif diff --git a/utils/fpcmake.pp b/utils/fpcmake.pp index 90c92710d0..58071db7aa 100644 --- a/utils/fpcmake.pp +++ b/utils/fpcmake.pp @@ -609,60 +609,6 @@ var end; end; - procedure AddTargetsUnitDir(const packpre:string;var t:TTargetsString); - var - i,j,k : integer; - hs,pack,packdirvar,unitdirvar,unitdir,packdir : string; - begin - for i:=0 to targets do - if (t[i]<>'') then - begin - hs:=t[i]; - repeat - j:=pos(' ',hs); - if j=0 then - j:=length(hs)+1; - pack:=Copy(hs,1,j-1); - packdirvar:='PACKAGEDIR_'+VarName(pack); - unitdirvar:='UNITDIR_'+VarName(pack); - packdir:=packpre+'/'+pack; - unitdir:='$(UNITSDIR)/'+pack; - for k:=1to specialdirs do - begin - if specialdir[k].dir=pack then - begin - packdir:=specialdir[k].packdir; - unitdir:=specialdir[k].unitdir; - break; - end; - end; - mf.Add('ifneq ($(wildcard '+packdir+'),)'); - mf.Add('ifneq ($(wildcard '+packdir+'/$(OS_TARGET)),)'); - mf.Add(packdirvar+'='+packdir+'/$(OS_TARGET)'); - mf.Add('else'); - mf.Add(packdirvar+'='+packdir); - mf.Add('endif'); - mf.Add(unitdirvar+'=$('+packdirvar+')'); - mf.Add('else'); - mf.Add(packdirvar+'='); - mf.Add('ifneq ($(wildcard '+unitdir+'),)'); - mf.Add('ifneq ($(wildcard '+unitdir+'/$(OS_TARGET)),)'); - mf.Add(unitdirvar+'='+unitdir+'/$(OS_TARGET)'); - mf.Add('else'); - mf.Add(unitdirvar+'='+unitdir); - mf.Add('endif'); - mf.Add('else'); - mf.Add(unitdirvar+'='); - mf.Add('endif'); - mf.Add('endif'); - mf.Add('ifdef '+unitdirvar); - mf.Add('override NEEDUNITDIR+=$('+unitdirvar+')'); - mf.Add('endif'); - system.delete(hs,1,j); - until hs=''; - end; - end; - procedure AddTargetDir(const s:string); var j : integer; @@ -685,22 +631,6 @@ var mf.Add('endif'); end; - procedure AddPackageDep(const s:string); - var - packagedir : string; - begin - packagedir:='$(PACKAGEDIR_'+VarName(s)+')'; - mf.Add('ifdef PACKAGE'+VarName(s)); - mf.Add('ifneq ($(wildcard '+packagedir+'),)'); - mf.Add('override COMPILEPACKAGES+='+s); - mf.Add(s+'_package: '+packagedir+'/$(FPCMADE)'); - mf.Add(packagedir+'/$(FPCMADE):'); - mf.Add(#9'$(MAKE) -C '+packagedir+' all'); - mf.Add('endif'); - mf.Add('endif'); - Phony:=Phony+' '+s+'_package'; - end; - function AddTargetDefines(const ts:TTargetsString;const prefix:string):string; var j,i : integer; @@ -728,7 +658,61 @@ var AddTargetDefines:=hs2; end; - procedure AddTargetsPackageDep(const ts:TTargetsString); + procedure AddPackage(const path,pack:string); + var + k : integer; + packdirvar,unitdirvar,unitdir,packdir : string; + begin + mf.Add('ifdef PACKAGE'+VarName(pack)); + { create needed variables } + packdirvar:='PACKAGEDIR_'+VarName(pack); + unitdirvar:='UNITDIR_'+VarName(pack); + packdir:=path+'/'+pack; + unitdir:='$(UNITSDIR)/'+pack; + for k:=1to specialdirs do + begin + if specialdir[k].dir=pack then + begin + packdir:=specialdir[k].packdir; + unitdir:=specialdir[k].unitdir; + break; + end; + end; + mf.Add('ifneq ($(wildcard '+packdir+'),)'); + { Use Package dir, add build rules } + mf.Add('ifneq ($(wildcard '+packdir+'/$(OS_TARGET)),)'); + mf.Add(packdirvar+'='+packdir+'/$(OS_TARGET)'); + mf.Add('else'); + mf.Add(packdirvar+'='+packdir); + mf.Add('endif'); + mf.Add('ifeq ($(wildcard $('+packdirvar+')/$(FPCMADE)),)'); + mf.Add('override COMPILEPACKAGES+=package_'+pack); + Phony:=Phony+'package_'+pack; + mf.Add('package_'+pack+':'); + mf.Add(#9'$(MAKE) -C $('+packdirvar+') all'); + mf.Add('endif'); + mf.Add(unitdirvar+'=$('+packdirvar+')'); + mf.Add('else'); + { Package dir doesn''t exists, create unit dir } + mf.Add(packdirvar+'='); + mf.Add('ifneq ($(wildcard '+unitdir+'),)'); + mf.Add('ifneq ($(wildcard '+unitdir+'/$(OS_TARGET)),)'); + mf.Add(unitdirvar+'='+unitdir+'/$(OS_TARGET)'); + mf.Add('else'); + mf.Add(unitdirvar+'='+unitdir); + mf.Add('endif'); + mf.Add('else'); + mf.Add(unitdirvar+'='); + mf.Add('endif'); + mf.Add('endif'); + { Add Unit dir to the command line -Fu } + mf.Add('ifdef '+unitdirvar); + mf.Add('override NEEDUNITDIR+=$('+unitdirvar+')'); + mf.Add('endif'); + mf.Add('endif'); + end; + + procedure AddTargetsPackages(const path:string;const ts:TTargetsString); var Phony,hs : string; i : integer; @@ -737,12 +721,14 @@ var Phony:=''; if not TargetStringEmpty(ts) then begin + AddHead(VarName(path)+' packages'); hs:=AddTargetDefines(ts,'PACKAGE'); + mf.Add(''); repeat i:=pos(' ',hs); if i=0 then i:=length(hs)+1; - AddPackageDep(Copy(hs,1,i-1)); + AddPackage(path,Copy(hs,1,i-1)); system.delete(hs,1,i); until hs=''; mf.Add(''); @@ -892,9 +878,15 @@ begin { Packages } AddHead('Packages'); + Phony:=''; AddTargets('PACKAGES',userini.Requirepackages,false); AddTargets('TOOLKITS',userini.Requiretoolkits,false); AddTargets('COMPONENTS',userini.Requirecomponents,false); + if Phony<>'' then + begin + Add('.PHONY: '+Phony); + Add(''); + end; { Libs } AddHead('Libraries'); @@ -934,12 +926,35 @@ begin Add(''); end; + { shell tools like copy,del,echo } + AddSection(userini.section[sec_command] or userini.section[sec_tools],'shelltools'); + + { write tools } + if userini.section[sec_tools] then + begin + AddSection(true,'tool_default'); + AddSection(userini.toolsppdep,'tool_ppdep'); + AddSection(userini.toolsppumove,'tool_ppumove'); + AddSection(userini.toolsppufiles,'tool_ppufiles'); + AddSection(userini.toolsdata2inc,'tool_data2inc'); + AddSection(userini.toolsupx,'tool_upx'); + AddSection(userini.toolssed,'tool_sed'); + AddSection(userini.toolsdate,'tool_date'); + AddSection(userini.toolszip,'tool_zip'); + AddSection(userini.toolscmp,'tool_cmp'); + AddSection(userini.toolsdiff,'tool_diff'); + end; + + { extensions } + if userini.section[sec_exts] then + AddSection(true,'extensions'); + { package/component dirs } - AddHead('Package/component dirs'); + AddSection(true,'packagerequirerules'); AddSection(userini.requirertl,'checkfpcdirsubs'); - AddTargetsUnitDir('$(TOOLKITSDIR)',userini.Requiretoolkits); - AddTargetsUnitDir('$(PACKAGESDIR)',userini.Requirepackages); - AddTargetsUnitDir('$(COMPONENTSDIR)',userini.Requirecomponents); + AddTargetsPackages('$(PACKAGESDIR)',userini.Requirepackages); + AddTargetsPackages('$(TOOLKITSDIR)',userini.Requiretoolkits); + AddTargetsPackages('$(COMPONENTSDIR)',userini.Requirecomponents); Add(''); { write dirs } @@ -954,9 +969,6 @@ begin { redirection } AddSection(true,'redir'); - { shell tools like copy,del,echo } - AddSection(userini.section[sec_command] or userini.section[sec_tools],'shelltools'); - { commandline } if userini.section[sec_command] then begin @@ -980,26 +992,6 @@ begin AddSection(true,'command_end'); end; - { write tools } - if userini.section[sec_tools] then - begin - AddSection(true,'tool_default'); - AddSection(userini.toolsppdep,'tool_ppdep'); - AddSection(userini.toolsppumove,'tool_ppumove'); - AddSection(userini.toolsppufiles,'tool_ppufiles'); - AddSection(userini.toolsdata2inc,'tool_data2inc'); - AddSection(userini.toolsupx,'tool_upx'); - AddSection(userini.toolssed,'tool_sed'); - AddSection(userini.toolsdate,'tool_date'); - AddSection(userini.toolszip,'tool_zip'); - AddSection(userini.toolscmp,'tool_cmp'); - AddSection(userini.toolsdiff,'tool_diff'); - end; - - { extensions } - if userini.section[sec_exts] then - AddSection(true,'extensions'); - { add default rules } AddSection(true,'standardrules'); Phony:=''; @@ -1011,18 +1003,6 @@ begin Add(''); end; - { Package requirements, must be before the other rules so it's done first } - AddSection(true,'packagerequirerules'); - Phony:=''; - AddTargetsPackageDep(userini.RequireToolkits); - AddTargetsPackageDep(userini.RequirePackages); - AddTargetsPackageDep(userini.RequireComponents); - if Phony<>'' then - begin - Add('.PHONY: '+Phony); - Add(''); - end; - { compile rules for making loaders/units/exes/examples } AddSection(not TargetStringEmpty(userini.targetloaders),'loaderrules'); AddSection(not TargetStringEmpty(userini.targetunits),'unitrules'); @@ -1134,7 +1114,10 @@ begin end. { $Log$ - Revision 1.23 2000-01-12 23:20:37 peter + Revision 1.24 2000-01-13 11:34:26 peter + * better package dep creation + + Revision 1.23 2000/01/12 23:20:37 peter * gecho support * use foreach to write fpcext.cmd * add fpcext.cmd to clean targets