1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123 |
- #
- # Makefile generated by fpcmake v0.99.13 [2000/01/06]
- #
- defaultrule: all
- #####################################################################
- # Autodetect OS (Linux or Dos or Windows NT)
- # define inlinux when running under linux
- # define inWinNT when running under WinNT
- #####################################################################
- # We need only / in the path
- override PATH:=$(subst \,/,$(PATH))
- # Search for PWD and determine also if we are under linux
- PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
- ifeq ($(PWD),)
- PWD:=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
- ifeq ($(PWD),)
- nopwd:
- @echo You need the GNU utils package to use this Makefile!
- @echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
- @exit
- else
- inlinux=1
- endif
- else
- PWD:=$(firstword $(PWD))
- endif
- # Detect NT - NT sets OS to Windows_NT
- ifndef inlinux
- ifeq ($(OS),Windows_NT)
- inWinNT=1
- endif
- endif
- # Detect OS/2 - OS/2 has OS2_SHELL defined
- ifndef inlinux
- ifndef inWinNT
- ifdef OS2_SHELL
- inOS2=1
- endif
- endif
- endif
- # The extension of executables
- ifdef inlinux
- EXEEXT=
- else
- EXEEXT=.exe
- endif
- # The path which is searched separated by spaces
- ifdef inlinux
- SEARCHPATH=$(subst :, ,$(PATH))
- else
- SEARCHPATH=$(subst ;, ,$(PATH))
- endif
- #####################################################################
- # FPC version/target Detection
- #####################################################################
- # What compiler to use ?
- ifndef FPC
- # Compatibility with old makefiles
- ifdef PP
- FPC=$(PP)
- else
- ifdef inOS2
- FPC=ppos2$(EXEEXT)
- else
- FPC=ppc386$(EXEEXT)
- endif
- endif
- endif
- # Target OS
- ifndef OS_TARGET
- OS_TARGET:=$(shell $(FPC) -iTO)
- endif
- # Source OS
- ifndef OS_SOURCE
- OS_SOURCE:=$(shell $(FPC) -iSO)
- endif
- # Target CPU
- ifndef CPU_TARGET
- CPU_TARGET:=$(shell $(FPC) -iTP)
- endif
- # Source CPU
- ifndef CPU_SOURCE
- CPU_SOURCE:=$(shell $(FPC) -iSP)
- endif
- # FPC version
- ifndef FPC_VERSION
- FPC_VERSION:=$(shell $(FPC) -iV)
- endif
- export FPC OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FPC_VERSION
- # Test FPCDIR to look if the RTL dir exists
- ifdef FPCDIR
- override FPCDIR:=$(subst \,/,$(FPCDIR))
- ifeq ($(wildcard $(FPCDIR)/rtl),)
- override FPCDIR=wrong
- endif
- else
- override FPCDIR=wrong
- endif
- # Default FPCDIR
- ifeq ($(FPCDIR),wrong)
- override FPCDIR=../../..
- ifeq ($(wildcard $(FPCDIR)/rtl),)
- override FPCDIR=wrong
- endif
- endif
- # Detect FPCDIR
- ifeq ($(FPCDIR),wrong)
- ifdef inlinux
- override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
- else
- override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
- endif
- endif
- ifndef PACKAGEDIR
- PACKAGEDIR=$(FPCDIR)/packages
- endif
- ifndef COMPONENTDIR
- COMPONENTDIR=$(FPCDIR)/components
- endif
- # Create units dir
- ifneq ($(FPCDIR),.)
- UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
- endif
- # Check if the dirs really exists, else turn it off
- ifeq ($(wildcard $(UNITSDIR)),)
- UNITSDIR=
- endif
- ifeq ($(wildcard $(PACKAGEDIR)),)
- PACKAGEDIR=
- endif
- ifeq ($(wildcard $(COMPONENTDIR)),)
- COMPONENTDIR=
- endif
- #####################################################################
- # Default Settings
- #####################################################################
- # 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 OPT+=-va
- override REDIR:= >> $(REDIRFILE)
- endif
- #####################################################################
- # User Settings
- #####################################################################
- # Targets
- override EXEOBJECTS+=pushme yesno pushbutton touchbutton minput inputall choice butttypes colsel colsel1 buttonall chartall positioner secretinput cursor fdial ldial ndial invslider sliderall borderwidth boxtype xyplotover arrowbutton browserop browserall chartstrip colbrowser counter fbrowse1 fbrowse flclock fonts goodies lalign ll longlabel menu objinactive objpos newbutton multilabel objreturn
- # Clean
- # Install
- ZIPTARGET=install
- # Defaults
- # Directories
- # Packages
- override PACKAGES+=rtl forms x11
- ifneq ($(wildcard $(FPCDIR)/rtl),)
- ifneq ($(wildcard $(FPCDIR)/rtl/$(OS_TARGET)),)
- PACKAGEDIR_RTL=$(FPCDIR)/rtl/$(OS_TARGET)
- else
- PACKAGEDIR_RTL=$(FPCDIR)/rtl
- endif
- UNITDIR_RTL=$(PACKAGEDIR_RTL)
- else
- PACKAGEDIR_RTL=
- ifneq ($(wildcard $(UNITSDIR)/rtl),)
- ifneq ($(wildcard $(UNITSDIR)/rtl/$(OS_TARGET)),)
- UNITDIR_RTL=$(UNITSDIR)/rtl/$(OS_TARGET)
- else
- UNITDIR_RTL=$(UNITSDIR)/rtl
- endif
- else
- UNITDIR_RTL=
- endif
- endif
- ifdef UNITDIR_RTL
- override NEEDUNITDIR+=$(UNITDIR_RTL)
- endif
- ifneq ($(wildcard $(PACKAGEDIR)/forms),)
- ifneq ($(wildcard $(PACKAGEDIR)/forms/$(OS_TARGET)),)
- PACKAGEDIR_FORMS=$(PACKAGEDIR)/forms/$(OS_TARGET)
- else
- PACKAGEDIR_FORMS=$(PACKAGEDIR)/forms
- endif
- UNITDIR_FORMS=$(PACKAGEDIR_FORMS)
- else
- PACKAGEDIR_FORMS=
- ifneq ($(wildcard $(UNITSDIR)/forms),)
- ifneq ($(wildcard $(UNITSDIR)/forms/$(OS_TARGET)),)
- UNITDIR_FORMS=$(UNITSDIR)/forms/$(OS_TARGET)
- else
- UNITDIR_FORMS=$(UNITSDIR)/forms
- endif
- else
- UNITDIR_FORMS=
- endif
- endif
- ifdef UNITDIR_FORMS
- override NEEDUNITDIR+=$(UNITDIR_FORMS)
- endif
- ifneq ($(wildcard $(PACKAGEDIR)/x11),)
- ifneq ($(wildcard $(PACKAGEDIR)/x11/$(OS_TARGET)),)
- PACKAGEDIR_X11=$(PACKAGEDIR)/x11/$(OS_TARGET)
- else
- PACKAGEDIR_X11=$(PACKAGEDIR)/x11
- endif
- UNITDIR_X11=$(PACKAGEDIR_X11)
- else
- PACKAGEDIR_X11=
- ifneq ($(wildcard $(UNITSDIR)/x11),)
- ifneq ($(wildcard $(UNITSDIR)/x11/$(OS_TARGET)),)
- UNITDIR_X11=$(UNITSDIR)/x11/$(OS_TARGET)
- else
- UNITDIR_X11=$(UNITSDIR)/x11
- endif
- else
- UNITDIR_X11=
- endif
- endif
- ifdef UNITDIR_X11
- override NEEDUNITDIR+=$(UNITDIR_X11)
- endif
- # Libraries
- override NEEDOTHERLIB=1
- # Info
- INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
- #####################################################################
- # Default Directories
- #####################################################################
- # Base dir
- ifdef PWD
- BASEDIR:=$(shell $(PWD))
- else
- BASEDIR=.
- endif
- # set the prefix directory where to install everything
- ifndef PREFIXINSTALLDIR
- ifdef inlinux
- PREFIXINSTALLDIR=/usr
- else
- PREFIXINSTALLDIR=/pp
- endif
- endif
- export PREFIXINSTALLDIR
- # 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
- #####################################################################
- # 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
- #####################################################################
- # 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
- ifdef NEEDUNITDIR
- override FPCOPT+=$(addprefix -Fu,$(NEEDUNITDIR))
- endif
- ifdef UNITSDIR
- override FPCOPT+=-Fu$(UNITSDIR)
- endif
- # Add Other dirs path if asked
- ifdef OTHERLIBDIR
- override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
- endif
- # Smartlinking
- ifdef SMARTLINK
- override FPCOPT+=-CX
- endif
- # Debug
- ifdef DEBUG
- override FPCOPT+=-g
- 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 environment variable FPCEXTCMD
- ifeq ($(OS_SOURCE),win32)
- override FPCEXTCMD:=$(FPCOPT)
- override FPCOPT:=!FPCEXTCMD
- export FPCEXTCMD
- endif
- # Compiler commandline
- override COMPILER:=$(FPC) $(FPCOPT)
- #####################################################################
- # Shell tools
- #####################################################################
- # To copy pograms
- ifndef COPY
- COPY:=cp -fp
- endif
- # Copy a whole tree
- ifndef COPYTREE
- COPYTREE:=cp -rfp
- endif
- # To move pograms
- ifndef MOVE
- MOVE:=mv -f
- endif
- # Check delete program
- ifndef DEL
- DEL:=rm -f
- endif
- # Check deltree program
- ifndef DELTREE
- DELTREE:=rm -rf
- endif
- # To install files
- ifndef INSTALL
- ifdef inlinux
- INSTALL:=install -m 644
- else
- INSTALL:=$(COPY)
- endif
- endif
- # To install programs
- ifndef INSTALLEXE
- ifdef inlinux
- INSTALLEXE:=install -m 755
- else
- INSTALLEXE:=$(COPY)
- endif
- endif
- # To make a directory.
- ifndef MKDIR
- ifdef inlinux
- MKDIR:=install -m 755 -d
- else
- MKDIR:=ginstall -m 755 -d
- endif
- endif
- export COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
- #####################################################################
- # Default Tools
- #####################################################################
- # assembler, redefine it if cross compiling
- ifndef AS
- AS=as
- endif
- # linker, but probably not used
- ifndef LD
- LD=ld
- endif
- # ppas.bat / ppas.sh
- ifdef inlinux
- PPAS=ppas.sh
- else
- ifdef inOS2
- PPAS=ppas.cmd
- else
- PPAS=ppas.bat
- endif
- endif
- # also call ppas if with command option -s
- ifeq (,$(findstring -s ,$(COMPILER)))
- EXECPPAS=
- else
- EXECPPAS:=@$(PPAS)
- endif
- # ldconfig to rebuild .so cache
- ifdef inlinux
- LDCONFIG=ldconfig
- else
- LDCONFIG=
- endif
- # echo
- ifndef ECHO
- ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
- ifeq ($(ECHO),)
- ECHO:=echo
- else
- ECHO:=$(firstword $(ECHO))
- endif
- endif
- export ECHO
- # ppdep
- ifndef PPDEP
- PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
- ifeq ($(PPDEP),)
- PPDEP=
- else
- PPDEP:=$(firstword $(PPDEP))
- endif
- endif
- export PPDEP
- # ppumove
- ifndef PPUMOVE
- PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
- ifeq ($(PPUMOVE),)
- PPUMOVE=
- else
- PPUMOVE:=$(firstword $(PPUMOVE))
- endif
- endif
- export PPUMOVE
- # ppufiles
- ifndef PPUFILES
- PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
- ifeq ($(PPUFILES),)
- PPUFILES=
- else
- PPUFILES:=$(firstword $(PPUFILES))
- endif
- endif
- export PPUFILES
- # Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
- # upx uses that one itself (PFV)
- ifndef UPXPROG
- ifeq ($(OS_TARGET),go32v2)
- UPXPROG:=1
- endif
- ifeq ($(OS_TARGET),win32)
- UPXPROG:=1
- endif
- ifdef UPXPROG
- UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
- ifeq ($(UPXPROG),)
- UPXPROG=
- else
- UPXPROG:=$(firstword $(UPXPROG))
- endif
- else
- UPXPROG=
- endif
- endif
- export UPXPROG
- # gdate/date
- ifndef DATE
- DATE:=$(strip $(wildcard $(addsuffix /date$(EXEEXT),$(SEARCHPATH))))
- ifeq ($(DATE),)
- DATE:=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH))))
- ifeq ($(DATE),)
- DATE=
- else
- DATE:=$(firstword $(DATE))
- endif
- else
- DATE:=$(firstword $(DATE))
- endif
- endif
- export DATE
- ifdef DATE
- DATESTR:=$(shell $(DATE) +%Y%m%d)
- else
- DATESTR=
- endif
- # ZipProg, you can't use Zip as the var name (PFV)
- ifndef ZIPPROG
- ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
- ifeq ($(ZIPPROG),)
- ZIPPROG=
- else
- ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
- endif
- endif
- export ZIPPROG
- ifndef ZIPEXT
- ZIPEXT=.zip
- endif
- #####################################################################
- # Default extensions
- #####################################################################
- # Default needed extensions (Go32v2,Linux)
- LOADEREXT=.as
- PPLEXT=.ppl
- PPUEXT=.ppu
- OEXT=.o
- ASMEXT=.s
- SMARTEXT=.sl
- STATICLIBEXT=.a
- SHAREDLIBEXT=.so
- RSTEXT=.rst
- PACKAGESUFFIX=
- FPCMADE=fpcmade
- # Go32v1
- ifeq ($(OS_TARGET),go32v1)
- PPUEXT=.pp1
- OEXT=.o1
- ASMEXT=.s1
- SMARTEXT=.sl1
- STATICLIBEXT=.a1
- SHAREDLIBEXT=.so1
- PACKAGESUFFIX=v1
- FPCMADE=fpcmade.v1
- endif
- # Go32v2
- ifeq ($(OS_TARGET),go32v2)
- PACKAGESUFFIX=go32
- FPCMADE=fpcmade.dos
- endif
- # Linux
- ifeq ($(OS_TARGET),linux)
- PACKAGESUFFIX=linux
- FPCMADE=fpcmade.lnx
- endif
- # Win32
- ifeq ($(OS_TARGET),win32)
- PPUEXT=.ppw
- OEXT=.ow
- ASMEXT=.sw
- SMARTEXT=.slw
- STATICLIBEXT=.aw
- SHAREDLIBEXT=.dll
- PACKAGESUFFIX=win32
- FPCMADE=fpcmade.w32
- endif
- # OS/2
- ifeq ($(OS_TARGET),os2)
- PPUEXT=.ppo
- ASMEXT=.so2
- OEXT=.oo2
- SMARTEXT=.so
- STATICLIBEXT=.ao2
- SHAREDLIBEXT=.dll
- PACKAGESUFFIX=os2
- FPCMADE=fpcmade.os2
- endif
- # library prefix
- LIBPREFIX=lib
- ifeq ($(OS_TARGET),go32v2)
- LIBPREFIX=
- endif
- ifeq ($(OS_TARGET),go32v1)
- LIBPREFIX=
- endif
- # determine which .pas extension is used
- ifndef PASEXT
- ifdef EXEOBJECTS
- override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(EXEOBJECTS)))))
- else
- override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(UNITOBJECTS)))))
- endif
- ifeq ($(TESTPAS),)
- PASEXT=.pp
- else
- PASEXT=.pas
- endif
- endif
- #####################################################################
- # Standard rules
- #####################################################################
- all: fpc_all
- debug: fpc_debug
- smart: fpc_smart
- shared: fpc_shared
- showinstall: fpc_showinstall
- install: fpc_install
- sourceinstall: fpc_sourceinstall
- zipinstall: fpc_zipinstall
- zipinstalladd: fpc_zipinstalladd
- clean: fpc_clean
- cleanall: fpc_cleanall
- info: fpc_info
- .PHONY: all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
- ifdef PACKAGERTL
- ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
- ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
- override COMPILEPACKAGES+=rtl
- rtl_package:
- $(MAKE) -C $(PACKAGEDIR_RTL) all
- endif
- endif
- endif
- PACKAGERTL=1
- PACKAGEFORMS=1
- PACKAGEX11=1
- ifdef PACKAGERTL
- ifneq ($(wildcard $(PACKAGEDIR_RTL)),)
- ifeq ($(wildcard $(PACKAGEDIR_RTL)/$(FPCMADE)),)
- override COMPILEPACKAGES+=rtl
- rtl_package:
- $(MAKE) -C $(PACKAGEDIR_RTL) all
- endif
- endif
- endif
- ifdef PACKAGEFORMS
- ifneq ($(wildcard $(PACKAGEDIR_FORMS)),)
- ifeq ($(wildcard $(PACKAGEDIR_FORMS)/$(FPCMADE)),)
- override COMPILEPACKAGES+=forms
- forms_package:
- $(MAKE) -C $(PACKAGEDIR_FORMS) all
- endif
- endif
- endif
- ifdef PACKAGEX11
- ifneq ($(wildcard $(PACKAGEDIR_X11)),)
- ifeq ($(wildcard $(PACKAGEDIR_X11)/$(FPCMADE)),)
- override COMPILEPACKAGES+=x11
- x11_package:
- $(MAKE) -C $(PACKAGEDIR_X11) all
- endif
- endif
- endif
- .PHONY: rtl_package rtl_package forms_package x11_package
- #####################################################################
- # Exes
- #####################################################################
- .PHONY: fpc_exes
- override EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
- override EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
- override ALLTARGET+=fpc_exes
- override INSTALLEXEFILES+=$(EXEFILES)
- override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
- fpc_exes: $(EXEFILES)
- #####################################################################
- # General compile rules
- #####################################################################
- .PHONY: fpc_all fpc_debug
- $(FPCMADE):
- @$(ECHO) Compiled > $(FPCMADE)
- fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
- $(addsuffix _component,$(COMPILECOMPONENTS)) \
- $(ALLTARGET) $(FPCMADE)
- fpc_debug:
- $(MAKE) all DEBUG=1
- # General compile rules, available for both possible PASEXT
- .SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
- %$(PPUEXT): %.pp
- $(COMPILER) $< $(REDIR)
- $(EXECPASS)
- %$(PPUEXT): %.pas
- $(COMPILER) $< $(REDIR)
- $(EXECPASS)
- %$(EXEEXT): %.pp
- $(COMPILER) $< $(REDIR)
- $(EXECPASS)
- %$(EXEEXT): %.pas
- $(COMPILER) $< $(REDIR)
- $(EXECPASS)
- #####################################################################
- # Library
- #####################################################################
- .PHONY: fpc_smart fpc_shared
- # Default sharedlib units are all unit objects
- ifndef SHAREDLIBUNITOBJECTS
- SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)
- endif
- fpc_smart:
- $(MAKE) all SMARTLINK=1
- fpc_shared: all
- ifdef inlinux
- ifndef LIBNAME
- @$(ECHO) "LIBNAME not set"
- else
- $(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
- endif
- else
- @$(ECHO) "Shared Libraries not supported"
- endif
- #####################################################################
- # Install rules
- #####################################################################
- .PHONY: fpc_showinstall fpc_install
- ifdef EXTRAINSTALLUNITS
- override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
- endif
- ifdef INSTALLPPUFILES
- ifdef PPUFILES
- ifdef inlinux
- INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
- INSTALLPPULIBFILES:=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
- else
- INSTALLPPULINKFILES:=$(shell $(PPUFILES) $(INSTALLPPUFILES))
- endif
- else
- INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
- endif
- endif
- fpc_showinstall: $(SHOWINSTALLTARGET)
- ifdef INSTALLEXEFILES
- @$(ECHO) -e $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
- endif
- ifdef INSTALLPPUFILES
- @$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
- ifneq ($(INSTALLPPULINKFILES),)
- @$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
- endif
- ifneq ($(INSTALLPPULIBFILES),)
- @$(ECHO) -e $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
- endif
- endif
- ifdef EXTRAINSTALLFILES
- @$(ECHO) -e $(addprefix "\n"$(DATAINSTALLDIR)/,$(EXTRAINSTALLFILES))
- endif
- fpc_install: $(INSTALLTARGET)
- # Create UnitInstallFiles
- ifdef INSTALLEXEFILES
- $(MKDIR) $(BININSTALLDIR)
- # Compress the exes if upx is defined
- ifdef UPXPROG
- -$(UPXPROG) $(INSTALLEXEFILES)
- endif
- $(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
- endif
- ifdef INSTALLPPUFILES
- $(MKDIR) $(UNITINSTALLDIR)
- $(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
- ifneq ($(INSTALLPPULINKFILES),)
- $(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
- endif
- ifneq ($(INSTALLPPULIBFILES),)
- $(MKDIR) $(LIBINSTALLDIR)
- $(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
- endif
- endif
- ifdef EXTRAINSTALLFILES
- $(MKDIR) $(DATAINSTALLDIR)
- $(INSTALL) $(EXTRAINSTALLFILES) $(DATAINSTALLDIR)
- endif
- #####################################################################
- # Source install rules
- #####################################################################
- .PHONY: fpc_sourceinstall
- fpc_sourceinstall: clean
- $(MKDIR) $(SOURCEINSTALLDIR)
- $(COPYTREE) $(BASEDIR) $(SOURCEINSTALLDIR)
- #####################################################################
- # Zip
- #####################################################################
- .PHONY: fpc_zipinstall fpc_zipinstalladd
- # Temporary path to pack a file
- ifndef PACKDIR
- ifndef inlinux
- PACKDIR=pack_tmp
- else
- PACKDIR=/tmp/fpc-pack
- endif
- endif
- # Test dir if none specified
- ifndef DESTZIPDIR
- DESTZIPDIR:=$(BASEDIR)
- endif
- # Add .zip/.tar.gz extension
- ifdef ZIPNAME
- ifndef inlinux
- override ZIPNAME:=$(ZIPNAME)$(ZIPEXT)
- endif
- endif
- # Note: This will not remove the zipfile first
- fpc_zipinstalladd:
- ifndef ZIPNAME
- @$(ECHO) "Please specify ZIPNAME!"
- @exit 1
- else
- $(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
- ifdef inlinux
- gzip -d $(DESTZIPDIR)/$(ZIPNAME).tar.gz
- cd $(PACKDIR) ; tar rv --file $(DESTZIPDIR)/$(ZIPNAME).tar * ; cd $(BASEDIR)
- gzip $(DESTZIPDIR)/$(ZIPNAME).tar
- else
- cd $(PACKDIR) ; $(ZIPPROG) $(DESTZIPDIR)/$(ZIPNAME) * ; cd $(BASEDIR)
- endif
- $(DELTREE) $(PACKDIR)
- endif
- # First remove the zip and then install
- fpc_zipinstall:
- ifndef ZIPNAME
- @$(ECHO) "Please specify ZIPNAME!"
- @exit 1
- else
- $(DEL) $(DESTZIPDIR)/$(ZIPNAME)
- $(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
- ifdef inlinux
- cd $(PACKDIR) ; tar cvz --file $(DESTZIPDIR)/$(ZIPNAME).tar.gz * ; cd $(BASEDIR)
- else
- cd $(PACKDIR) ; $(ZIPPROG) $(DESTZIPDIR)/$(ZIPNAME) * ; cd $(BASEDIR)
- endif
- $(DELTREE) $(PACKDIR)
- endif
- #####################################################################
- # Clean rules
- #####################################################################
- .PHONY: fpc_clean fpc_cleanall
- ifdef EXTRACLEANUNITS
- override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
- endif
- ifdef CLEANPPUFILES
- ifdef PPUFILES
- CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
- else
- CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
- endif
- endif
- fpc_clean: $(CLEANTARGET)
- ifdef CLEANEXEFILES
- -$(DEL) $(CLEANEXEFILES)
- endif
- ifdef CLEANPPUFILES
- -$(DEL) $(CLEANPPUFILES)
- endif
- ifneq ($(CLEANPPULINKFILES),)
- -$(DEL) $(CLEANPPULINKFILES)
- endif
- ifdef CLEANRSTFILES
- -$(DEL) $(CLEANRSTFILES)
- endif
- ifdef EXTRACLEANFILES
- -$(DEL) $(EXTRACLEANFILES)
- endif
- -$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
- fpc_cleanall: $(CLEANTARGET)
- ifdef CLEANEXEFILES
- -$(DEL) $(CLEANEXEFILES)
- endif
- -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
- -$(DELTREE) *$(SMARTEXT)
- -$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
- #####################################################################
- # Info rules
- #####################################################################
- .PHONY: fpc_info fpc_cfginfo fpc_objectinfo fpc_toolsinfo fpc_installinfo \
- fpc_dirinfo
- fpc_info: $(INFOTARGET)
- fpc_infocfg:
- @$(ECHO)
- @$(ECHO) == Configuration info ==
- @$(ECHO)
- @$(ECHO) FPC....... $(FPC)
- @$(ECHO) Version... $(FPC_VERSION)
- @$(ECHO) CPU....... $(CPU_TARGET)
- @$(ECHO) Source.... $(OS_SOURCE)
- @$(ECHO) Target.... $(OS_TARGET)
- @$(ECHO)
- fpc_infoobjects:
- @$(ECHO)
- @$(ECHO) == Object info ==
- @$(ECHO)
- @$(ECHO) LoaderObjects..... $(LOADEROBJECTS)
- @$(ECHO) UnitObjects....... $(UNITOBJECTS)
- @$(ECHO) ExeObjects........ $(EXEOBJECTS)
- @$(ECHO)
- @$(ECHO) ExtraCleanUnits... $(EXTRACLEANUNITS)
- @$(ECHO) ExtraCleanFiles... $(EXTRACLEANFILES)
- @$(ECHO)
- @$(ECHO) ExtraInstallUnits. $(EXTRAINSTALLUNITS)
- @$(ECHO) ExtraInstallFiles. $(EXTRAINSTALLFILES)
- @$(ECHO)
- fpc_infoinstall:
- @$(ECHO)
- @$(ECHO) == Install info ==
- @$(ECHO)
- ifdef DATE
- @$(ECHO) DateStr.............. $(DATESTR)
- endif
- @$(ECHO) PackageSuffix........ $(PACKAGESUFFIX)
- @$(ECHO)
- @$(ECHO) BaseInstallDir....... $(BASEINSTALLDIR)
- @$(ECHO) BinInstallDir........ $(BININSTALLDIR)
- @$(ECHO) LibInstallDir........ $(LIBINSTALLDIR)
- @$(ECHO) UnitInstallDir....... $(UNITINSTALLDIR)
- @$(ECHO) SourceInstallDir..... $(SOURCEINSTALLDIR)
- @$(ECHO) DocInstallDir........ $(DOCINSTALLDIR)
- @$(ECHO) DataInstallDir....... $(DATAINSTALLDIR)
- @$(ECHO)
|