123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493 |
- #
- # Makefile.fpc for Free Pascal Source Tree
- #
- [targets]
- dirs=compiler rtl utils fcl api fv packages ide
- [defaults]
- defaultrule=help
- [tools]
- toolzip=1
- toolupx=1
- tooldate=1
- [sections]
- none=1
- dirs=1
- tools=1
- exts=1
- clean=1
- zipinstall=1
- [presettings]
- OLDFPCDIR:=$(FPCDIR)
- checkfpcdir:
- ifdef OLDFPCDIR
- ifneq ($(OLDFPCDIR),)
- FPCDIRSET=fpcdirset
- fpcdirset:
- @echo ---------------------------------------------------------
- @echo
- @echo You must unset FPCDIR to use this the packaging rules.
- @echo
- @echo ---------------------------------------------------------
- @cantcontinuewithfpcdir
- endif
- endif
- # Check if install/ subdir is available
- ifneq ($(wildcard install),)
- CVSINSTALL=install
- else
- CVSINSTALL=.
- endif
- # All target
- ifdef SNAPSHOT
- ALLTARGET=all
- else
- ifndef ALLTARGET
- ifeq ($(OS_TARGET),win32)
- ALLTARGET=smart
- else
- ifeq ($(OS_TARGET),go32v2)
- ALLTARGET=smart
- else
- ALLTARGET=all
- endif
- endif
- endif
- endif
- # Stop with an error?
- ifdef SNAPSHOT
- NOSTOP=-
- else
- NOSTOP=
- endif
- # Prefix for units
- ifeq ($(OS_TARGET),linux)
- PKGPRE=units
- else
- PKGPRE=u
- endif
- # Test dir if none specified
- ifndef PREFIXINSTALLDIR
- ifdef inlinux
- PREFIXINSTALLDIR=/tmp/pptest
- else
- PREFIXINSTALLDIR=/pptest
- endif
- endif
- # Always compile for release
- override RELEASE=1
- export RELEASE
- # We want to have the resulting .zips in the current dir
- ifndef DESTZIPDIR
- export DESTZIPDIR:=$(BASEDIR)
- endif
- # Temporary path to pack a file
- BASEPACKDIR=$(BASEDIR)/basepack
- # Use new ppc386
- PPNEW=$(BASEDIR)/compiler/ppc386$(EXEEXT)
- # Don't use ppufiles for win32 becuase of commandline length problems
- ifneq ($(OS_TARGET),win32)
- PPUFILESNEW=$(BASEDIR)/utils/ppufiles$(EXEEXT)
- endif
- # Build/install options
- BUILDOPTS=FPC=$(PPNEW) RELEASE=1
- INSTALLOPTS=FPC=$(PPNEW) ZIPDESTDIR=$(BASEDIR)
- ifdef PPUFILESNEW
- override INSTALLOPT+=PPUFILES=$(PPUFILESNEW)
- endif
- # Compile also IDE (check for ide and fv dir)
- ifneq ($(wildcard ide),)
- ifneq ($(wildcard fv),)
- ifeq ($(OS_TARGET),go32v2)
- IDE=1
- endif
- ifeq ($(OS_TARGET),win32)
- IDE=1
- endif
- ifeq ($(OS_TARGET),linux)
- IDE=1
- endif
- endif
- endif
- [rules]
- # These values can change
- unexport FPC_VERSION OS_SOURCE
- #####################################################################
- # Main targets
- #####################################################################
- .PHONY: help checkfpcdir
- help:
- @echo
- @echo Directory targets:
- @echo
- @echo $(DIROBJECTS)
- @echo
- @echo Packing targets are:
- @echo
- @echo go32v2zip,win32zip,linuxzip,sourcezip
- @echo
- @exit
- #####################################################################
- # Dependencies
- #####################################################################
- #######################################
- # Compiler
- #######################################
- .PHONY: compiler_cycle
- compiler_cycle:
- $(MAKE) -C compiler cycle
- #######################################
- # IDE
- #######################################
- .PHONY: ide_comp ide_full
- ide_comp:
- $(MAKE) -C compiler ppuclean
- $(MAKE) -C ide full
- # Look if libgdb.a is available then use fullgdb
- ifneq ($(wildcard packages/gdbint/libgdb/$(OS_TARGET)/libgdb.a),)
- ide_full:
- $(MAKE) -C compiler ppuclean
- $(MAKE) -C ide fullgdb
- else
- ide_full:
- $(MAKE) -C compiler ppuclean
- $(MAKE) -C ide full
- endif
- #######################################
- # Install targets
- #######################################
- demo_install:
- $(MAKE) -C $(CVSINSTALL)/demo installexamples
- man_install:
- $(MAKE) -C $(CVSINSTALL)/man installman
- doc_install:
- $(MAKE) -C $(CVSINSTALL)/doc installdoc
- #######################################
- # Packaging targets
- #######################################
- idezips: ide_fullzip ide_fullgdbzip optcompinstall optcompzip
- ide_compzip:
- $(MAKE) compiler_clean
- $(MAKE) ide_clean
- $(MAKE) ide_full
- $(MAKE) -C ide/text zipinstall ZIPNAME=ide-comp-$(PACKAGESUFFIX)
- ide_fullgdbzip:
- $(MAKE) ide_clean
- $(MAKE) ide_fullgdb
- $(MAKE) -C ide/text zipinstall ZIPNAME=ide-full-$(PACKAGESUFFIX)
- optcompinstall:
- $(MAKE) compiler_cycle OPT=-dNEWOPTIMIZATIONS
- $(MAKE) compiler_install
- $(MAKE) rtl_install
- optcompzip:
- $(MAKE) fpc_zipinstall PACKAGENAME=optcomp ZIPTARGET=optcompinstall
- ##########################################################################
- # Install
- ##########################################################################
- .PHONY: installer
- INSTALLERBUILDDIR=fpinst
- installer:
- $(COPYTREE) $(CVSINSTALL)/fpinst $(INSTALLERBUILDDIR)
- $(MAKE) -C $(INSTALLERBUILDDIR) all RELEASE=1
- $(MOVE) $(INSTALLERBUILDDIR)/install.exe .
- ifdef UPXPROG
- -$(UPXPROG) install.exe
- endif
- $(DELTREE) $(INSTALLERBUILDDIR)
- installersrc:
- $(COPYTREE) $(CVSINSTALL)/fpinst $(INSTALLERBUILDDIR)
- $(MAKE) -C $(INSTALLERBUILDDIR) zipsourceinstall
- $(DELTREE) $(INSTALLERBUILDDIR)
- ##########################################################################
- # Packaging
- ##########################################################################
- .PHONY: all clean distclean build installbase zipinstall zipinstallbase zipinstallfcl \
- zipinstallpackages
- export RELEASE DESTZIPDIR
- all: build
- clean: $(addsuffix _distclean,$(DIROBJECTS))
- $(DEL) build-stamp
- distclean: clean
- build: build-stamp
- build-stamp:
- # create new compiler
- ifeq ($(OS_TARGET),win32)
- -$(MAKE) compiler_cycle
- else
- $(MAKE) compiler_cycle
- endif
- # clean
- $(MAKE) rtl_clean
- $(MAKE) api_clean
- $(MAKE) fcl_clean
- $(MAKE) packages_clean
- $(MAKE) utils_clean
- ifdef IDE
- $(MAKE) fv_clean
- $(MAKE) ide_clean
- endif
- # build everything
- $(MAKE) rtl_$(ALLTARGET) $(BUILDOPTS)
- $(MAKE) api_$(ALLTARGET) $(BUILDOPTS)
- $(MAKE) fcl_$(ALLTARGET) $(BUILDOPTS)
- $(MAKE) packages_$(ALLTARGET) $(BUILDOPTS)
- $(MAKE) utils_all $(BUILDOPTS)
- ifdef IDE
- -$(MAKE) ide_full $(BUILDOPTS)
- endif
- $(ECHO) Build > build-stamp
- installbase: build-stamp
- # create dirs
- $(MKDIR) $(BASEINSTALLDIR)
- $(MKDIR) $(DOCINSTALLDIR)
- $(MKDIR) $(BININSTALLDIR)
- ifndef SNAPSHOT
- # readme & whatsnew and docs
- $(COPY) $(CVSINSTALL)/doc/*.txt $(CVSINSTALL)/doc/copying* $(CVSINSTALL)/doc/faq.* $(DOCINSTALLDIR)
- # bingo32 (cwsdpmi,wmemu387.dxe)
- ifeq ($(OS_TARGET),go32v2)
- $(COPY) $(CVSINSTALL)/bingo32/* $(BININSTALLDIR)
- endif
- # binw32 (cygwin1.dll)
- ifeq ($(OS_TARGET),win32)
- $(COPY) $(CVSINSTALL)/binw32/* $(BININSTALLDIR)
- endif
- # manpages for linux
- ifeq ($(OS_TARGET),linux)
- $(MAKE) -C $(CVSINSTALL)/man installman
- endif
- endif
- # install generated things
- $(MAKE) compiler_install $(INSTALLOPTS)
- $(MAKE) rtl_install $(INSTALLOPTS)
- install: build-stamp
- $(MAKE) installbase $(INSTALLOPTS)
- $(MAKE) utils_install $(INSTALLOPTS)
- $(MAKE) api_install $(INSTALLOPTS)
- $(MAKE) fcl_install $(INSTALLOPTS)
- $(MAKE) packages_install $(INSTALLOPTS)
- ifdef IDE
- $(NOSTOP)$(MAKE) ide_install $(BUILDOPTS)
- endif
- zipinstall: $(FPCDIRSET) build-stamp
- $(MAKE) fpc_zipinstall ZIPTARGET=installbase PACKAGENAME=base $(INSTALLOPTS)
- $(MAKE) utils_zipinstall $(INSTALLOPTS)
- $(MAKE) api_zipinstall $(INSTALLOPTS) PACKAGEPREFIX=$(PKGPRE)
- $(MAKE) fcl_zipinstall $(INSTALLOPTS) PACKAGEPREFIX=$(PKGPRE)
- $(MAKE) packages_zipinstall $(INSTALLOPTS) PACKAGEPREFIX=$(PKGPRE)
- ifdef IDE
- $(NOSTOP)$(MAKE) ide_zipinstall $(INSTALLOPTS)
- endif
- ##########################################################################
- # Docs
- ##########################################################################
- .PHONY: docspdf docs docsrcinstall docsrc
- docspdf:
- $(MAKE) -C docs pdfinstall
- docs:
- $(MAKE) fpc_zipinstall ZIPTARGET=docspdf ZIPNAME=docs
- docsrcinstall:
- $(MAKE) -C docs clean
- $(MKDIR) $(SOURCEINSTALLDIR)
- $(COPYTREE) docs $(SOURCEINSTALLDIR)
- docsrc:
- $(MAKE) fpc_zipinstall ZIPTARGET=docsrcinstall ZIPNAME=docsrc
- ##########################################################################
- # Demos
- ##########################################################################
- .PHONY: demozip
- demozip:
- $(MAKE) -C $(CVSINSTALL)/demo zipsourceinstall ZIPNAME=demo
- ##########################################################################
- # Source targets
- ##########################################################################
- sourcebase:
- # base Makefiles needed for sources
- $(MKDIR) $(SOURCEINSTALLDIR)
- $(MKDIR) $(SOURCEINSTALLDIR)/rtl
- $(MKDIR) $(SOURCEINSTALLDIR)/packages
- $(COPY) Makefile* $(SOURCEINSTALLDIR)
- $(COPY) rtl/Makefile* $(SOURCEINSTALLDIR)/rtl
- $(COPY) packages/Makefile* $(SOURCEINSTALLDIR)/packages
- sourcezip:
- $(MAKE) fpc_zipinstall ZIPTARGET=sourcebase ZIPNAME=basesrc
- $(MAKE) compiler_zipsourceinstall
- $(MAKE) rtl_zipsourceinstall
- $(MAKE) api_zipsourceinstall
- $(MAKE) fcl_zipsourceinstall
- $(MAKE) packages_zipsourceinstall
- $(MAKE) utils_zipsourceinstall
- # $(MAKE) installersrc
- # $(MAKE) docsrc
- ##########################################################################
- # OS targets
- ##########################################################################
- .PHONY: go32v2 win32 linux go32v2zip win32zip linuxzip
- go32v2:
- $(MAKE) install OS_TARGET=go32v2
- win32:
- $(MAKE) install OS_TARGET=win32
- linux:
- $(MAKE) install OS_TARGET=linux
- go32v2zip:
- $(MAKE) zipinstall OS_TARGET=go32v2
- win32zip:
- $(MAKE) zipinstall OS_TARGET=win32
- linuxzip:
- $(MAKE) zipinstall OS_TARGET=linux
- ##########################################################################
- # Debian / RPM
- ##########################################################################
- .PHONY: debcopy deb rpmcopy rpm
- DEBSRCDIR:=/usr/src/fpc-$(FPC_VERSION)
- debcopy: distclean
- rm -rf $(DEBSRCDIR)
- install -d $(DEBSRCDIR)
- $(COPYTREE) compiler $(DEBSRCDIR)
- $(COPYTREE) rtl $(DEBSRCDIR)
- $(COPYTREE) fcl $(DEBSRCDIR)
- $(COPYTREE) api $(DEBSRCDIR)
- $(COPYTREE) packages $(DEBSRCDIR)
- $(COPYTREE) utils $(DEBSRCDIR)
- $(COPYTREE) logs $(DEBSRCDIR)
- $(COPYTREE) docs $(DEBSRCDIR)
- $(COPYTREE) base/Makefile* $(DEBSRCDIR)
- $(COPYTREE) $(CVSINSTALL)/debian $(DEBSRCDIR)
- $(COPYTREE) $(CVSINSTALL)/man $(DEBSRCDIR)
- $(COPYTREE) $(CVSINSTALL)/doc $(DEBSRCDIR)
- $(COPYTREE) $(CVSINSTALL)/demo $(DEBSRCDIR)
- find $(DEBSRCDIR) -name 'CVS*' | xargs -n1 rm -rf
- chmod 755 $(DEBSRCDIR)/debian/rules
- deb: debcopy
- cd $(DEBSRCDIR) ; debian/rules binary
- REDHATDIR=/usr/src/redhat
- RPMSOURCESDIR:=$(REDHATDIR)/SOURCES
- RPMSPECDIR:=$(REDHATDIR)/SPECS
- RPMSRCDIR:=$(RPMSOURCESDIR)/fpc
- DOCSRCDIR:=$(RPMSOURCESDIR)/fpcdoc
- rpmcopy: distclean
- install -d $(REDHATDIR)
- install -d $(RPMSPECDIR)
- install -d $(RPMSOURCESDIR)
- # fpc.rpm
- rm -rf $(RPMSRCDIR)
- cp $(CVSINSTALL)/fpc-$(FPC_VERSION).spec $(RPMSPECDIR)
- install -d $(RPMSRCDIR)
- $(COPYTREE) compiler $(RPMSRCDIR)
- $(COPYTREE) rtl $(RPMSRCDIR)
- $(COPYTREE) fcl $(RPMSRCDIR)
- $(COPYTREE) api $(RPMSRCDIR)
- $(COPYTREE) packages $(RPMSRCDIR)
- $(COPYTREE) utils $(RPMSRCDIR)
- $(COPYTREE) logs $(RPMSRCDIR)
- $(COPYTREE) base/Makefile* $(RPMSRCDIR)
- $(COPYTREE) $(CVSINSTALL)/man $(RPMSRCDIR)
- $(COPYTREE) $(CVSINSTALL)/doc $(RPMSRCDIR)
- $(COPYTREE) $(CVSINSTALL)/demo $(RPMSRCDIR)
- find $(RPMSRCDIR) -name 'CVS*' | xargs -n1 rm -rf
- cd $(RPMSRCDIR) ; tar cvz * > $(RPMSOURCESDIR)/fpc-$(FPC_VERSION)-src.tar.gz
- # fpc-docs.rpm
- rm -rf $(DOCSRCDIR)
- cp $(CVSINSTALL)/fpc-docs-$(FPC_VERSION).spec $(RPMSPECDIR)
- install -d $(DOCSRCDIR)
- $(COPYTREE) docs $(DOCSRCDIR)
- find $(DOCSRCDIR) -name 'CVS*' | xargs -n1 rm -rf
- cd $(DOCSRCDIR) ; tar cvz * > $(RPMSOURCESDIR)/fpc-docs-$(FPC_VERSION)-src.tar.gz
- rpm: rpmcopy
- cd $(RPMSPECDIR) ; rpm -ba fpc-$(FPC_VERSION).spec
- cd $(RPMSPECDIR) ; rpm -ba fpc-docs-$(FPC_VERSION).spec
|