123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416 |
- {$ifdef Delphi}
- const fpcmakeini : array[0..130] of string[240]=(
- {$else Delphi}
- const fpcmakeini : array[0..130,1..240] of char=(
- {$endif Delphi}
- ';'#010+
- '; Templates used by fpcmake to create a Makefile from Makefile.fpc'#010+
- ';'#010+
- #010+
- '[osdetect]'#010+
- '#####################################################################'#010+
- '# Autodetect OS (Linux or Dos or Windows NT or OS/2)'#010+
- '# define inUnix when running under',' Unix like environment'#010+
- '# (Linux,FreeBSD,NetBSD,Cygwin)'#010+
- '# define inWinNT when running under WinNT'#010+
- '# define inOS2 when running under OS/2'#010+
- '# define inCygwin when running under Cygwin32'#010+
- '############################################','########################'+
- '#'#010+
- #010+
- '# We need only / in the path also remove the current dir'#010+
- 'override PATH:=$(subst \,/,$(PATH))'#010+
- #010+
- '# Determine if we'#039've a unix searchpath using : by looking for a ;'#010+
- '# that normally doesn'#039't exists in path names.'#010+
- 'ifeq ($','(findstring ;,$(PATH)),)'#010+
- 'inUnix=1'#010+
- 'SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))'#010+
- 'else'#010+
- 'SEARCHPATH:=$(subst ;, ,$(PATH))'#010+
- 'endif'#010+
- #010+
- '# Search for PWD and determine also if we are under linux'#010+
- 'PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHP','ATH))))'#010+
- 'ifeq ($(PWD),)'#010+
- 'PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))'#010+
- 'ifeq ($(PWD),)'#010+
- 'nopwd:'#010+
- ' @echo You need the GNU utils package to use this Makefile!'#010+
- ' @echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo3',
- '2.zip'#010+
- ' @exit'#010+
- 'else'#010+
- 'PWD:=$(firstword $(PWD))'#010+
- 'SRCEXEEXT='#010+
- 'endif'#010+
- 'else'#010+
- 'PWD:=$(firstword $(PWD))'#010+
- 'SRCEXEEXT=.exe'#010+
- 'endif'#010+
- #010+
- '# Detect NT - NT sets OS to Windows_NT'#010+
- '# Detect OS/2 - OS/2 has OS2_SHELL defined'#010+
- 'ifndef inUnix'#010+
- 'ifeq ($(OS),Windows_NT)'#010+
- 'i','nWinNT=1'#010+
- 'else'#010+
- 'ifdef OS2_SHELL'#010+
- 'inOS2=1'#010+
- 'endif'#010+
- 'endif'#010+
- 'else'#010+
- 'ifneq ($(findstring cygwin,$(MACHTYPE)),)'#010+
- 'inCygWin=1'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# The extension of batch files / scripts'#010+
- 'ifdef inUnix'#010+
- 'BATCHEXT=.sh'#010+
- 'else'#010+
- 'ifdef inOS2'#010+
- 'BATCHEXT=.cmd'#010+
- 'else'#010+
- 'BATCHEXT=.bat'#010+
- 'en','dif'#010+
- 'endif'#010+
- #010+
- '# Path Separator, the subst trick is necessary for the \ that can'#039't'+
- ' exists'#010+
- '# at the end of a line'#010+
- 'ifdef inUnix'#010+
- 'PATHSEP=/'#010+
- 'else'#010+
- 'PATHSEP:=$(subst /,\,/)'#010+
- 'endif'#010+
- #010+
- '# Base dir'#010+
- 'ifdef PWD'#010+
- 'BASEDIR:=$(subst \,/,$(shell $(PWD)))'#010+
- '# For Cygwin ','we need to replace /cygdrive/c/ with c:/'#010+
- 'ifdef inCygWin'#010+
- 'ifneq ($(findstring /cygdrive/,$(BASEDIR)),)'#010+
- 'BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))'#010+
- 'BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))'#010+
- 'BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$','(BASEDRIVE):/,$(BASEDIR))'#010+
- 'endif'#010+
- 'endif'#010+
- 'else'#010+
- 'BASEDIR=.'#010+
- 'endif'#010+
- #010+
- '[fpcdetect]'#010+
- '#####################################################################'#010+
- '# FPC version/target Detection'#010+
- '###################################################################','#'+
- '#'#010+
- #010+
- '# Compatibility with old makefiles'#010+
- 'ifndef FPC'#010+
- 'ifdef PP'#010+
- 'FPC=$(PP)'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Try to detect the ppcXXX file to use by using "fpc -P?" option'#010+
- '# to query for the default ppcXXX the fpc executable tries'#010+
- 'ifndef FPC'#010+
- 'FPC:=$(shell fpc -P?)'#010+
- '#',' Older fpc executables didn'#039't support it and return'#010+
- '# Error: Illegal processor... When found then fallback to ppc386'#010+
- 'ifneq ($(findstring Error,$(FPC)),)'#010+
- 'override FPC=ppc386'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Get a clean executable name'#010+
- 'override FPC:=$(subst $(','SRCEXEEXT),,$(FPC))'#010+
- 'override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)'#010+
- #010+
- '# Target CPU'#010+
- 'ifndef CPU_TARGET'#010+
- 'CPU_TARGET:=$(shell $(FPC) -iTP)'#010+
- 'endif'#010+
- #010+
- '# Source CPU'#010+
- 'ifndef CPU_SOURCE'#010+
- 'CPU_SOURCE:=$(shell $(FPC) -iSP)'#010+
- 'endif'#010+
- #010+
- '# Target OS'#010+
- 'ifndef OS_TARGET'#010+
- 'OS','_TARGET:=$(shell $(FPC) -iTO)'#010+
- 'endif'#010+
- #010+
- '# Source OS'#010+
- 'ifndef OS_SOURCE'#010+
- 'OS_SOURCE:=$(shell $(FPC) -iSO)'#010+
- 'endif'#010+
- #010+
- '# FPC version'#010+
- 'ifndef FPC_VERSION'#010+
- 'FPC_VERSION:=$(shell $(FPC) -iV)'#010+
- 'endif'#010+
- #010+
- 'export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSI','ON'#010+
- #010+
- #010+
- '[fpcdircheckenv]'#010+
- '#####################################################################'#010+
- '# FPCDIR Setting'#010+
- '#####################################################################'#010+
- #010+
- '# Test FPCDIR to look if the RTL dir exists'#010+
- 'ifdef FPCDIR'#010+
- 'ove','rride FPCDIR:=$(subst \,/,$(FPCDIR))'#010+
- 'ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)'#010+
- 'override FPCDIR=wrong'#010+
- 'endif'#010+
- 'else'#010+
- 'override FPCDIR=wrong'#010+
- 'endif'#010+
- #010+
- #010+
- '[fpcdirdetect]'#010+
- '# Detect FPCDIR'#010+
- 'ifeq ($(FPCDIR),wrong)'#010+
- 'ifdef inUnix'#010+
- 'override FPCDIR=/us','r/local/lib/fpc/$(FPC_VERSION)'#010+
- 'ifeq ($(wildcard $(FPCDIR)/units),)'#010+
- 'override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)'#010+
- 'endif'#010+
- 'else'#010+
- 'override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(add'+
- 'suffix /$(FPC),$(SEARCHPATH))))))'#010+
- 'override FPCDI','R:=$(FPCDIR)/..'#010+
- 'ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)'#010+
- 'override FPCDIR:=$(FPCDIR)/..'#010+
- 'ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)'#010+
- 'override FPCDIR=c:/pp'#010+
- 'endif'#010+
- 'endif'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Units dir'#010+
- 'UNITSDIR:=$(wildcard $(FPCD','IR)/units/$(OS_TARGET))'#010+
- #010+
- '# Packages dir'#010+
- 'PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)'#010+
- #010+
- #010+
- '[shelltools]'#010+
- '#####################################################################'#010+
- '# Shell tools'#010+
- '###############################################','#####################'+
- '#'#010+
- #010+
- '# Echo that can redir (must be able run in the default OS shell)'#010+
- 'ifndef ECHOREDIR'#010+
- 'ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))'#010+
- 'endif'#010+
- #010+
- '# To copy pograms'#010+
- 'ifndef COPY'#010+
- 'COPY:=$(CPPROG) -fp'#010+
- 'endif'#010+
- #010+
- '# Copy a whole tree'#010+
- 'ifndef CO','PYTREE'#010+
- 'COPYTREE:=$(CPPROG) -rfp'#010+
- 'endif'#010+
- #010+
- '# To move pograms'#010+
- 'ifndef MOVE'#010+
- 'MOVE:=$(MVPROG) -f'#010+
- 'endif'#010+
- #010+
- '# Check delete program'#010+
- 'ifndef DEL'#010+
- 'DEL:=$(RMPROG) -f'#010+
- 'endif'#010+
- #010+
- '# Check deltree program'#010+
- 'ifndef DELTREE'#010+
- 'DELTREE:=$(RMPROG) -rf'#010+
- 'endif'#010+
- #010+
- '# To install file','s'#010+
- 'ifndef INSTALL'#010+
- 'ifdef inUnix'#010+
- 'INSTALL:=$(GINSTALL) -c -m 644'#010+
- 'else'#010+
- 'INSTALL:=$(COPY)'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# To install programs'#010+
- 'ifndef INSTALLEXE'#010+
- 'ifdef inUnix'#010+
- 'INSTALLEXE:=$(GINSTALL) -c -m 755'#010+
- 'else'#010+
- 'INSTALLEXE:=$(COPY)'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# To make a directo','ry.'#010+
- 'ifndef MKDIR'#010+
- 'MKDIR:=$(GINSTALL) -m 755 -d'#010+
- 'endif'#010+
- #010+
- 'export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKD'+
- 'IR'#010+
- #010+
- #010+
- '[defaulttools]'#010+
- '#####################################################################'#010+
- '# Default Tools'#010+
- '###########','#########################################################'+
- '#'#010+
- #010+
- '# assembler, redefine it if cross compiling'#010+
- 'ifndef AS'#010+
- 'AS=as'#010+
- 'endif'#010+
- #010+
- '# linker, but probably not used'#010+
- 'ifndef LD'#010+
- 'LD=ld'#010+
- 'endif'#010+
- #010+
- '# Resource compiler'#010+
- 'ifndef RC'#010+
- 'RC=rc'#010+
- 'endif'#010+
- #010+
- '# ppas.bat / pp','as.sh'#010+
- 'PPAS=ppas$(BATCHEXT)'#010+
- #010+
- '# ldconfig to rebuild .so cache'#010+
- 'ifdef inUnix'#010+
- 'LDCONFIG=ldconfig'#010+
- 'else'#010+
- 'LDCONFIG='#010+
- 'endif'#010+
- #010+
- 'ifdef DATE'#010+
- 'DATESTR:=$(shell $(DATE) +%Y%m%d)'#010+
- 'else'#010+
- 'DATESTR='#010+
- 'endif'#010+
- #010+
- '# Look if UPX is found for go32v2 and win32. We can'#039't use $UP','X b'+
- 'ecuase'#010+
- '# upx uses that one itself (PFV)'#010+
- 'ifndef UPXPROG'#010+
- 'ifeq ($(OS_TARGET),go32v2)'#010+
- 'UPXPROG:=1'#010+
- 'endif'#010+
- 'ifeq ($(OS_TARGET),win32)'#010+
- 'UPXPROG:=1'#010+
- 'endif'#010+
- 'ifdef UPXPROG'#010+
- 'UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH)'+
- ')))'#010+
- 'ifeq ($','(UPXPROG),)'#010+
- 'UPXPROG='#010+
- 'else'#010+
- 'UPXPROG:=$(firstword $(UPXPROG))'#010+
- 'endif'#010+
- 'else'#010+
- 'UPXPROG='#010+
- 'endif'#010+
- 'endif'#010+
- 'export UPXPROG'#010+
- #010+
- '# Zip options'#010+
- 'ZIPOPT=-9'#010+
- 'ZIPEXT=.zip'#010+
- #010+
- '# Tar options'#010+
- 'ifeq ($(USETAR),bz2)'#010+
- 'TAROPT=vI'#010+
- 'TAREXT=.tar.bz2'#010+
- 'else'#010+
- 'TAROPT=vz'#010+
- 'TAREXT=.tar.gz'#010+
- 'endif',#010+
- #010+
- #010+
- '[extensions]'#010+
- '#####################################################################'#010+
- '# Default extensions'#010+
- '#####################################################################'#010+
- #010+
- '# Default needed extensions (Go32v2,Linux)'#010+
- 'LOADEREXT=.as'#010+
- 'EXEEX','T=.exe'#010+
- 'PPLEXT=.ppl'#010+
- 'PPUEXT=.ppu'#010+
- 'OEXT=.o'#010+
- 'ASMEXT=.s'#010+
- 'SMARTEXT=.sl'#010+
- 'STATICLIBEXT=.a'#010+
- 'SHAREDLIBEXT=.so'#010+
- 'STATICLIBPREFIX=libp'#010+
- 'RSTEXT=.rst'#010+
- 'FPCMADE=fpcmade'#010+
- #010+
- #010+
- '# Go32v1'#010+
- 'ifeq ($(OS_TARGET),go32v1)'#010+
- 'PPUEXT=.pp1'#010+
- 'OEXT=.o1'#010+
- 'ASMEXT=.s1'#010+
- 'SMARTEXT=.sl1'#010+
- 'STATICLIBEXT','=.a1'#010+
- 'SHAREDLIBEXT=.so1'#010+
- 'STATICLIBPREFIX='#010+
- 'FPCMADE=fpcmade.v1'#010+
- 'PACKAGESUFFIX=v1'#010+
- 'endif'#010+
- #010+
- '# Go32v2'#010+
- 'ifeq ($(OS_TARGET),go32v2)'#010+
- 'STATICLIBPREFIX='#010+
- 'FPCMADE=fpcmade.dos'#010+
- 'ZIPSUFFIX=go32'#010+
- 'endif'#010+
- #010+
- '# Linux'#010+
- 'ifeq ($(OS_TARGET),linux)'#010+
- 'EXEEXT='#010+
- 'HASSHAREDLIB=1'#010+
- 'FPCMA','DE=fpcmade.lnx'#010+
- 'ZIPSUFFIX=linux'#010+
- 'endif'#010+
- #010+
- '# FreeBSD'#010+
- 'ifeq ($(OS_TARGET),freebsd)'#010+
- 'EXEEXT='#010+
- 'HASSHAREDLIB=1'#010+
- 'FPCMADE=fpcmade.freebsd'#010+
- 'ZIPSUFFIX=freebsd'#010+
- 'endif'#010+
- #010+
- '# NetBSD'#010+
- 'ifeq ($(OS_TARGET),netbsd)'#010+
- 'EXEEXT='#010+
- 'HASSHAREDLIB=1'#010+
- 'FPCMADE=fpcmade.netbsd'#010+
- 'ZIPSUFFIX=','netbsd'#010+
- 'endif'#010+
- #010+
- '# Win32'#010+
- 'ifeq ($(OS_TARGET),win32)'#010+
- 'PPUEXT=.ppw'#010+
- 'OEXT=.ow'#010+
- 'ASMEXT=.sw'#010+
- 'SMARTEXT=.slw'#010+
- 'STATICLIBEXT=.aw'#010+
- 'SHAREDLIBEXT=.dll'#010+
- 'FPCMADE=fpcmade.w32'#010+
- 'ZIPSUFFIX=w32'#010+
- 'endif'#010+
- #010+
- '# OS/2'#010+
- 'ifeq ($(OS_TARGET),os2)'#010+
- 'PPUEXT=.ppo'#010+
- 'ASMEXT=.so2'#010+
- 'OEXT=.oo2'#010+
- 'AOUTE','XT=.out'#010+
- 'SMARTEXT=.so'#010+
- 'STATICLIBEXT=.ao2'#010+
- 'SHAREDLIBEXT=.dll'#010+
- 'FPCMADE=fpcmade.os2'#010+
- 'ZIPSUFFIX=emx'#010+
- 'endif'#010+
- #010+
- '# Amiga'#010+
- 'ifeq ($(OS_TARGET),amiga)'#010+
- 'EXEEXT='#010+
- 'PPUEXT=.ppa'#010+
- 'ASMEXT=.asm'#010+
- 'OEXT=.o'#010+
- 'SMARTEXT=.sl'#010+
- 'STATICLIBEXT=.a'#010+
- 'SHAREDLIBEXT=.library'#010+
- 'FPCMADE=fpcmade.a','mg'#010+
- 'endif'#010+
- #010+
- '# Atari'#010+
- 'ifeq ($(OS_TARGET),atari)'#010+
- 'PPUEXT=.ppt'#010+
- 'ASMEXT=.s'#010+
- 'OEXT=.o'#010+
- 'SMARTEXT=.sl'#010+
- 'STATICLIBEXT=.a'#010+
- 'EXEEXT=.ttp'#010+
- 'FPCMADE=fpcmade.ata'#010+
- 'endif'#010+
- #010+
- '# BeOS'#010+
- 'ifeq ($(OS_TARGET),beos)'#010+
- 'PPUEXT=.ppu'#010+
- 'ASMEXT=.s'#010+
- 'OEXT=.o'#010+
- 'SMARTEXT=.sl'#010+
- 'STATICLIBEXT=.a'#010+
- 'EXEEXT=',#010+
- 'FPCMADE=fpcmade.be'#010+
- 'ZIPSUFFIX=be'#010+
- 'endif'#010+
- #010+
- '# Solaris'#010+
- 'ifeq ($(OS_TARGET),sunos)'#010+
- 'PPUEXT=.ppu'#010+
- 'ASMEXT=.s'#010+
- 'OEXT=.o'#010+
- 'SMARTEXT=.sl'#010+
- 'STATICLIBEXT=.a'#010+
- 'EXEEXT='#010+
- 'FPCMADE=fpcmade.sun'#010+
- 'ZIPSUFFIX=sun'#010+
- 'endif'#010+
- #010+
- '# QNX'#010+
- 'ifeq ($(OS_TARGET),qnx)'#010+
- 'PPUEXT=.ppu'#010+
- 'ASMEXT=.s'#010+
- 'OEXT','=.o'#010+
- 'SMARTEXT=.sl'#010+
- 'STATICLIBEXT=.a'#010+
- 'EXEEXT='#010+
- 'FPCMADE=fpcmade.qnx'#010+
- 'ZIPSUFFIX=qnx'#010+
- 'endif'#010+
- #010+
- #010+
- #010+
- '[defaultdirs]'#010+
- '#####################################################################'#010+
- '# Default Directories'#010+
- '##################################################','##################'+
- '#'#010+
- #010+
- '# Units dir'#010+
- 'ifdef REQUIRE_UNITSDIR'#010+
- 'override UNITSDIR+=$(REQUIRE_UNITSDIR)'#010+
- 'endif'#010+
- #010+
- '# Units dir'#010+
- 'ifdef REQUIRE_PACKAGESDIR'#010+
- 'override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)'#010+
- 'endif'#010+
- #010+
- #010+
- '# Linux, netbsd and freebsd use unix dirs with ','/usr/bin, /usr/lib'#010+
- '# When zipping use the target as default, when normal install then'#010+
- '# use the source os as default'#010+
- 'ifdef ZIPINSTALL'#010+
- '# Zipinstall'#010+
- 'ifeq ($(OS_TARGET),linux)'#010+
- 'UNIXINSTALLDIR=1'#010+
- 'endif'#010+
- 'ifeq ($(OS_TARGET),freebsd)'#010+
- 'UNIXINSTALLDIR=1',#010+
- 'endif'#010+
- 'ifeq ($(OS_TARGET),netbsd)'#010+
- 'UNIXINSTALLDIR=1'#010+
- 'endif'#010+
- 'else'#010+
- '# Normal install'#010+
- 'ifeq ($(OS_SOURCE),linux)'#010+
- 'UNIXINSTALLDIR=1'#010+
- 'endif'#010+
- 'ifeq ($(OS_SOURCE),freebsd)'#010+
- 'UNIXINSTALLDIR=1'#010+
- 'endif'#010+
- 'ifeq ($(OS_SOURCE),netbsd)'#010+
- 'UNIXINSTALLDIR=1'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# se','t the prefix directory where to install everything'#010+
- 'ifndef INSTALL_PREFIX'#010+
- 'ifdef UNIXINSTALLDIR'#010+
- 'INSTALL_PREFIX=/usr/local'#010+
- 'else'#010+
- 'ifdef INSTALL_FPCPACKAGE'#010+
- 'INSTALL_BASEDIR:=/pp'#010+
- 'else'#010+
- 'INSTALL_BASEDIR:=/$(PACKAGE_NAME)'#010+
- 'endif'#010+
- 'endif'#010+
- 'endif'#010+
- 'export INSTA','LL_PREFIX'#010+
- #010+
- '# Where to place the resulting zip files'#010+
- 'ifndef DIST_DESTDIR'#010+
- 'DIST_DESTDIR:=$(BASEDIR)'#010+
- 'endif'#010+
- 'export DIST_DESTDIR'#010+
- #010+
- #010+
- '#####################################################################'#010+
- '# Install Directories'#010+
- '#######################','#############################################'+
- '#'#010+
- #010+
- '# set the base directory where to install everything'#010+
- 'ifndef INSTALL_BASEDIR'#010+
- 'ifdef UNIXINSTALLDIR'#010+
- 'ifdef INSTALL_FPCPACKAGE'#010+
- 'INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)'#010+
- 'else'#010+
- 'INSTALL','_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)'#010+
- 'endif'#010+
- 'else'#010+
- 'INSTALL_BASEDIR:=$(INSTALL_PREFIX)'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# set the directory where to install the binaries'#010+
- 'ifndef INSTALL_BINDIR'#010+
- 'ifdef UNIXINSTALLDIR'#010+
- 'INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin'#010+
- 'el','se'#010+
- 'INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin'#010+
- '# for FPC packages install the binaries under their os target subdir'#010+
- 'ifdef INSTALL_FPCPACKAGE'#010+
- 'INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)'#010+
- 'endif'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# set the directory where to install t','he units.'#010+
- 'ifndef INSTALL_UNITDIR'#010+
- 'INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(OS_TARGET)'#010+
- 'ifdef INSTALL_FPCPACKAGE'#010+
- 'ifdef PACKAGE_NAME'#010+
- 'INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)'#010+
- 'endif'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Where to install shared libraries'#010+
- 'i','fndef INSTALL_LIBDIR'#010+
- 'ifdef UNIXINSTALLDIR'#010+
- 'INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib'#010+
- 'else'#010+
- 'INSTALL_LIBDIR:=$(INSTALL_UNITDIR)'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Where the source files will be stored'#010+
- 'ifndef INSTALL_SOURCEDIR'#010+
- 'ifdef UNIXINSTALLDIR'#010+
- 'ifdef INSTALL_FPCPACK','AGE'#010+
- 'INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/fpc-$(FPC_VERSION)/$(PACKAGE_'+
- 'NAME)'#010+
- 'else'#010+
- 'INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/src/$(PACKAGE_NAME)-$(PACKAGE_VER'+
- 'SION)'#010+
- 'endif'#010+
- 'else'#010+
- 'ifdef INSTALL_FPCPACKAGE'#010+
- 'INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/sourc','e/$(PACKAGE_NAME)'#010+
- 'else'#010+
- 'INSTALL_SOURCEDIRL:=$(INSTALL_BASEDIR)/source'#010+
- 'endif'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Where the doc files will be stored'#010+
- 'ifndef INSTALL_DOCDIR'#010+
- 'ifdef UNIXINSTALLDIR'#010+
- 'ifdef INSTALL_FPCPACKAGE'#010+
- 'INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC','_VERSION)/$(PACKAGE_N'+
- 'AME)'#010+
- 'else'#010+
- 'INSTALL_DOCDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSIO'+
- 'N)'#010+
- 'endif'#010+
- 'else'#010+
- 'ifdef INSTALL_FPCPACKAGE'#010+
- 'INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)'#010+
- 'else'#010+
- 'INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc'#010+
- 'e','ndif'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Where to install the examples, under linux we use the doc dir'#010+
- '# because the copytree command will create a subdir itself'#010+
- 'ifndef INSTALL_EXAMPLEDIR'#010+
- 'ifdef UNIXINSTALLDIR'#010+
- 'ifdef INSTALL_FPCPACKAGE'#010+
- 'INSTALL_EXAMPLEDIR:=$(INSTA','LL_PREFIX)/doc/fpc-$(FPC_VERSION)/example'+
- 's/$(PACKAGE_NAME)'#010+
- 'else'#010+
- 'INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VE'+
- 'RSION)'#010+
- 'endif'#010+
- 'else'#010+
- 'ifdef INSTALL_FPCPACKAGE'#010+
- 'INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)',#010+
- 'else'#010+
- 'INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples'#010+
- 'endif'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Where the some extra (data)files will be stored'#010+
- 'ifndef INSTALL_DATADIR'#010+
- 'INSTALL_DATADIR=$(INSTALL_BASEDIR)'#010+
- 'endif'#010+
- #010+
- #010+
- '[dirlibc]'#010+
- '# On linux, try to find where libgcc.a is','.'#010+
- 'ifdef inUnix'#010+
- 'ifndef GCCLIBDIR'#010+
- 'GCCLIBDIR:=$(shell dirname `(gcc -v 2>&1)| head -n 1| awk '#039'{ print'+
- ' $$4 } '#039'`)'#010+
- 'endif'#010+
- 'ifeq ($(OS_TARGET),linux)'#010+
- 'ifndef OTHERLIBDIR'#010+
- 'OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '#039'{ ORS=" '+
- '"; print $1 }'#039,')'#010+
- 'endif'#010+
- 'endif'#010+
- 'ifeq ($(OS_TARGET),netbsd)'#010+
- 'OTHERLIBDIR+=/usr/pkg/lib'#010+
- 'endif'#010+
- 'export GCCLIBDIR OTHERLIB'#010+
- 'endif'#010+
- #010+
- #010+
- '[command_begin]'#010+
- '#####################################################################'#010+
- '# Compiler Command Line'#010+
- '#######################','#############################################'+
- '#'#010+
- #010+
- '# Load commandline OPTDEF and add FPC_CPU define, for compiling the'#010+
- '# compiler this needs to be turned off'#010+
- 'ifndef NOCPUDEF'#010+
- 'override FPCOPTDEF=$(CPU_TARGET)'#010+
- 'endif'#010+
- #010+
- '# Load commandline OPT and ad','d target and unit dir to be sure'#010+
- 'ifneq ($(OS_TARGET),$(OS_SOURCE))'#010+
- 'override FPCOPT+=-T$(OS_TARGET)'#010+
- 'endif'#010+
- #010+
- '# User dirs should be first, so they are looked at first'#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+
- '# Smartlinking'#010+
- 'ifdef LINKSMART'#010+
- 'override FPCOPT+=-XX'#010+
- 'endif'#010+
- #010+
- '# S','martlinking creation'#010+
- 'ifdef CREATESMART'#010+
- 'override FPCOPT+=-CX'#010+
- 'endif'#010+
- #010+
- '# Debug'#010+
- 'ifdef DEBUG'#010+
- 'override FPCOPT+=-gl'#010+
- 'override FPCOPTDEF+=DEBUG'#010+
- 'endif'#010+
- #010+
- '# Release mode (strip, optimize and don'#039't load ppc386.cfg)'#010+
- 'ifdef RELEASE'#010+
- 'ifeq ($(CPU_TARGET),i386)'#010,
- 'FPCCPUOPT:=-OG2p3'#010+
- 'else'#010+
- 'FPCCPUOPT:='#010+
- 'endif'#010+
- 'override FPCOPT+=-Xs $(FPCCPUOPT) -n'#010+
- 'override FPCOPTDEF+=RELEASE'#010+
- 'endif'#010+
- #010+
- '# Strip'#010+
- 'ifdef STRIP'#010+
- 'override FPCOPT+=-Xs'#010+
- 'endif'#010+
- #010+
- '# Optimizer (i386 only for now)'#010+
- 'ifdef OPTIMIZE'#010+
- 'ifeq ($(CPU_TARGET),i386)'#010+
- 'overri','de FPCOPT+=-OG2p3'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Verbose settings (warning,note,info)'#010+
- 'ifdef VERBOSE'#010+
- 'override FPCOPT+=-vwni'#010+
- 'endif'#010+
- #010+
- '# Needed compiler options'#010+
- 'ifdef COMPILER_OPTIONS'#010+
- 'override FPCOPT+=$(COMPILER_OPTIONS)'#010+
- 'endif'#010+
- 'ifdef COMPILER_UNITDIR'#010+
- 'override FP','COPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))'#010+
- 'endif'#010+
- 'ifdef COMPILER_LIBRARYDIR'#010+
- 'override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))'#010+
- 'endif'#010+
- 'ifdef COMPILER_OBJECTDIR'#010+
- 'override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))'#010+
- 'endif'#010+
- 'ifdef COMPILER_','INCLUDEDIR'#010+
- 'override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))'#010+
- 'endif'#010+
- #010+
- '# Target dirs and the prefix to use for clean/install'#010+
- 'ifdef COMPILER_TARGETDIR'#010+
- 'override FPCOPT+=-FE$(COMPILER_TARGETDIR)'#010+
- 'ifeq ($(COMPILER_TARGETDIR),.)'#010+
- 'override TARG','ETDIRPREFIX='#010+
- 'else'#010+
- 'override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Unit target dir'#010+
- 'ifdef COMPILER_UNITTARGETDIR'#010+
- 'override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)'#010+
- 'ifeq ($(COMPILER_UNITTARGETDIR),.)'#010+
- 'override UNITTARGETDIRPREFIX='#010+
- 'els','e'#010+
- 'override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/'#010+
- 'endif'#010+
- 'else'#010+
- 'ifdef COMPILER_TARGETDIR'#010+
- 'override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)'#010+
- 'override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '[command_libc]'#010+
- '# Add GCC lib pa','th if asked'#010+
- 'ifdef GCCLIBDIR'#010+
- 'override FPCOPT+=-Fl$(GCCLIBDIR)'#010+
- 'endif'#010+
- 'ifdef OTHERLIBDIR'#010+
- 'override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))'#010+
- 'endif'#010+
- #010+
- #010+
- '[command_end]'#010+
- '# Add commandline options last so they can override'#010+
- 'ifdef OPT'#010+
- 'override FPCOPT+=$(OPT',')'#010+
- 'endif'#010+
- #010+
- '# Add defines from FPCOPTDEF to FPCOPT'#010+
- 'ifdef FPCOPTDEF'#010+
- 'override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))'#010+
- 'endif'#010+
- #010+
- '# Was a config file specified ?'#010+
- 'ifdef CFGFILE'#010+
- 'override FPCOPT+=@$(CFGFILE)'#010+
- 'endif'#010+
- #010+
- '# Use the environment to pass commandline',' options?'#010+
- 'ifdef USEENV'#010+
- 'override FPCEXTCMD:=$(FPCOPT)'#010+
- 'override FPCOPT:=!FPCEXTCMD'#010+
- 'export FPCEXTCMD'#010+
- 'endif'#010+
- #010+
- '# Compiler commandline'#010+
- 'override COMPILER:=$(FPC) $(FPCOPT)'#010+
- #010+
- '# also call ppas if with command option -s'#010+
- '# but only if the OS_SOURCE and ','OS_TARGET are equal'#010+
- 'ifeq (,$(findstring -s ,$(COMPILER)))'#010+
- 'EXECPPAS='#010+
- 'else'#010+
- 'ifeq ($(OS_SOURCE),$(OS_TARGET))'#010+
- 'EXECPPAS:=@$(PPAS)'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- #010+
- '[loaderrules]'#010+
- '#####################################################################'#010+
- '# Loaders'#010+
- '#######','#############################################################'+
- '#'#010+
- #010+
- '.PHONY: fpc_loaders'#010+
- #010+
- 'ifdef TARGET_LOADERS'#010+
- 'override ALLTARGET+=fpc_loaders'#010+
- 'override CLEANTARGET+=fpc_loaders_clean'#010+
- 'override INSTALLTARGET+=fpc_loaders_install'#010+
- #010+
- 'override LOADEROF','ILES:=$(addsuffix $(OEXT),$(TARGET_LOADERS))'#010+
- 'endif'#010+
- #010+
- '%$(OEXT): %$(LOADEREXT)'#010+
- ' $(AS) -o $*$(OEXT) $<'#010+
- #010+
- 'fpc_loaders: $(LOADEROFILES)'#010+
- #010+
- 'fpc_loaders_clean:'#010+
- ' -$(DEL) $(LOADEROFILES)'#010+
- #010+
- 'fpc_loaders_install:'#010+
- ' $(MKDIR) $(INSTALL_UNI','TDIR)'#010+
- ' $(INSTALL) $(LOADEROFILES) $(INSTALL_UNITDIR)'#010+
- #010+
- #010+
- '[unitrules]'#010+
- '#####################################################################'#010+
- '# Units'#010+
- '#####################################################################'#010+
- #010+
- '.PHONY: fpc_units',#010+
- #010+
- 'ifdef TARGET_UNITS'#010+
- 'override ALLTARGET+=fpc_units'#010+
- #010+
- 'override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))'#010+
- 'override INSTALLPPUFILES+=$(UNITPPUFILES)'#010+
- 'override CLEANPPUFILES+=$(UNITPPUFILES)'#010+
- 'endif'#010+
- #010+
- 'fpc_units: $(UNITPPUFILES)'#010+
- #010+
- #010+
- '[exerules',']'#010+
- '#####################################################################'#010+
- '# Exes'#010+
- '#####################################################################'#010+
- #010+
- '.PHONY: fpc_exes'#010+
- #010+
- 'ifdef TARGET_PROGRAMS'#010+
- 'override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_P','ROGRAMS))'#010+
- 'override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefi'+
- 'x $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))'#010+
- #010+
- 'override ALLTARGET+=fpc_exes'#010+
- 'override INSTALLEXEFILES+=$(EXEFILES)'#010+
- 'override CLEANEXEFILES','+=$(EXEFILES) $(EXEOFILES)'#010+
- 'ifeq ($(OS_TARGET),os2)'#010+
- 'override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- 'fpc_exes: $(EXEFILES)'#010+
- #010+
- #010+
- '[rstrules]'#010+
- '#####################################################################'#010+
- '# Re','source strings'#010+
- '#####################################################################'#010+
- #010+
- 'ifdef TARGET_RSTS'#010+
- 'override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))'#010+
- #010+
- 'override CLEANRSTFILES+=$(RSTFILES)'#010+
- 'endif'#010+
- #010+
- #010+
- '[examplerules]'#010+
- '####################','################################################'+
- '#'#010+
- '# Examples'#010+
- '#####################################################################'#010+
- #010+
- '.PHONY: fpc_examples'#010+
- #010+
- 'ifdef TARGET_EXAMPLES'#010+
- 'HASEXAMPLES=1'#010+
- 'override EXAMPLESOURCEFILES:=$(wildcard $(addsuffi','x .pp,$(TARGET_EXA'+
- 'MPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)))'#010+
- 'override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES))'#010+
- 'override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addp'+
- 'refix $(STATICLIBPREFIX),$(addsuffix $(ST','ATICLIBEXT),$(TARGET_EXAMPL'+
- 'ES)))'#010+
- #010+
- 'override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)'#010+
- 'ifeq ($(OS_TARGET),os2)'#010+
- 'override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))'#010+
- 'endif'#010+
- 'endif'#010+
- 'ifdef TARGET_EXAMPLEDIRS'#010+
- 'HASEXAMPLES=1'#010+
- 'endif'#010+
- #010,
- 'fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIR'+
- 'S))'#010+
- #010+
- #010+
- '[compilerules]'#010+
- '#####################################################################'#010+
- '# General compile rules'#010+
- '#######################################################','#############'+
- '#'#010+
- #010+
- '.PHONY: fpc_packages fpc_all fpc_smart fpc_debug'#010+
- #010+
- '$(FPCMADE): $(ALLTARGET)'#010+
- ' @$(ECHOREDIR) Compiled > $(FPCMADE)'#010+
- #010+
- 'fpc_packages: $(COMPILEPACKAGES)'#010+
- #010+
- 'fpc_all: fpc_packages $(FPCMADE)'#010+
- #010+
- 'fpc_smart:'#010+
- ' $(MAKE) all LINKS','MART=1 CREATESMART=1'#010+
- #010+
- 'fpc_debug:'#010+
- ' $(MAKE) all DEBUG=1'#010+
- #010+
- '# General compile rules, available for both possible .pp and .pas exte'+
- 'nsions'#010+
- #010+
- '.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp'#010+
- #010+
- '%$(PPUEXT): %.pp'#010+
- ' $(COMPILER) $<'#010+
- ' $(E','XECPPAS)'#010+
- #010+
- '%$(PPUEXT): %.pas'#010+
- ' $(COMPILER) $<'#010+
- ' $(EXECPPAS)'#010+
- #010+
- '%$(EXEEXT): %.pp'#010+
- ' $(COMPILER) $<'#010+
- ' $(EXECPPAS)'#010+
- #010+
- '%$(EXEEXT): %.pas'#010+
- ' $(COMPILER) $<'#010+
- ' $(EXECPPAS)'#010+
- #010+
- '# Search paths for .ppu and .pp and .pas'#010+
- 'vpat','h %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)'#010+
- 'vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)'#010+
- 'vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)'#010+
- #010+
- #010+
- '[libraryrules]'#010+
- '#####################################################################'#010+
- '#',' Library'#010+
- '#####################################################################'#010+
- #010+
- '.PHONY: fpc_shared'#010+
- #010+
- 'ifndef LIB_FULLNAME'#010+
- 'ifdef LIB_VERSION'#010+
- 'LIB_FULLNAME=$(LIB_NAME).$(LIB_VERSION)'#010+
- 'else'#010+
- 'LIB_FULLNAME=$(LIB_NAME)'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Default sharedlib',' units are all unit objects'#010+
- 'ifndef LIB_SHAREDUNITS'#010+
- 'LIB_SHAREDUNITS:=$(TARGET_UNITS)'#010+
- 'endif'#010+
- #010+
- 'fpc_shared: all'#010+
- 'ifdef HASSHAREDLIB'#010+
- ' $(PPUMOVE) $(LIB_SHAREDUNITS) -o$(LIB_FULLNAME)'#010+
- 'else'#010+
- ' @$(ECHO) Shared Libraries not supported'#010+
- 'endif',#010+
- #010+
- #010+
- '[installrules]'#010+
- '#####################################################################'#010+
- '# Install rules'#010+
- '#####################################################################'#010+
- #010+
- '.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall'#010+
- #010+
- 'ifdef I','NSTALL_UNITS'#010+
- 'override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))'#010+
- 'endif'#010+
- #010+
- 'ifdef INSTALLPPUFILES'#010+
- 'override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFI'+
- 'LES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATI','CLIBEX'+
- 'T),$(INSTALLPPUFILES)))'#010+
- 'override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALL'+
- 'PPUFILES))'#010+
- 'override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPR'+
- 'EFIX),$(INSTALLPPULINKFILES)))'#010+
- '# Implicitly install Package','.fpc'#010+
- 'override INSTALL_CREATEPACKAGEFPC=1'#010+
- 'endif'#010+
- #010+
- 'ifdef INSTALLEXEFILES'#010+
- 'override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEF'+
- 'ILES))'#010+
- 'endif'#010+
- #010+
- 'fpc_install: all $(INSTALLTARGET)'#010+
- 'ifdef INSTALLEXEFILES'#010+
- ' $(MKDIR) $(INSTALL_BIN','DIR)'#010+
- '# Compress the exes if upx is defined'#010+
- 'ifdef UPXPROG'#010+
- ' -$(UPXPROG) $(INSTALLEXEFILES)'#010+
- 'endif'#010+
- ' $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)'#010+
- 'endif'#010+
- 'ifdef INSTALL_CREATEPACKAGEFPC'#010+
- 'ifdef FPCMAKE'#010+
- '# If the fpcpackage variable',' is set then create and install Package.'+
- 'fpc,'#010+
- '# a safety check is done if Makefile.fpc is available'#010+
- 'ifdef PACKAGE_VERSION'#010+
- 'ifneq ($(wildcard Makefile.fpc),)'#010+
- ' $(FPCMAKE) -p -T$(OS_TARGET) Makefile.fpc'#010+
- ' $(MKDIR) $(INSTALL_UNITDIR)',#010+
- ' $(INSTALL) Package.fpc $(INSTALL_UNITDIR)'#010+
- 'endif'#010+
- 'endif'#010+
- 'endif'#010+
- 'endif'#010+
- 'ifdef INSTALLPPUFILES'#010+
- ' $(MKDIR) $(INSTALL_UNITDIR)'#010+
- ' $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)'#010+
- 'ifneq ($(INSTALLPPULINKFILES),)'#010+
- ' $(INSTALL)',' $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)'#010+
- 'endif'#010+
- 'ifneq ($(wildcard $(LIB_FULLNAME)),)'#010+
- ' $(MKDIR) $(INSTALL_LIBDIR)'#010+
- ' $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)'#010+
- 'ifdef inUnix'#010+
- ' ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LI','B_NAME)'#010+
- 'endif'#010+
- 'endif'#010+
- 'endif'#010+
- 'ifdef INSTALL_FILES'#010+
- ' $(MKDIR) $(INSTALL_DATADIR)'#010+
- ' $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)'#010+
- 'endif'#010+
- #010+
- 'fpc_sourceinstall: distclean'#010+
- ' $(MKDIR) $(INSTALL_SOURCEDIR)'#010+
- ' $(COPYTREE) $(BASEDIR',') $(INSTALL_SOURCEDIR)'#010+
- #010+
- 'fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))'#010+
- 'ifdef HASEXAMPLES'#010+
- ' $(MKDIR) $(INSTALL_EXAMPLEDIR)'#010+
- 'endif'#010+
- 'ifdef EXAMPLESOURCEFILES'#010+
- ' $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)'#010+
- 'en','dif'#010+
- 'ifdef TARGET_EXAMPLEDIRS'#010+
- ' $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EX'+
- 'AMPLEDIR)'#010+
- 'endif'#010+
- #010+
- '[distinstallrules]'#010+
- '#####################################################################'#010+
- '# Dist Install'#010+
- '####################','################################################'+
- '#'#010+
- #010+
- '.PHONY: fpc_distinstall'#010+
- #010+
- 'fpc_distinstall: install exampleinstall'#010+
- #010+
- #010+
- '[zipinstallrules]'#010+
- '#####################################################################'#010+
- '# Zip'#010+
- '############################','########################################'+
- '#'#010+
- #010+
- '.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall'#010+
- #010+
- '# Temporary path to pack a file, can only use a single deep'#010+
- '# subdir, because the deltree can'#039't see the whole tree to remove'#010+
- 'ifnde','f PACKDIR'#010+
- 'ifndef inUnix'#010+
- 'PACKDIR=$(BASEDIR)/../fpc-pack'#010+
- 'else'#010+
- 'PACKDIR=/tmp/fpc-pack'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Maybe create default zipname from packagename'#010+
- 'ifndef ZIPNAME'#010+
- 'ifdef DIST_ZIPNAME'#010+
- 'ZIPNAME=$(DIST_ZIPNAME)'#010+
- 'else'#010+
- 'ZIPNAME=$(ZIPPREFIX)$(PACKAGE_NAME',')$(ZIPSUFFIX)'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# ZipTarget'#010+
- 'ifndef ZIPTARGET'#010+
- 'ifdef DIST_ZIPTARGET'#010+
- 'ZIPTARGET=DIST_ZIPTARGET'#010+
- 'else'#010+
- 'ZIPTARGET=install'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Use tar by default under linux'#010+
- 'ifndef USEZIP'#010+
- 'ifdef inUnix'#010+
- 'USETAR=1'#010+
- 'endif'#010+
- 'endif'#010+
- #010+
- '# Use a wrapper scri','pt by default for Os/2'#010+
- 'ifndef inUnix'#010+
- 'USEZIPWRAPPER=1'#010+
- 'endif'#010+
- #010+
- '# We need to be able to run in the current OS so fix'#010+
- '# the path separator'#010+
- 'ifdef USEZIPWRAPPER'#010+
- 'ZIPPATHSEP=$(PATHSEP)'#010+
- 'ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(BATCHEXT','))'#010+
- 'else'#010+
- 'ZIPPATHSEP=/'#010+
- 'endif'#010+
- #010+
- '# Create commands to create the zip/tar file'#010+
- 'ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))'#010+
- 'ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))'#010+
- 'ifdef USETAR'#010+
- 'ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(TAREX','T)'#010+
- 'ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *'#010+
- 'else'#010+
- 'ZIPDESTFILE:=$(DIST_DESTDIR)/$(ZIPNAME)$(ZIPEXT)'#010+
- 'ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDES'+
- 'TFILE) *'#010+
- 'endif'#010+
- #010+
- 'fpc_zipinstall:'#010+
- ' $(MAKE) $(ZIPTARGET) ','INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1'#010+
- ' $(MKDIR) $(DIST_DESTDIR)'#010+
- ' $(DEL) $(ZIPDESTFILE)'#010+
- 'ifdef USEZIPWRAPPER'#010+
- '# Handle gecho separate as we need to espace \ with \\'#010+
- 'ifneq ($(ECHOREDIR),echo)'#010+
- ' $(ECHOREDIR) -e "$(subst \,\\',',$(ZIPCMD_CDPACK))" > $(ZIPWRAP'+
- 'PER)'#010+
- ' $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)'+
- #010+
- ' $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPP'+
- 'ER)'#010+
- 'else'#010+
- ' echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)'#010+
- ' ','echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)'#010+
- ' echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)'#010+
- 'endif'#010+
- 'ifdef inUnix'#010+
- ' /bin/sh $(ZIPWRAPPER)'#010+
- 'else'#010+
- ' $(ZIPWRAPPER)'#010+
- 'endif'#010+
- ' $(DEL) $(ZIPWRAPPER)'#010+
- 'else'#010+
- ' $(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ','; $(ZIPCMD_CDBASE)'#010+
- 'endif'#010+
- ' $(DELTREE) $(PACKDIR)'#010+
- #010+
- 'fpc_zipsourceinstall:'#010+
- ' $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=src'#010+
- #010+
- 'fpc_zipexampleinstall:'#010+
- 'ifdef HASEXAMPLES'#010+
- ' $(MAKE) fpc_zipinstall ZIPTARGET=exampleins','tall ZIPSUFFIX=ex'+
- 'm'#010+
- 'endif'#010+
- #010+
- 'fpc_zipdistinstall:'#010+
- ' $(MAKE) fpc_zipinstall ZIPTARGET=distinstall'#010+
- #010+
- #010+
- '[cleanrules]'#010+
- '#####################################################################'#010+
- '# Clean rules'#010+
- '##########################################','##########################'+
- '#'#010+
- #010+
- '.PHONY: fpc_clean fpc_cleanall fpc_distclean'#010+
- #010+
- 'ifdef EXEFILES'#010+
- 'override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES'+
- '))'#010+
- 'endif'#010+
- #010+
- 'ifdef CLEAN_UNITS'#010+
- 'override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEA','N_UNITS))'#010+
- 'endif'#010+
- #010+
- 'ifdef CLEANPPUFILES'#010+
- 'override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)'+
- ') $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(C'+
- 'LEANPPUFILES)))'#010+
- 'override CLEANPPUFILES:=$(addprefix $(UNITTARGE','TDIRPREFIX),$(CLEANPP'+
- 'UFILES))'#010+
- 'override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREF'+
- 'IX),$(CLEANPPULINKFILES)))'#010+
- 'endif'#010+
- #010+
- 'fpc_clean: $(CLEANTARGET)'#010+
- 'ifdef CLEANEXEFILES'#010+
- ' -$(DEL) $(CLEANEXEFILES)'#010+
- 'endif'#010+
- 'ifdef CLEANPPUFILES'#010+
- ' ',' -$(DEL) $(CLEANPPUFILES)'#010+
- 'endif'#010+
- 'ifneq ($(CLEANPPULINKFILES),)'#010+
- ' -$(DEL) $(CLEANPPULINKFILES)'#010+
- 'endif'#010+
- 'ifdef CLEANRSTFILES'#010+
- ' -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))'#010+
- 'endif'#010+
- 'ifdef CLEAN_FILES'#010+
- ' -$(DEL) ','$(CLEAN_FILES)'#010+
- 'endif'#010+
- 'ifdef LIB_NAME'#010+
- ' -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)'#010+
- 'endif'#010+
- ' -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(F'+
- 'PCEXTFILE) $(REDIRFILE)'#010+
- #010+
- 'fpc_distclean: clean'#010+
- #010+
- '# Also run clean first if targetdir i','s set. Unittargetdir is always'#010+
- '# set if targetdir or unittargetdir is specified'#010+
- 'ifdef COMPILER_UNITTARGETDIR'#010+
- 'TARGETDIRCLEAN=fpc_clean'#010+
- 'endif'#010+
- #010+
- 'fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)'#010+
- 'ifdef CLEANEXEFILES'#010+
- ' -$(DEL) $(CLEANEXEFILES)',#010+
- 'endif'#010+
- ' -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIB'+
- 'EXT) *$(SHAREDLIBEXT) *$(PPLEXT)'#010+
- ' -$(DELTREE) *$(SMARTEXT)'#010+
- ' -$(DEL) $(FPCMADE) $(PPAS) link.res $(FPCEXTFILE) $(REDIRFILE)'+
- #010+
- 'ifdef AOUTEXT'#010+
- ' -$(D','EL) *$(AOUTEXT)'#010+
- 'endif'#010+
- #010+
- #010+
- '[inforules]'#010+
- '#####################################################################'#010+
- '# Info rules'#010+
- '#####################################################################'#010+
- #010+
- '.PHONY: fpc_info'#010+
- #010+
- 'fpc_info:'#010+
- ' @$(ECHO)'#010+
- ' ',' @$(ECHO) == Package info =='#010+
- ' @$(ECHO) Package Name..... $(PACKAGE_NAME)'#010+
- ' @$(ECHO) Package Version.. $(PACKAGE_VERSION)'#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) == Configuration info =='#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) FPC...','....... $(FPC)'#010+
- ' @$(ECHO) FPC Version.. $(FPC_VERSION)'#010+
- ' @$(ECHO) Source CPU... $(CPU_SOURCE)'#010+
- ' @$(ECHO) Target CPU... $(CPU_TARGET)'#010+
- ' @$(ECHO) Source OS.... $(OS_SOURCE)'#010+
- ' @$(ECHO) Target OS.... $(OS_TARG','ET)'#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) == Directory info =='#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) Basedir......... $(BASEDIR)'#010+
- ' @$(ECHO) FPCDir.......... $(FPCDIR)'#010+
- ' @$(ECHO) UnitsDir........ $(UNITSDIR)'#010+
- ' @$(ECHO) Package','sDir..... $(PACKAGESDIR)'#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) GCC library..... $(GCCLIBDIR)'#010+
- ' @$(ECHO) Other library... $(OTHERLIBDIR)'#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) == Tools info =='#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) Pwd....... $(','PWD)'#010+
- ' @$(ECHO) Mv........ $(MVPROG)'#010+
- ' @$(ECHO) Cp........ $(CPPROG)'#010+
- ' @$(ECHO) Rm........ $(RMPROG)'#010+
- ' @$(ECHO) GInstall.. $(GINSTALL)'#010+
- ' @$(ECHO) Echo...... $(ECHO)'#010+
- ' @$(ECHO) Date...... $(DATE)'#010+
- ' ',' @$(ECHO) FPCMake... $(FPCMAKE)'#010+
- ' @$(ECHO) PPUMove... $(PPUMOVE)'#010+
- ' @$(ECHO) Upx....... $(UPXPROG)'#010+
- ' @$(ECHO) Zip....... $(ZIPPROG)'#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) == Object info =='#010+
- ' @$(ECHO)'#010+
- ' @$(EC','HO) Target Loaders...... $(TARGET_LOADERS)'#010+
- ' @$(ECHO) Target Units........ $(TARGET_UNITS)'#010+
- ' @$(ECHO) Target Programs..... $(TARGET_PROGRAMS)'#010+
- ' @$(ECHO) Target Dirs......... $(TARGET_DIRS)'#010+
- ' @$(ECHO) Target Exam','ples..... $(TARGET_EXAMPLES)'#010+
- ' @$(ECHO) Target ExampleDirs.. $(TARGET_EXAMPLEDIRS)'#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) Clean Units......... $(CLEAN_UNITS)'#010+
- ' @$(ECHO) Clean Files......... $(CLEAN_FILES)'#010+
- ' @$(ECHO)'#010+
- ' ','@$(ECHO) Install Units....... $(INSTALL_UNITS)'#010+
- ' @$(ECHO) Install Files....... $(INSTALL_FILES)'#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) == Install info =='#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) DateStr.............. $(DATESTR)'#010+
- ' @$(ECH','O) ZipPrefix............ $(ZIPPREFIX)'#010+
- ' @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)'#010+
- ' @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)'#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)'#010+
- ' @$','(ECHO) Install binary dir... $(INSTALL_BINDIR)'#010+
- ' @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)'#010+
- ' @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)'#010+
- ' @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)'#010+
- ' @$(ECH','O) Install doc dir...... $(INSTALL_DOCDIR)'#010+
- ' @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)'#010+
- ' @$(ECHO) Install data dir..... $(INSTALL_DATADIR)'#010+
- ' @$(ECHO)'#010+
- ' @$(ECHO) Dist destination dir. $(DIST_DESTDIR)'#010+
- ' ',' @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)'#010+
- ' @$(ECHO)'#010+
- #010+
- '[localmakefile]'#010+
- '#####################################################################'#010+
- '# Local Makefile'#010+
- '#################################################################','###'+
- '#'#010+
- #010+
- 'ifneq ($(wildcard fpcmake.loc),)'#010+
- 'include fpcmake.loc'#010+
- 'endif'#010+
- #010+
- '[userrules]'#010+
- '#####################################################################'#010+
- '# Users rules'#010+
- '#####################################################################'#010
- );
|