123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705 |
- #
- # Makefile.fpc for Free Pascal Compiler
- #
- [package]
- name=compiler
- version=2.5.1
- [target]
- programs=pp
- dirs=utils
- [compiler]
- targetdir=.
- unittargetdir=$(CPU_UNITDIR)/units/$(FULL_TARGET)
- unitdir=$(COMPILERSOURCEDIR)
- includedir=$(CPC_TARGET)
- [require]
- packages=rtl
- tools=diff cmp
- [install]
- fpcpackage=y
- [default]
- fpcdir=..
- [prerules]
- # Don't export version it can change after the first compile
- unexport FPC_VERSION FPC_COMPILERINFO
- # Which platforms are ready for inclusion in the cycle
- CYCLETARGETS=i386 powerpc sparc arm x86_64 powerpc64 m68k armeb mipsel mips
- # All supported targets used for clean
- ALLTARGETS=$(CYCLETARGETS)
- # Allow ALPHA, POWERPC, POWERPC64, M68K, I386 defines for target cpu
- ifdef ALPHA
- PPC_TARGET=alpha
- endif
- ifdef POWERPC
- PPC_TARGET=powerpc
- endif
- ifdef POWERPC64
- PPC_TARGET=powerpc64
- endif
- ifdef SPARC
- PPC_TARGET=sparc
- endif
- ifdef M68K
- PPC_TARGET=m68k
- endif
- ifdef I386
- PPC_TARGET=i386
- endif
- ifdef X86_64
- PPC_TARGET=x86_64
- endif
- ifdef ARM
- PPC_TARGET=arm
- endif
- ifdef ARMEB
- PPC_TARGET=armeb
- endif
- ifdef MIPS
- PPC_TARGET=mips
- endif
- ifdef MIPSEL
- PPC_TARGET=mipsel
- endif
- # Default is to generate a compiler for the same
- # platform as CPU_TARGET (a native compiler)
- ifndef PPC_TARGET
- PPC_TARGET=$(CPU_TARGET)
- endif
- ifeq ($(PPC_TARGET),armeb)
- CPC_TARGET=arm
- else
- CPC_TARGET=$(PPC_TARGET)
- endif
- # Default is to generate a compiler for the same
- # target as OS_TARGET (a native compiler)
- ifndef PPC_OS
- PPC_OS=$(OS_TARGET)
- endif
- # Where to place the unit files.
- CPU_UNITDIR=$(CPC_TARGET)
- # RTL
- UTILSDIR=../utils
- # Directories containing compiler sources
- COMPILERSOURCEDIR=$(CPC_TARGET) systems
- # Utils used by compiler development/installation
- COMPILERUTILSDIR=utils
- # Default language for the compiler
- ifndef FPCLANG
- FPCLANG=e
- endif
- # Local options for the compiler only
- ifndef LOCALOPT
- LOCALOPT:=$(OPT)
- endif
- # Options for the RTL only when cycling
- ifndef RTLOPT
- RTLOPT:=$(OPT)
- endif
- # Make OPT empty. It is copied to LOCALOPT and RTLOPT
- override OPT=
- # Message files
- MSGFILES=$(wildcard msg/error*.msg)
- # ppcSUFFIX
- ifeq ($(CPC_TARGET),i386)
- CPUSUF=386
- endif
- ifeq ($(CPC_TARGET),alpha)
- CPUSUF=axp
- endif
- ifeq ($(CPC_TARGET),m68k)
- CPUSUF=68k
- endif
- ifeq ($(CPC_TARGET),powerpc)
- CPUSUF=ppc
- endif
- ifeq ($(CPC_TARGET),powerpc64)
- CPUSUF=ppc64
- endif
- ifeq ($(CPC_TARGET),sparc)
- CPUSUF=sparc
- endif
- ifeq ($(CPC_TARGET),x86_64)
- CPUSUF=x64
- endif
- ifeq ($(CPC_TARGET),arm)
- CPUSUF=arm
- endif
- ifeq ($(CPC_TARGET),mips)
- CPUSUF=mips
- endif
- ifeq ($(CPC_TARGET),mipsel)
- CPUSUF=mipsel
- endif
- # Do not define the default -d$(CPU_TARGET) because that
- # will conflict with our -d$(CPC_TARGET)
- NOCPUDEF=1
- # Default message file
- MSGFILE=msg/error$(FPCLANG).msg
- SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))
- # Check if revision.inc is present
- REVINC:=$(wildcard revision.inc)
- ifneq ($(REVINC),)
- # File revision.inc is present
- #Use it to compile version.pas unit
- override LOCALOPT+=-dREVINC
- # Automatically update revision.inc if
- # svnversion executable is available
- ifeq ($(REVSTR),)
- ifneq ($(SVNVERSION),)
- REVSTR:=$(shell $(SVNVERSION) -c .)
- export REVSTR
- else
- ifeq ($(REVINC),force)
- REVSTR:=exported
- export REVSTR
- endif
- endif
- endif
- endif
- # set correct defines (-d$(CPU_TARGET) is automaticly added in makefile.fpc)
- override LOCALOPT+=-d$(CPC_TARGET) -dGDB -dBROWSERLOG
- # i386 specific
- ifeq ($(PPC_TARGET),i386)
- override LOCALOPT+=-Fux86
- endif
- # x86_64 specific
- ifeq ($(PPC_TARGET),x86_64)
- override LOCALOPT+=-Fux86
- endif
- # PowerPC specific
- ifeq ($(PPC_TARGET),powerpc)
- override LOCALOPT+=-Fuppcgen
- endif
- # PowerPC64 specific
- ifeq ($(PPC_TARGET),powerpc64)
- override LOCALOPT+=-Fuppcgen
- endif
- # m68k specific
- ifeq ($(PPC_TARGET),m68k)
- override LOCALOPT+=-dNOOPT
- endif
- # Sparc specific
- ifeq ($(PPC_TARGET),sparc)
- override LOCALOPT+=
- endif
- # m68k specific with low stack
- ifeq ($(PPC_TARGET),m68k)
- ifeq ($(OS_TARGET),amiga)
- override LOCALOPT+=-Ct
- endif
- endif
- # ARM specific
- ifeq ($(PPC_TARGET),arm)
- override LOCALOPT+=
- endif
- # mipsel specific
- ifeq ($(PPC_TARGET),mipsel)
- override LOCALOPT+=-Fumips
- endif
- OPTWPOCOLLECT=-OWdevirtcalls,optvmts -FW$(BASEDIR)/pp1.wpo
- OPTWPOPERFORM=-Owdevirtcalls,optvmts -Fw$(BASEDIR)/pp1.wpo
- # symbol liveness WPO requires nm, smart linking and no stripping (the latter
- # is forced by the Makefile when necessary)
- ifneq ($(findstring $(OS_TARGET),darwin linux freebsd solaris),)
- ifdef LINKSMART
- ifdef CREATESMART
- OPTWPOCOLLECT+=-OWsymbolliveness -Xs-
- OPTWPOPERFORM+=-Owsymbolliveness
- endif
- endif
- endif
- [rules]
- #####################################################################
- # Setup Targets
- #####################################################################
- ifeq ($(OS_TARGET),win32)
- ifdef CMP
- override DIFF:=$(CMP) -i218
- endif
- endif
- # Add Local options
- override COMPILER+=$(LOCALOPT)
- #####################################################################
- # PASDoc
- #####################################################################
- PASDOC:=$(strip $(wildcard $(addsuffix /pasdoc.exe,$(SEARCHPATH))))
- ifeq ($(PASDOC),)
- PASDOC:=$(strip $(wildcard $(addsuffix /pasdoc,$(SEARCHPATH))))
- endif
- ifeq ($(PASDOC),)
- PASDOC:=../projects/pasdoc/bin/pasdoc
- else
- PASDOC:=$(firstword $(PASDOC))
- endif
- #####################################################################
- # Setup os-independent filenames
- #####################################################################
- ifndef EXENAME
- EXENAME=ppc$(CPUSUF)$(EXEEXT)
- endif
- PPEXENAME=pp$(EXEEXT)
- TEMPNAME=ppc$(SRCEXEEXT)
- PPCROSSNAME=ppcross$(CPUSUF)$(SRCEXEEXT)
- TEMPNAME1=ppc1$(EXEEXT)
- TEMPNAME2=ppc2$(EXEEXT)
- TEMPNAME3=ppc3$(EXEEXT)
- TEMPWPONAME1=ppcwpo1$(EXEEXT)
- TEMPWPONAME2=ppcwpo2$(EXEEXT)
- MAKEDEP=ppdep$(EXEEXT)
- MSG2INC=./msg2inc$(EXEEXT)
- ifdef CROSSINSTALL
- INSTALLEXEFILE=$(PPCROSSNAME)
- else
- INSTALLEXEFILE=$(EXENAME)
- endif
- #####################################################################
- # CPU targets
- #####################################################################
- PPC_TARGETS=i386 m68k powerpc sparc arm armeb x86_64 powerpc64 alpha vis ia64 mips mipsel
- .PHONY: $(PPC_TARGETS)
- $(PPC_TARGETS):
- $(MAKE) PPC_TARGET=$@ CPU_UNITDIR=$@ all
- alltargets: $(ALLTARGETS)
- #####################################################################
- # Default makefile
- #####################################################################
- .NOTPARALLEL:
- .PHONY: all compiler echotime ppuclean execlean clean distclean
- all: compiler $(addsuffix _all,$(TARGET_DIRS))
- compiler: $(COMPILER_UNITTARGETDIR) $(COMPILER_TARGETDIR) $(EXENAME)
- ifeq ($(MAKELEVEL),0)
- ifndef STARTTIME
- ifdef DATE
- STARTTIME:=$(shell $(DATE) +%T)
- else
- STARTTIME:=unknown
- endif
- endif
- endif
- export STARTTIME
- ifdef DATE
- ENDTIME=$(shell $(DATE) +%T)
- else
- ENDTIME:=unknown
- endif
- echotime:
- @echo Start $(STARTTIME) now $(ENDTIME)
- ppuclean:
- -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
- -$(DEL) $(addsuffix /*$(PPUEXT),$(COMPILERSOURCEDIR))
- tempclean:
- -$(DEL) $(PPCROSSNAME) $(TEMPNAME) $(TEMPNAME1) $(TEMPNAME2) $(TEMPNAME3) $(MSG2INC) pp1.wpo pp2.wpo
- execlean :
- -$(DEL) ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) $(EXENAME) $(TEMPWPONAME1) $(TEMPWPONAME2)
- $(addsuffix _clean,$(ALLTARGETS)):
- -$(DELTREE) $(addprefix $(subst _clean,,$@),/units)
- -$(DEL) $(addprefix $(subst _clean,,$@)/,*$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT))
- -$(DEL) $(addprefix $(subst _clean,,$@)/,ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcppc$(EXEEXT) $(EXENAME))
- cycleclean: cleanall $(addsuffix _clean,$(CPC_TARGET))
- -$(DEL) $(EXENAME)
- clean: tempclean execlean cleanall $(addsuffix _clean,$(CPC_TARGET)) $(addsuffix _clean,$(TARGET_DIRS))
- distclean: tempclean execlean cleanall $(addsuffix _clean,$(ALLTARGETS)) $(addsuffix _distclean,$(TARGET_DIRS))
- #####################################################################
- # Make targets
- #####################################################################
- $(MSG2INC): $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(COMPILERUTILSDIR)/msg2inc.pp
- $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp
- # The msgtxt.inc only depends on the error?.msg file, not on msg2inc,
- # because that one will be new almost everytime
- msgtxt.inc: $(MSGFILE)
- $(MAKE) $(MSG2INC)
- $(MSG2INC) $(MSGFILE) msg msg
- msg: msgtxt.inc
- insdatx86 : $(COMPILER_UNITTARGETDIR) x86/x86ins.dat
- $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkx86ins.pp
- cd x86 && ../utils/mkx86ins$(SRCEXEEXT) && mv -f *.inc ../i386
- cd x86 && ../utils/mkx86ins$(SRCEXEEXT) x86_64 && mv -f *.inc ../x86_64
- insdatarm : arm/armins.dat
- $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkarmins.pp
- cd arm && ../utils/mkarmins$(SRCEXEEXT)
- insdat: insdatx86 insdatarm
- regdatarm : arm/armreg.dat
- $(COMPILER) -FE$(COMPILERUTILSDIR) $(COMPILERUTILSDIR)/mkarmreg.pp
- cd arm && ../utils/mkarmreg$(SRCEXEEXT)
- # revision.inc rule
- revision.inc :
- ifneq ($(REVSTR),)
- ifdef USEZIPWRAPPER
- ifneq ($(ECHOREDIR),echo)
- $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
- else
- $(ECHOREDIR) '$(REVSTR)' > revision.inc
- endif
- else
- $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
- endif
- else
- $(MAKE) revision.inc REVINC=force
- endif
- .PHONY : revision
- revision :
- $(DEL) revision.inc
- $(MAKE) revision.inc
- # Make only the compiler
- # ECHOREDIR sometimes does not remove double quotes
- $(EXENAME) : $(wildcard *.pas) $(wildcard *.inc) msg \
- $(wildcard systems/*.pas) $(wilcard systems/*.inc) \
- $(wildcard $(CPC_TARGET)/*.pas) $(wildcard $(CPC_TARGET)/*.inc)
- ifneq ($(REVSTR),)
- ifdef USEZIPWRAPPER
- ifneq ($(ECHOREDIR),echo)
- $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
- else
- $(ECHOREDIR) '$(REVSTR)' > revision.inc
- endif
- else
- $(ECHOREDIR) "'$(REVSTR)'" > revision.inc
- endif
- $(COMPILER) version.pas
- endif
- $(COMPILER) pp.pas
- $(EXECPPAS)
- $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME)
- #####################################################################
- # Cycle targets
- #
- # 1. Source CPU = Target CPU and Source OS = Target OS
- # Normal cycle
- #
- # 2. Source CPU = Target CPU and Source OS <> Target OS
- # First source native compiler
- # Second target native compiler (skipped for cross installation)
- #
- # 3. Source CPU <> Target CPU
- # First source native compiler
- # Second cross compiler
- # Third target native compiler (skipped for cross installation)
- #
- #####################################################################
- ifeq ($(CPU_SOURCE),$(PPC_TARGET))
- ifeq ($(OS_SOURCE),$(OS_TARGET))
- ##########################
- # Normal cycle
- #
- ifndef NOWPOCYCLE
- ifdef RELEASE
- DOWPOCYCLE=1
- # Two WPO cycles in case of RELEASE=1
- wpocycle:
- # don't use cycle_clean, it will delete the compiler utilities again
- $(RM) $(EXENAME)
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OPT=$(LOCALOPT) $(OPTWPOCOLLECT)' compiler
- $(RM) $(EXENAME)
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OPT=$(RTLOPT) $(OPTWPOPERFORM)' rtlclean rtl
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OPT=$(LOCALOPT) $(OPTWPOPERFORM) $(subst pp1.wpo,pp2.wpo,$(OPTWPOCOLLECT))' $(addsuffix _clean,$(ALLTARGETS)) compiler
- $(MOVE) $(EXENAME) $(TEMPWPONAME1)
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1)' 'OPT=$(RTLOPT) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM))' rtlclean rtl
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPWPONAME1)' 'OPT=$(LOCALOPT) $(subst pp1.wpo,pp2.wpo,$(OPTWPOPERFORM))' $(addsuffix _clean,$(ALLTARGETS)) compiler
- $(COPY) $(EXENAME) $(TEMPWPONAME2)
- endif
- endif
- ifndef DOWPOCYCLE
- wpocycle:
- endif
- # Used to avoid unnecessary steps
- ifdef DIFF
- ifdef OLDFPC
- ifneq ($(OS_TARGET),darwin)
- DIFFRESULT:=$(shell $(DIFF) $(OLDFPC) $(FPC))
- else
- DIFFRESULT:=$(shell cp $(OLDFPC) $(OLDFPC).tmp; cp $(FPC) $(FPC).tmp; strip -no_uuid $(OLDFPC).tmp; strip -no_uuid $(FPC).tmp; $(DIFF) $(OLDFPC).tmp $(FPC).tmp; rm $(OLDFPC).tmp $(FPC).tmp)
- endif
- else
- DIFFRESULT=Not equal
- endif
- else
- DIFFRESULT=No diff program
- endif
- ifndef DIFFRESULT
- next :
- @echo $(OLDFPC) and $(FPC) are equal
- $(COPY) $(FPC) $(EXENAME)
- else
- next :
- $(MAKE) rtlclean rtl
- $(MAKE) cycleclean compiler
- $(MAKE) echotime
- endif
- $(TEMPNAME1) :
- $(MAKE) 'OLDFPC=' next
- -$(DEL) $(TEMPNAME1)
- $(MOVE) $(EXENAME) $(TEMPNAME1)
- $(TEMPNAME2) : $(TEMPNAME1)
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME1)' 'OLDFPC=' next
- -$(DEL) $(TEMPNAME2)
- $(MOVE) $(EXENAME) $(TEMPNAME2)
- $(TEMPNAME3) : $(TEMPNAME2)
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME2)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME1)' next
- -$(DEL) $(TEMPNAME3)
- $(MOVE) $(EXENAME) $(TEMPNAME3)
- cycle:
- $(MAKE) tempclean $(TEMPNAME3)
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME3)' 'OLDFPC=$(BASEDIR)/$(TEMPNAME2)' next
- $(DIFF) $(TEMPNAME3) $(EXENAME)
- $(MAKE) $(addsuffix _all,$(TARGET_DIRS)) 'FPC=$(BASEDIR)/$(EXENAME)'
- $(MAKE) wpocycle
- $(MAKE) echotime
- else
- ##########################
- # Cross Target cycle
- #
- cycle:
- # ppc (source native)
- $(MAKE) OS_TARGET=$(OS_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
- $(MAKE) OS_TARGET=$(OS_SOURCE) EXENAME=$(TEMPNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
- # ppcross<ARCH> (source native)
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) EXENAME=$(PPCROSSNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
- # ppc<ARCH> (target native)
- ifndef CROSSINSTALL
- $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' rtlclean rtl
- # building a native compiler for embedded targets is not possible
- ifneq ($(OS_TARGET),embedded)
- $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' cycleclean compiler
- endif
- endif
- endif
- else
- ##########################
- # Cross CPU cycle
- #
- # ppc1 = native
- # ppc2 = cross running on this platform
- # ppc3/ppcXXX = native (skipped for cross installation)
- #
- cycle:
- # ppc (source native)
- # Clear detected compiler binary, because it can be existing crosscompiler binary, but we need native compiler here
- override FPC=
- $(MAKE) OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
- $(MAKE) OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) EXENAME=$(TEMPNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
- # ppcross<ARCH> (source native)
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl
- $(MAKE) 'FPC=$(BASEDIR)/$(TEMPNAME)' OS_TARGET=$(OS_SOURCE) CPU_TARGET=$(CPU_SOURCE) PPC_TARGET=$(CPU_TARGET) EXENAME=$(PPCROSSNAME) CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 cycleclean compiler
- # ppc<ARCH> (target native)
- ifndef CROSSINSTALL
- $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' 'OPT=$(OPT) $(CROSSOPT)' rtlclean rtl
- # building a native compiler for embedded targets is not possible
- ifneq ($(OS_TARGET),embedded)
- $(MAKE) 'FPC=$(BASEDIR)/$(PPCROSSNAME)' 'OPT=$(OPT) $(CROSSOPT)' cycleclean compiler
- endif
- endif
- endif
- cycledep:
- $(MAKE) cycle USEDEPEND=1
- extcycle:
- $(MAKE) cycle OPT='-n -OG2p3 -glttt -CRriot -dEXTDEBUG'
- cvstest:
- $(MAKE) cycle 'LOCALOPT=-n -Se' 'RTLOPT=-n -Se'
- ##########################
- # Full cycle
- #
- # 1. build a compiler using cycle
- # 2. remove all .ppufiles
- # 3. build all supported cross compilers except the
- # current PPC_TARGET which was already build
- #
- full: fullcycle
- fullcycle:
- $(MAKE) cycle
- $(MAKE) ppuclean
- $(MAKE) $(filter-out $(PPC_TARGET),$(CYCLETARGETS)) 'FPC=$(BASEDIR)/$(EXENAME)'
- #####################################################################
- # Docs
- #####################################################################
- htmldocs:
- $(PASDOC) -p -h -o html$(PATHSEP)$(PPC_TARGET) -d fpc -d gdb -d $(PPC_TARGET) -u $(PPC_TARGET) $(PPC_TARGET)$(PATHSEP)*.pas systems$(PATHSEP)*.pas *.pas
- #####################################################################
- # Installation
- #####################################################################
- .PHONY: quickinstall install installsym
- MSGINSTALLDIR=$(INSTALL_BASEDIR)/msg
- override PPEXEFILE:=$(wildcard $(EXENAME))
- ifdef UNIXHier
- PPCCPULOCATION=$(INSTALL_BASEDIR)
- else
- PPCCPULOCATION=$(INSTALL_BINDIR)
- endif
- # This will only install the ppcXXX executable, not the message files etc.
- quickinstall: $(addsuffix _install,$(TARGET_DIRS))
- # Install ppcXXX executable, for a cross installation we install
- # the ppcrossXXX as ppcXXX. The target native build ppcXXX is not used
- # for this installation type
- ifneq ($(INSTALLEXEFILE),)
- ifdef UPXPROG
- -$(UPXPROG) $(INSTALLEXEFILE)
- endif
- $(MKDIR) $(PPCCPULOCATION)
- $(INSTALLEXE) $(INSTALLEXEFILE) $(PPCCPULOCATION)/$(INSTALLEXEFILE)
- endif
- install: quickinstall
- ifndef CROSSINSTALL
- ifdef UNIXHier
- $(MKDIR) $(INSTALL_BASEDIR)
- $(INSTALLEXE) $(COMPILERUTILSDIR)/samplecfg $(INSTALL_BASEDIR)/samplecfg
- endif
- $(MKDIR) $(MSGINSTALLDIR)
- $(INSTALL) $(MSGFILES) $(MSGINSTALLDIR)
- endif
- # This also installs a link from bin to the actual executable.
- # The .deb does that later.
- installsymlink: install
- ifneq ($(PPCCPULOCATION),$(INSTALL_BINDIR))
- $(MKDIR) $(INSTALL_BINDIR)
- ln -sf $(INSTALL_BASEDIR)/$(EXENAME) $(INSTALL_BINDIR)/$(EXENAME)
- endif
- #####################################################################
- # RTL
- #####################################################################
- .PHONY: rtl rtlclean rtlinstall
- rtl:
- $(MAKE) -C $(PACKAGEDIR_RTL) 'OPT=$(RTLOPT)' all
- rtlclean:
- $(MAKE) -C $(PACKAGEDIR_RTL) clean
- rtlinstall:
- $(MAKE) -C $(PACKAGEDIR_RTL) install
- #####################################################################
- # local user configurable file
- # in makefile.loc you can add any desired target
- #####################################################################
- localmake:=$(strip $(wildcard makefile.loc))
- ifdef localmake
- include ./$(localmake)
- endif
|