123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- #
- # Makefile generated by fpcmake v1.00 [2000/12/19]
- #
- defaultrule: all
- #####################################################################
- # Autodetect OS (Linux or Dos or Windows NT or OS/2)
- # define inUnix when running under Unix (Linux,FreeBSD)
- # define inWinNT when running under WinNT
- # define inOS2 when running under OS/2
- #####################################################################
- # 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
- inUnix=1
- PWD:=$(firstword $(PWD))
- endif
- else
- PWD:=$(firstword $(PWD))
- endif
- # Detect NT - NT sets OS to Windows_NT
- # Detect OS/2 - OS/2 has OS2_SHELL defined
- ifndef inUnix
- ifeq ($(OS),Windows_NT)
- inWinNT=1
- else
- ifdef OS2_SHELL
- inOS2=1
- endif
- endif
- endif
- # The extension of executables
- ifdef inUnix
- SRCEXEEXT=
- else
- SRCEXEEXT=.exe
- endif
- # The path which is searched separated by spaces
- ifdef inUnix
- SEARCHPATH=$(subst :, ,$(PATH))
- else
- SEARCHPATH=$(subst ;, ,$(PATH))
- endif
- # Base dir
- ifdef PWD
- BASEDIR:=$(shell $(PWD))
- else
- BASEDIR=.
- endif
- #####################################################################
- # FPC version/target Detection
- #####################################################################
- # What compiler to use ?
- ifndef FPC
- # Compatibility with old makefiles
- ifdef PP
- FPC=$(PP)
- else
- FPC=ppc386
- endif
- endif
- override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
- override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
- # 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
- #####################################################################
- # FPCDIR Setting
- #####################################################################
- # Test FPCDIR to look if the RTL dir exists
- ifdef FPCDIR
- override FPCDIR:=$(subst \,/,$(FPCDIR))
- ifeq ($(wildcard $(FPCDIR)/rtl),)
- ifeq ($(wildcard $(FPCDIR)/units),)
- override FPCDIR=wrong
- endif
- endif
- else
- override FPCDIR=wrong
- endif
- # Detect FPCDIR
- ifeq ($(FPCDIR),wrong)
- ifdef inUnix
- override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
- ifeq ($(wildcard $(FPCDIR)/units),)
- override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
- endif
- else
- override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
- override FPCDIR:=$(FPCDIR)/..
- ifeq ($(wildcard $(FPCDIR)/rtl),)
- ifeq ($(wildcard $(FPCDIR)/units),)
- override FPCDIR:=$(FPCDIR)/..
- ifeq ($(wildcard $(FPCDIR)/rtl),)
- ifeq ($(wildcard $(FPCDIR)/units),)
- override FPCDIR=c:/pp
- endif
- endif
- endif
- endif
- endif
- endif
- #####################################################################
- # User Settings
- #####################################################################
- # Targets
- # Clean
- # Install
- ZIPTARGET=install
- # Defaults
- # Directories
- # Packages
- # Libraries
- #####################################################################
- # Default Directories
- #####################################################################
- # Linux and freebsd use unix dirs with /usr/bin, /usr/lib
- # When zipping use the target as default, when normal install then
- # use the source os as default
- ifdef ZIPNAME
- # Zipinstall
- ifeq ($(OS_TARGET),linux)
- UNIXINSTALLDIR=1
- endif
- ifeq ($(OS_TARGET),freebsd)
- UNIXINSTALLDIR=1
- endif
- else
- # Normal install
- ifeq ($(OS_SOURCE),linux)
- UNIXINSTALLDIR=1
- endif
- ifeq ($(OS_SOURCE),freebsd)
- UNIXINSTALLDIR=1
- endif
- endif
- # set the prefix directory where to install everything
- ifndef PREFIXINSTALLDIR
- ifdef UNIXINSTALLDIR
- PREFIXINSTALLDIR=/usr
- else
- PREFIXINSTALLDIR=/pp
- endif
- endif
- export PREFIXINSTALLDIR
- # Where to place the resulting zip files
- ifndef DESTZIPDIR
- DESTZIPDIR:=$(BASEDIR)
- endif
- export DESTZIPDIR
- #####################################################################
- # Redirection
- #####################################################################
- ifndef REDIRFILE
- REDIRFILE=log
- endif
- ifdef REDIR
- ifndef inUnix
- override FPC=redir -eo $(FPC)
- endif
- # set the verbosity to max
- override FPCOPT+=-va
- override REDIR:= >> $(REDIRFILE)
- endif
- #####################################################################
- # Standard rules
- #####################################################################
- #####################################################################
- # Local Makefile
- #####################################################################
- ifneq ($(wildcard fpcmake.loc),)
- include fpcmake.loc
- endif
- #####################################################################
- # Users rules
- #####################################################################
- all:
- $(MAKE) -C $(OS_TARGET) all
|