* regenerated

git-svn-id: trunk@36 -
This commit is contained in:
peter 2000-09-20 19:50:47 +00:00
parent 40306ada30
commit e091a582e8
5 changed files with 514 additions and 253 deletions
Makefile
components
examples
lcl
tools/apiwizz

153
Makefile
View File

@ -1,12 +1,12 @@
#
# Makefile generated by fpcmake v1.00 [2000/07/11]
# Makefile generated by fpcmake v1.00 [2000/09/20]
#
defaultrule: all
#####################################################################
# Autodetect OS (Linux or Dos or Windows NT)
# define inlinux when running under linux
# define inUnix when running under Unix (Linux,FreeBSD)
# define inWinNT when running under WinNT
#####################################################################
@ -23,22 +23,18 @@ nopwd:
@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
@exit
else
inlinux=1
inUnix=1
endif
else
PWD:=$(firstword $(PWD))
endif
# Detect NT - NT sets OS to Windows_NT
ifndef inlinux
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inUnix
ifeq ($(OS),Windows_NT)
inWinNT=1
endif
endif
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inlinux
ifndef inWinNT
else
ifdef OS2_SHELL
inOS2=1
endif
@ -46,14 +42,14 @@ endif
endif
# The extension of executables
ifdef inlinux
EXEEXT=
ifdef inUnix
SRCEXEEXT=
else
EXEEXT=.exe
SRCEXEEXT=.exe
endif
# The path which is searched separated by spaces
ifdef inlinux
ifdef inUnix
SEARCHPATH=$(subst :, ,$(PATH))
else
SEARCHPATH=$(subst ;, ,$(PATH))
@ -76,15 +72,11 @@ ifndef FPC
ifdef PP
FPC=$(PP)
else
ifdef inOS2
FPC=ppos2
else
FPC=ppc386
endif
endif
endif
override FPC:=$(subst $(EXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
# Target OS
ifndef OS_TARGET
@ -131,7 +123,7 @@ endif
# Detect FPCDIR
ifeq ($(FPCDIR),wrong)
ifdef inlinux
ifdef inUnix
override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
ifeq ($(wildcard $(FPCDIR)/units),)
override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@ -215,7 +207,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
ifndef ECHO
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=echo
ECHOE:=echo
@ -256,7 +248,7 @@ endif
# To install files
ifndef INSTALL
ifdef inlinux
ifdef inUnix
INSTALL:=install -m 644
else
INSTALL:=$(COPY)
@ -265,7 +257,7 @@ endif
# To install programs
ifndef INSTALLEXE
ifdef inlinux
ifdef inUnix
INSTALLEXE:=install -m 755
else
INSTALLEXE:=$(COPY)
@ -274,7 +266,7 @@ endif
# To make a directory.
ifndef MKDIR
ifdef inlinux
ifdef inUnix
MKDIR:=install -m 755 -d
else
MKDIR:=ginstall -m 755 -d
@ -298,7 +290,7 @@ LD=ld
endif
# ppas.bat / ppas.sh
ifdef inlinux
ifdef inUnix
PPAS=ppas.sh
else
ifdef inOS2
@ -309,7 +301,7 @@ endif
endif
# ldconfig to rebuild .so cache
ifdef inlinux
ifdef inUnix
LDCONFIG=ldconfig
else
LDCONFIG=
@ -317,7 +309,7 @@ endif
# ppumove
ifndef PPUMOVE
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUMOVE),)
PPUMOVE=
else
@ -328,7 +320,7 @@ export PPUMOVE
# ppufiles
ifndef PPUFILES
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUFILES),)
PPUFILES=
else
@ -347,7 +339,7 @@ ifeq ($(OS_TARGET),win32)
UPXPROG:=1
endif
ifdef UPXPROG
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(UPXPROG),)
UPXPROG=
else
@ -361,7 +353,7 @@ export UPXPROG
# ZipProg, you can't use Zip as the var name (PFV)
ifndef ZIPPROG
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ZIPPROG),)
ZIPPROG=
else
@ -375,7 +367,7 @@ ZIPEXT=.zip
# Tar
ifndef TARPROG
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(TARPROG),)
TARPROG=
else
@ -398,6 +390,7 @@ endif
# Default needed extensions (Go32v2,Linux)
LOADEREXT=.as
EXEEXT=.exe
PPLEXT=.ppl
PPUEXT=.ppu
OEXT=.o
@ -426,9 +419,18 @@ endif
# Linux
ifeq ($(OS_TARGET),linux)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.lnx
endif
# Linux
ifeq ($(OS_TARGET),freebsd)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.freebsd
endif
# Win32
ifeq ($(OS_TARGET),win32)
PPUEXT=.ppw
@ -589,9 +591,17 @@ endif
# Default Directories
#####################################################################
# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
ifeq ($(OS_TARGET),linux)
UNIXINSTALLDIR=1
endif
ifeq ($(OS_TARGET),freebsd)
UNIXINSTALLDIR=1
endif
# set the prefix directory where to install everything
ifndef PREFIXINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
PREFIXINSTALLDIR=/usr
else
PREFIXINSTALLDIR=/pp
@ -611,7 +621,7 @@ export DESTZIPDIR
# set the base directory where to install everything
ifndef BASEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
else
BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@ -620,7 +630,7 @@ endif
# set the directory where to install the binaries
ifndef BININSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
else
BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@ -637,7 +647,7 @@ endif
# Where to install shared libraries
ifndef LIBINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
else
LIBINSTALLDIR=$(UNITINSTALLDIR)
@ -646,7 +656,7 @@ endif
# Where the source files will be stored
ifndef SOURCEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
else
SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@ -658,7 +668,7 @@ endif
# Where the doc files will be stored
ifndef DOCINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
else
DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@ -668,7 +678,7 @@ endif
# Where to install the examples, under linux we use the doc dir
# because the copytree command will create a subdir itself
ifndef EXAMPLEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
else
EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@ -692,7 +702,7 @@ REDIRFILE=log
endif
ifdef REDIR
ifndef inlinux
ifndef inUnix
override FPC=redir -eo $(FPC)
endif
# set the verbosity to max
@ -780,9 +790,27 @@ override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
endif
# Target dirs
# Target dirs and the prefix to use for clean/install
ifdef TARGETDIR
override FPCOPT+=-FE$(TARGETDIR)
ifeq ($(TARGETDIR),.)
override TARGETDIRPREFIX=
else
override TARGETDIRPREFIX=$(TARGETDIR)/
endif
endif
ifdef UNITTARGETDIR
override FPCOPT+=-FU$(UNITTARGETDIR)
ifeq ($(UNITTARGETDIR),.)
override UNITTARGETDIRPREFIX=
else
override UNITTARGETDIRPREFIX=$(TARGETDIR)/
endif
else
ifdef TARGETDIR
override UNITTARGETDIR=$(TARGETDIR)
override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
endif
endif
# Add commandline options last so they can override
@ -816,11 +844,14 @@ endif
override COMPILER:=$(FPC) $(FPCOPT)
# also call ppas if with command option -s
# but only if the OS_SOURCE and OS_TARGE are equal
ifeq (,$(findstring -s ,$(COMPILER)))
EXECPPAS=
else
ifeq ($(OS_SOURCE),$(OS_TARGET))
EXECPPAS:=@$(PPAS)
endif
endif
#####################################################################
# Standard rules
@ -891,6 +922,11 @@ fpc_all: fpc_packages $(FPCMADE)
fpc_debug:
$(MAKE) all DEBUG=1
# Search paths for .ppu if targetdir is set
ifdef UNITTARGETDIR
vpath %$(PPUEXT) $(UNITTARGETDIR)
endif
# General compile rules, available for both possible PASEXT
.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
@ -932,7 +968,7 @@ fpc_smart:
$(MAKE) all LINKSMART=1 CREATESMART=1
fpc_shared: all
ifdef inlinux
ifdef HASSHAREDLIB
ifndef LIBNAME
@$(ECHO) "LIBNAME not set"
else
@ -953,11 +989,17 @@ override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
endif
ifdef INSTALLPPUFILES
override INSTALLPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPUFILES))
ifdef PPUFILES
INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
else
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))))
endif
override INSTALLPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPULINKFILES))
endif
ifdef INSTALLEXEFILES
override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
endif
fpc_showinstall: $(SHOWINSTALLTARGET)
@ -971,7 +1013,7 @@ ifneq ($(INSTALLPPULINKFILES),)
endif
ifneq ($(wildcard $(LIBFULLNAME)),)
@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
ifdef inlinux
ifdef HASSHAREDLIB
@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -999,7 +1041,7 @@ endif
ifneq ($(wildcard $(LIBFULLNAME)),)
$(MKDIR) $(LIBINSTALLDIR)
$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
ifdef inlinux
ifdef inUnix
ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -1060,7 +1102,7 @@ endif
# Temporary path to pack a file
ifndef PACKDIR
ifndef inlinux
ifndef inUnix
PACKDIR=$(BASEDIR)/pack_tmp
else
PACKDIR=/tmp/fpc-pack
@ -1076,7 +1118,7 @@ endif
# Use tar by default under linux
ifndef USEZIP
ifdef inlinux
ifdef inUnix
USETAR=1
endif
endif
@ -1118,16 +1160,19 @@ override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
endif
ifdef CLEANPPUFILES
override CLEANPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPUFILES))
# Get the .o and .a files created for the units
ifdef PPUFILES
CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
else
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))))
endif
override CLEANPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPULINKFILES))
endif
fpc_clean: $(CLEANTARGET)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
-$(DEL) $(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
endif
ifdef CLEANPPUFILES
-$(DEL) $(CLEANPPUFILES)
@ -1136,7 +1181,7 @@ ifneq ($(CLEANPPULINKFILES),)
-$(DEL) $(CLEANPPULINKFILES)
endif
ifdef CLEANRSTFILES
-$(DEL) $(CLEANRSTFILES)
-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
endif
ifdef EXTRACLEANFILES
-$(DEL) $(EXTRACLEANFILES)
@ -1148,7 +1193,13 @@ endif
fpc_distclean: fpc_clean
fpc_cleanall: $(CLEANTARGET)
# Also run clean first if targetdir is set. Unittargetdir is always
# set if targetdir or unittargetdir is specified
ifdef UNITTARGETDIR
TARGETDIRCLEAN=fpc_clean
endif
fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
endif

View File

@ -1,12 +1,12 @@
#
# Makefile generated by fpcmake v1.00 [2000/07/11]
# Makefile generated by fpcmake v1.00 [2000/09/20]
#
defaultrule: all
#####################################################################
# Autodetect OS (Linux or Dos or Windows NT)
# define inlinux when running under linux
# define inUnix when running under Unix (Linux,FreeBSD)
# define inWinNT when running under WinNT
#####################################################################
@ -23,22 +23,18 @@ nopwd:
@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
@exit
else
inlinux=1
inUnix=1
endif
else
PWD:=$(firstword $(PWD))
endif
# Detect NT - NT sets OS to Windows_NT
ifndef inlinux
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inUnix
ifeq ($(OS),Windows_NT)
inWinNT=1
endif
endif
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inlinux
ifndef inWinNT
else
ifdef OS2_SHELL
inOS2=1
endif
@ -46,14 +42,14 @@ endif
endif
# The extension of executables
ifdef inlinux
EXEEXT=
ifdef inUnix
SRCEXEEXT=
else
EXEEXT=.exe
SRCEXEEXT=.exe
endif
# The path which is searched separated by spaces
ifdef inlinux
ifdef inUnix
SEARCHPATH=$(subst :, ,$(PATH))
else
SEARCHPATH=$(subst ;, ,$(PATH))
@ -76,15 +72,11 @@ ifndef FPC
ifdef PP
FPC=$(PP)
else
ifdef inOS2
FPC=ppos2
else
FPC=ppc386
endif
endif
endif
override FPC:=$(subst $(EXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
# Target OS
ifndef OS_TARGET
@ -140,7 +132,7 @@ endif
# Detect FPCDIR
ifeq ($(FPCDIR),wrong)
ifdef inlinux
ifdef inUnix
override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
ifeq ($(wildcard $(FPCDIR)/units),)
override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@ -201,7 +193,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
ifndef ECHO
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=echo
ECHOE:=echo
@ -242,7 +234,7 @@ endif
# To install files
ifndef INSTALL
ifdef inlinux
ifdef inUnix
INSTALL:=install -m 644
else
INSTALL:=$(COPY)
@ -251,7 +243,7 @@ endif
# To install programs
ifndef INSTALLEXE
ifdef inlinux
ifdef inUnix
INSTALLEXE:=install -m 755
else
INSTALLEXE:=$(COPY)
@ -260,7 +252,7 @@ endif
# To make a directory.
ifndef MKDIR
ifdef inlinux
ifdef inUnix
MKDIR:=install -m 755 -d
else
MKDIR:=ginstall -m 755 -d
@ -284,7 +276,7 @@ LD=ld
endif
# ppas.bat / ppas.sh
ifdef inlinux
ifdef inUnix
PPAS=ppas.sh
else
ifdef inOS2
@ -295,7 +287,7 @@ endif
endif
# ldconfig to rebuild .so cache
ifdef inlinux
ifdef inUnix
LDCONFIG=ldconfig
else
LDCONFIG=
@ -303,7 +295,7 @@ endif
# ppumove
ifndef PPUMOVE
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUMOVE),)
PPUMOVE=
else
@ -314,7 +306,7 @@ export PPUMOVE
# ppufiles
ifndef PPUFILES
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUFILES),)
PPUFILES=
else
@ -333,7 +325,7 @@ ifeq ($(OS_TARGET),win32)
UPXPROG:=1
endif
ifdef UPXPROG
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(UPXPROG),)
UPXPROG=
else
@ -347,7 +339,7 @@ export UPXPROG
# ZipProg, you can't use Zip as the var name (PFV)
ifndef ZIPPROG
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ZIPPROG),)
ZIPPROG=
else
@ -361,7 +353,7 @@ ZIPEXT=.zip
# Tar
ifndef TARPROG
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(TARPROG),)
TARPROG=
else
@ -384,6 +376,7 @@ endif
# Default needed extensions (Go32v2,Linux)
LOADEREXT=.as
EXEEXT=.exe
PPLEXT=.ppl
PPUEXT=.ppu
OEXT=.o
@ -412,9 +405,18 @@ endif
# Linux
ifeq ($(OS_TARGET),linux)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.lnx
endif
# Linux
ifeq ($(OS_TARGET),freebsd)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.freebsd
endif
# Win32
ifeq ($(OS_TARGET),win32)
PPUEXT=.ppw
@ -466,9 +468,17 @@ endif
# Default Directories
#####################################################################
# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
ifeq ($(OS_TARGET),linux)
UNIXINSTALLDIR=1
endif
ifeq ($(OS_TARGET),freebsd)
UNIXINSTALLDIR=1
endif
# set the prefix directory where to install everything
ifndef PREFIXINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
PREFIXINSTALLDIR=/usr
else
PREFIXINSTALLDIR=/pp
@ -488,7 +498,7 @@ export DESTZIPDIR
# set the base directory where to install everything
ifndef BASEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
else
BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@ -497,7 +507,7 @@ endif
# set the directory where to install the binaries
ifndef BININSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
else
BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@ -514,7 +524,7 @@ endif
# Where to install shared libraries
ifndef LIBINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
else
LIBINSTALLDIR=$(UNITINSTALLDIR)
@ -523,7 +533,7 @@ endif
# Where the source files will be stored
ifndef SOURCEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
else
SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@ -535,7 +545,7 @@ endif
# Where the doc files will be stored
ifndef DOCINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
else
DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@ -545,7 +555,7 @@ endif
# Where to install the examples, under linux we use the doc dir
# because the copytree command will create a subdir itself
ifndef EXAMPLEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
else
EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@ -569,7 +579,7 @@ REDIRFILE=log
endif
ifdef REDIR
ifndef inlinux
ifndef inUnix
override FPC=redir -eo $(FPC)
endif
# set the verbosity to max
@ -648,6 +658,29 @@ ifdef UNITSDIR
override FPCOPT+=-Fu$(UNITSDIR)
endif
# Target dirs and the prefix to use for clean/install
ifdef TARGETDIR
override FPCOPT+=-FE$(TARGETDIR)
ifeq ($(TARGETDIR),.)
override TARGETDIRPREFIX=
else
override TARGETDIRPREFIX=$(TARGETDIR)/
endif
endif
ifdef UNITTARGETDIR
override FPCOPT+=-FU$(UNITTARGETDIR)
ifeq ($(UNITTARGETDIR),.)
override UNITTARGETDIRPREFIX=
else
override UNITTARGETDIRPREFIX=$(TARGETDIR)/
endif
else
ifdef TARGETDIR
override UNITTARGETDIR=$(TARGETDIR)
override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
endif
endif
# Add commandline options last so they can override
ifdef OPT
override FPCOPT+=$(OPT)
@ -679,11 +712,14 @@ endif
override COMPILER:=$(FPC) $(FPCOPT)
# also call ppas if with command option -s
# but only if the OS_SOURCE and OS_TARGE are equal
ifeq (,$(findstring -s ,$(COMPILER)))
EXECPPAS=
else
ifeq ($(OS_SOURCE),$(OS_TARGET))
EXECPPAS:=@$(PPAS)
endif
endif
#####################################################################
# Standard rules
@ -739,6 +775,11 @@ fpc_all: fpc_packages $(FPCMADE)
fpc_debug:
$(MAKE) all DEBUG=1
# Search paths for .ppu if targetdir is set
ifdef UNITTARGETDIR
vpath %$(PPUEXT) $(UNITTARGETDIR)
endif
# General compile rules, available for both possible PASEXT
.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
@ -780,7 +821,7 @@ fpc_smart:
$(MAKE) all LINKSMART=1 CREATESMART=1
fpc_shared: all
ifdef inlinux
ifdef HASSHAREDLIB
ifndef LIBNAME
@$(ECHO) "LIBNAME not set"
else
@ -801,11 +842,17 @@ override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
endif
ifdef INSTALLPPUFILES
override INSTALLPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPUFILES))
ifdef PPUFILES
INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
else
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))))
endif
override INSTALLPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPULINKFILES))
endif
ifdef INSTALLEXEFILES
override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
endif
fpc_showinstall: $(SHOWINSTALLTARGET)
@ -819,7 +866,7 @@ ifneq ($(INSTALLPPULINKFILES),)
endif
ifneq ($(wildcard $(LIBFULLNAME)),)
@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
ifdef inlinux
ifdef HASSHAREDLIB
@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -847,7 +894,7 @@ endif
ifneq ($(wildcard $(LIBFULLNAME)),)
$(MKDIR) $(LIBINSTALLDIR)
$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
ifdef inlinux
ifdef inUnix
ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -908,7 +955,7 @@ endif
# Temporary path to pack a file
ifndef PACKDIR
ifndef inlinux
ifndef inUnix
PACKDIR=$(BASEDIR)/pack_tmp
else
PACKDIR=/tmp/fpc-pack
@ -924,7 +971,7 @@ endif
# Use tar by default under linux
ifndef USEZIP
ifdef inlinux
ifdef inUnix
USETAR=1
endif
endif
@ -966,16 +1013,19 @@ override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
endif
ifdef CLEANPPUFILES
override CLEANPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPUFILES))
# Get the .o and .a files created for the units
ifdef PPUFILES
CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
else
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))))
endif
override CLEANPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPULINKFILES))
endif
fpc_clean: $(CLEANTARGET)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
-$(DEL) $(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
endif
ifdef CLEANPPUFILES
-$(DEL) $(CLEANPPUFILES)
@ -984,7 +1034,7 @@ ifneq ($(CLEANPPULINKFILES),)
-$(DEL) $(CLEANPPULINKFILES)
endif
ifdef CLEANRSTFILES
-$(DEL) $(CLEANRSTFILES)
-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
endif
ifdef EXTRACLEANFILES
-$(DEL) $(EXTRACLEANFILES)
@ -996,7 +1046,13 @@ endif
fpc_distclean: fpc_clean
fpc_cleanall: $(CLEANTARGET)
# Also run clean first if targetdir is set. Unittargetdir is always
# set if targetdir or unittargetdir is specified
ifdef UNITTARGETDIR
TARGETDIRCLEAN=fpc_clean
endif
fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
endif

View File

@ -1,12 +1,12 @@
#
# Makefile generated by fpcmake v1.00 [2000/07/11]
# Makefile generated by fpcmake v1.00 [2000/09/20]
#
defaultrule: all
#####################################################################
# Autodetect OS (Linux or Dos or Windows NT)
# define inlinux when running under linux
# define inUnix when running under Unix (Linux,FreeBSD)
# define inWinNT when running under WinNT
#####################################################################
@ -23,22 +23,18 @@ nopwd:
@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
@exit
else
inlinux=1
inUnix=1
endif
else
PWD:=$(firstword $(PWD))
endif
# Detect NT - NT sets OS to Windows_NT
ifndef inlinux
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inUnix
ifeq ($(OS),Windows_NT)
inWinNT=1
endif
endif
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inlinux
ifndef inWinNT
else
ifdef OS2_SHELL
inOS2=1
endif
@ -46,14 +42,14 @@ endif
endif
# The extension of executables
ifdef inlinux
EXEEXT=
ifdef inUnix
SRCEXEEXT=
else
EXEEXT=.exe
SRCEXEEXT=.exe
endif
# The path which is searched separated by spaces
ifdef inlinux
ifdef inUnix
SEARCHPATH=$(subst :, ,$(PATH))
else
SEARCHPATH=$(subst ;, ,$(PATH))
@ -76,15 +72,11 @@ ifndef FPC
ifdef PP
FPC=$(PP)
else
ifdef inOS2
FPC=ppos2
else
FPC=ppc386
endif
endif
endif
override FPC:=$(subst $(EXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
# Target OS
ifndef OS_TARGET
@ -131,7 +123,7 @@ endif
# Detect FPCDIR
ifeq ($(FPCDIR),wrong)
ifdef inlinux
ifdef inUnix
override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
ifeq ($(wildcard $(FPCDIR)/units),)
override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@ -213,7 +205,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
ifndef ECHO
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=echo
ECHOE:=echo
@ -254,7 +246,7 @@ endif
# To install files
ifndef INSTALL
ifdef inlinux
ifdef inUnix
INSTALL:=install -m 644
else
INSTALL:=$(COPY)
@ -263,7 +255,7 @@ endif
# To install programs
ifndef INSTALLEXE
ifdef inlinux
ifdef inUnix
INSTALLEXE:=install -m 755
else
INSTALLEXE:=$(COPY)
@ -272,7 +264,7 @@ endif
# To make a directory.
ifndef MKDIR
ifdef inlinux
ifdef inUnix
MKDIR:=install -m 755 -d
else
MKDIR:=ginstall -m 755 -d
@ -296,7 +288,7 @@ LD=ld
endif
# ppas.bat / ppas.sh
ifdef inlinux
ifdef inUnix
PPAS=ppas.sh
else
ifdef inOS2
@ -307,7 +299,7 @@ endif
endif
# ldconfig to rebuild .so cache
ifdef inlinux
ifdef inUnix
LDCONFIG=ldconfig
else
LDCONFIG=
@ -315,7 +307,7 @@ endif
# ppumove
ifndef PPUMOVE
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUMOVE),)
PPUMOVE=
else
@ -326,7 +318,7 @@ export PPUMOVE
# ppufiles
ifndef PPUFILES
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUFILES),)
PPUFILES=
else
@ -345,7 +337,7 @@ ifeq ($(OS_TARGET),win32)
UPXPROG:=1
endif
ifdef UPXPROG
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(UPXPROG),)
UPXPROG=
else
@ -359,7 +351,7 @@ export UPXPROG
# ZipProg, you can't use Zip as the var name (PFV)
ifndef ZIPPROG
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ZIPPROG),)
ZIPPROG=
else
@ -373,7 +365,7 @@ ZIPEXT=.zip
# Tar
ifndef TARPROG
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(TARPROG),)
TARPROG=
else
@ -396,6 +388,7 @@ endif
# Default needed extensions (Go32v2,Linux)
LOADEREXT=.as
EXEEXT=.exe
PPLEXT=.ppl
PPUEXT=.ppu
OEXT=.o
@ -424,9 +417,18 @@ endif
# Linux
ifeq ($(OS_TARGET),linux)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.lnx
endif
# Linux
ifeq ($(OS_TARGET),freebsd)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.freebsd
endif
# Win32
ifeq ($(OS_TARGET),win32)
PPUEXT=.ppw
@ -587,9 +589,17 @@ endif
# Default Directories
#####################################################################
# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
ifeq ($(OS_TARGET),linux)
UNIXINSTALLDIR=1
endif
ifeq ($(OS_TARGET),freebsd)
UNIXINSTALLDIR=1
endif
# set the prefix directory where to install everything
ifndef PREFIXINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
PREFIXINSTALLDIR=/usr
else
PREFIXINSTALLDIR=/pp
@ -609,7 +619,7 @@ export DESTZIPDIR
# set the base directory where to install everything
ifndef BASEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
else
BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@ -618,7 +628,7 @@ endif
# set the directory where to install the binaries
ifndef BININSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
else
BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@ -635,7 +645,7 @@ endif
# Where to install shared libraries
ifndef LIBINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
else
LIBINSTALLDIR=$(UNITINSTALLDIR)
@ -644,7 +654,7 @@ endif
# Where the source files will be stored
ifndef SOURCEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
else
SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@ -656,7 +666,7 @@ endif
# Where the doc files will be stored
ifndef DOCINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
else
DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@ -666,7 +676,7 @@ endif
# Where to install the examples, under linux we use the doc dir
# because the copytree command will create a subdir itself
ifndef EXAMPLEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
else
EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@ -690,7 +700,7 @@ REDIRFILE=log
endif
ifdef REDIR
ifndef inlinux
ifndef inUnix
override FPC=redir -eo $(FPC)
endif
# set the verbosity to max
@ -773,9 +783,27 @@ ifdef UNITSDIR
override FPCOPT+=-Fu$(UNITSDIR)
endif
# Target dirs
# Target dirs and the prefix to use for clean/install
ifdef TARGETDIR
override FPCOPT+=-FE$(TARGETDIR)
ifeq ($(TARGETDIR),.)
override TARGETDIRPREFIX=
else
override TARGETDIRPREFIX=$(TARGETDIR)/
endif
endif
ifdef UNITTARGETDIR
override FPCOPT+=-FU$(UNITTARGETDIR)
ifeq ($(UNITTARGETDIR),.)
override UNITTARGETDIRPREFIX=
else
override UNITTARGETDIRPREFIX=$(TARGETDIR)/
endif
else
ifdef TARGETDIR
override UNITTARGETDIR=$(TARGETDIR)
override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
endif
endif
# Add commandline options last so they can override
@ -809,11 +837,14 @@ endif
override COMPILER:=$(FPC) $(FPCOPT)
# also call ppas if with command option -s
# but only if the OS_SOURCE and OS_TARGE are equal
ifeq (,$(findstring -s ,$(COMPILER)))
EXECPPAS=
else
ifeq ($(OS_SOURCE),$(OS_TARGET))
EXECPPAS:=@$(PPAS)
endif
endif
#####################################################################
# Standard rules
@ -882,6 +913,11 @@ fpc_all: fpc_packages $(FPCMADE)
fpc_debug:
$(MAKE) all DEBUG=1
# Search paths for .ppu if targetdir is set
ifdef UNITTARGETDIR
vpath %$(PPUEXT) $(UNITTARGETDIR)
endif
# General compile rules, available for both possible PASEXT
.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
@ -923,7 +959,7 @@ fpc_smart:
$(MAKE) all LINKSMART=1 CREATESMART=1
fpc_shared: all
ifdef inlinux
ifdef HASSHAREDLIB
ifndef LIBNAME
@$(ECHO) "LIBNAME not set"
else
@ -944,11 +980,17 @@ override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
endif
ifdef INSTALLPPUFILES
override INSTALLPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPUFILES))
ifdef PPUFILES
INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
else
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))))
endif
override INSTALLPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPULINKFILES))
endif
ifdef INSTALLEXEFILES
override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
endif
fpc_showinstall: $(SHOWINSTALLTARGET)
@ -962,7 +1004,7 @@ ifneq ($(INSTALLPPULINKFILES),)
endif
ifneq ($(wildcard $(LIBFULLNAME)),)
@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
ifdef inlinux
ifdef HASSHAREDLIB
@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -990,7 +1032,7 @@ endif
ifneq ($(wildcard $(LIBFULLNAME)),)
$(MKDIR) $(LIBINSTALLDIR)
$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
ifdef inlinux
ifdef inUnix
ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -1051,7 +1093,7 @@ endif
# Temporary path to pack a file
ifndef PACKDIR
ifndef inlinux
ifndef inUnix
PACKDIR=$(BASEDIR)/pack_tmp
else
PACKDIR=/tmp/fpc-pack
@ -1067,7 +1109,7 @@ endif
# Use tar by default under linux
ifndef USEZIP
ifdef inlinux
ifdef inUnix
USETAR=1
endif
endif
@ -1109,16 +1151,19 @@ override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
endif
ifdef CLEANPPUFILES
override CLEANPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPUFILES))
# Get the .o and .a files created for the units
ifdef PPUFILES
CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
else
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))))
endif
override CLEANPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPULINKFILES))
endif
fpc_clean: $(CLEANTARGET)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
-$(DEL) $(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
endif
ifdef CLEANPPUFILES
-$(DEL) $(CLEANPPUFILES)
@ -1127,7 +1172,7 @@ ifneq ($(CLEANPPULINKFILES),)
-$(DEL) $(CLEANPPULINKFILES)
endif
ifdef CLEANRSTFILES
-$(DEL) $(CLEANRSTFILES)
-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
endif
ifdef EXTRACLEANFILES
-$(DEL) $(EXTRACLEANFILES)
@ -1139,7 +1184,13 @@ endif
fpc_distclean: fpc_clean
fpc_cleanall: $(CLEANTARGET)
# Also run clean first if targetdir is set. Unittargetdir is always
# set if targetdir or unittargetdir is specified
ifdef UNITTARGETDIR
TARGETDIRCLEAN=fpc_clean
endif
fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
endif

View File

@ -1,12 +1,12 @@
#
# Makefile generated by fpcmake v1.00 [2000/07/11]
# Makefile generated by fpcmake v1.00 [2000/09/20]
#
defaultrule: all
#####################################################################
# Autodetect OS (Linux or Dos or Windows NT)
# define inlinux when running under linux
# define inUnix when running under Unix (Linux,FreeBSD)
# define inWinNT when running under WinNT
#####################################################################
@ -23,22 +23,18 @@ nopwd:
@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
@exit
else
inlinux=1
inUnix=1
endif
else
PWD:=$(firstword $(PWD))
endif
# Detect NT - NT sets OS to Windows_NT
ifndef inlinux
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inUnix
ifeq ($(OS),Windows_NT)
inWinNT=1
endif
endif
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inlinux
ifndef inWinNT
else
ifdef OS2_SHELL
inOS2=1
endif
@ -46,14 +42,14 @@ endif
endif
# The extension of executables
ifdef inlinux
EXEEXT=
ifdef inUnix
SRCEXEEXT=
else
EXEEXT=.exe
SRCEXEEXT=.exe
endif
# The path which is searched separated by spaces
ifdef inlinux
ifdef inUnix
SEARCHPATH=$(subst :, ,$(PATH))
else
SEARCHPATH=$(subst ;, ,$(PATH))
@ -76,15 +72,11 @@ ifndef FPC
ifdef PP
FPC=$(PP)
else
ifdef inOS2
FPC=ppos2
else
FPC=ppc386
endif
endif
endif
override FPC:=$(subst $(EXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
# Target OS
ifndef OS_TARGET
@ -138,7 +130,7 @@ endif
# Detect FPCDIR
ifeq ($(FPCDIR),wrong)
ifdef inlinux
ifdef inUnix
override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
ifeq ($(wildcard $(FPCDIR)/units),)
override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@ -222,7 +214,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
ifndef ECHO
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=echo
ECHOE:=echo
@ -263,7 +255,7 @@ endif
# To install files
ifndef INSTALL
ifdef inlinux
ifdef inUnix
INSTALL:=install -m 644
else
INSTALL:=$(COPY)
@ -272,7 +264,7 @@ endif
# To install programs
ifndef INSTALLEXE
ifdef inlinux
ifdef inUnix
INSTALLEXE:=install -m 755
else
INSTALLEXE:=$(COPY)
@ -281,7 +273,7 @@ endif
# To make a directory.
ifndef MKDIR
ifdef inlinux
ifdef inUnix
MKDIR:=install -m 755 -d
else
MKDIR:=ginstall -m 755 -d
@ -305,7 +297,7 @@ LD=ld
endif
# ppas.bat / ppas.sh
ifdef inlinux
ifdef inUnix
PPAS=ppas.sh
else
ifdef inOS2
@ -316,7 +308,7 @@ endif
endif
# ldconfig to rebuild .so cache
ifdef inlinux
ifdef inUnix
LDCONFIG=ldconfig
else
LDCONFIG=
@ -324,7 +316,7 @@ endif
# ppumove
ifndef PPUMOVE
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUMOVE),)
PPUMOVE=
else
@ -335,7 +327,7 @@ export PPUMOVE
# ppufiles
ifndef PPUFILES
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUFILES),)
PPUFILES=
else
@ -354,7 +346,7 @@ ifeq ($(OS_TARGET),win32)
UPXPROG:=1
endif
ifdef UPXPROG
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(UPXPROG),)
UPXPROG=
else
@ -368,7 +360,7 @@ export UPXPROG
# ZipProg, you can't use Zip as the var name (PFV)
ifndef ZIPPROG
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ZIPPROG),)
ZIPPROG=
else
@ -382,7 +374,7 @@ ZIPEXT=.zip
# Tar
ifndef TARPROG
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(TARPROG),)
TARPROG=
else
@ -405,6 +397,7 @@ endif
# Default needed extensions (Go32v2,Linux)
LOADEREXT=.as
EXEEXT=.exe
PPLEXT=.ppl
PPUEXT=.ppu
OEXT=.o
@ -433,9 +426,18 @@ endif
# Linux
ifeq ($(OS_TARGET),linux)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.lnx
endif
# Linux
ifeq ($(OS_TARGET),freebsd)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.freebsd
endif
# Win32
ifeq ($(OS_TARGET),win32)
PPUEXT=.ppw
@ -596,9 +598,17 @@ endif
# Default Directories
#####################################################################
# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
ifeq ($(OS_TARGET),linux)
UNIXINSTALLDIR=1
endif
ifeq ($(OS_TARGET),freebsd)
UNIXINSTALLDIR=1
endif
# set the prefix directory where to install everything
ifndef PREFIXINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
PREFIXINSTALLDIR=/usr
else
PREFIXINSTALLDIR=/pp
@ -618,7 +628,7 @@ export DESTZIPDIR
# set the base directory where to install everything
ifndef BASEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
else
BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@ -627,7 +637,7 @@ endif
# set the directory where to install the binaries
ifndef BININSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
else
BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@ -644,7 +654,7 @@ endif
# Where to install shared libraries
ifndef LIBINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
else
LIBINSTALLDIR=$(UNITINSTALLDIR)
@ -653,7 +663,7 @@ endif
# Where the source files will be stored
ifndef SOURCEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
else
SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@ -665,7 +675,7 @@ endif
# Where the doc files will be stored
ifndef DOCINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
else
DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@ -675,7 +685,7 @@ endif
# Where to install the examples, under linux we use the doc dir
# because the copytree command will create a subdir itself
ifndef EXAMPLEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
else
EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@ -699,7 +709,7 @@ REDIRFILE=log
endif
ifdef REDIR
ifndef inlinux
ifndef inUnix
override FPC=redir -eo $(FPC)
endif
# set the verbosity to max
@ -787,8 +797,27 @@ override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
endif
# Target dirs and the prefix to use for clean/install
ifdef TARGETDIR
override FPCOPT+=-FE$(TARGETDIR)
ifeq ($(TARGETDIR),.)
override TARGETDIRPREFIX=
else
override TARGETDIRPREFIX=$(TARGETDIR)/
endif
endif
ifdef UNITTARGETDIR
override FPCOPT+=-FU$(UNITTARGETDIR)
ifeq ($(UNITTARGETDIR),.)
override UNITTARGETDIRPREFIX=
else
override UNITTARGETDIRPREFIX=$(TARGETDIR)/
endif
else
ifdef TARGETDIR
override UNITTARGETDIR=$(TARGETDIR)
override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
endif
endif
# Add commandline options last so they can override
@ -822,11 +851,14 @@ endif
override COMPILER:=$(FPC) $(FPCOPT)
# also call ppas if with command option -s
# but only if the OS_SOURCE and OS_TARGE are equal
ifeq (,$(findstring -s ,$(COMPILER)))
EXECPPAS=
else
ifeq ($(OS_SOURCE),$(OS_TARGET))
EXECPPAS:=@$(PPAS)
endif
endif
#####################################################################
# Standard rules
@ -895,6 +927,11 @@ fpc_all: fpc_packages $(FPCMADE)
fpc_debug:
$(MAKE) all DEBUG=1
# Search paths for .ppu if targetdir is set
ifdef UNITTARGETDIR
vpath %$(PPUEXT) $(UNITTARGETDIR)
endif
# General compile rules, available for both possible PASEXT
.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
@ -936,7 +973,7 @@ fpc_smart:
$(MAKE) all LINKSMART=1 CREATESMART=1
fpc_shared: all
ifdef inlinux
ifdef HASSHAREDLIB
ifndef LIBNAME
@$(ECHO) "LIBNAME not set"
else
@ -957,11 +994,17 @@ override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
endif
ifdef INSTALLPPUFILES
override INSTALLPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPUFILES))
ifdef PPUFILES
INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
else
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))))
endif
override INSTALLPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPULINKFILES))
endif
ifdef INSTALLEXEFILES
override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
endif
fpc_showinstall: $(SHOWINSTALLTARGET)
@ -975,7 +1018,7 @@ ifneq ($(INSTALLPPULINKFILES),)
endif
ifneq ($(wildcard $(LIBFULLNAME)),)
@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
ifdef inlinux
ifdef HASSHAREDLIB
@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -1003,7 +1046,7 @@ endif
ifneq ($(wildcard $(LIBFULLNAME)),)
$(MKDIR) $(LIBINSTALLDIR)
$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
ifdef inlinux
ifdef inUnix
ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -1064,7 +1107,7 @@ endif
# Temporary path to pack a file
ifndef PACKDIR
ifndef inlinux
ifndef inUnix
PACKDIR=$(BASEDIR)/pack_tmp
else
PACKDIR=/tmp/fpc-pack
@ -1080,7 +1123,7 @@ endif
# Use tar by default under linux
ifndef USEZIP
ifdef inlinux
ifdef inUnix
USETAR=1
endif
endif
@ -1122,16 +1165,19 @@ override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
endif
ifdef CLEANPPUFILES
override CLEANPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPUFILES))
# Get the .o and .a files created for the units
ifdef PPUFILES
CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
else
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))))
endif
override CLEANPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPULINKFILES))
endif
fpc_clean: $(CLEANTARGET)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
-$(DEL) $(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
endif
ifdef CLEANPPUFILES
-$(DEL) $(CLEANPPUFILES)
@ -1140,7 +1186,7 @@ ifneq ($(CLEANPPULINKFILES),)
-$(DEL) $(CLEANPPULINKFILES)
endif
ifdef CLEANRSTFILES
-$(DEL) $(CLEANRSTFILES)
-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
endif
ifdef EXTRACLEANFILES
-$(DEL) $(EXTRACLEANFILES)
@ -1152,7 +1198,13 @@ endif
fpc_distclean: fpc_clean
fpc_cleanall: $(CLEANTARGET)
# Also run clean first if targetdir is set. Unittargetdir is always
# set if targetdir or unittargetdir is specified
ifdef UNITTARGETDIR
TARGETDIRCLEAN=fpc_clean
endif
fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
endif

View File

@ -1,12 +1,12 @@
#
# Makefile generated by fpcmake v0.99.15 [2000/07/02]
# Makefile generated by fpcmake v1.00 [2000/09/20]
#
defaultrule: all
#####################################################################
# Autodetect OS (Linux or Dos or Windows NT)
# define inlinux when running under linux
# define inUnix when running under Unix (Linux,FreeBSD)
# define inWinNT when running under WinNT
#####################################################################
@ -23,22 +23,18 @@ nopwd:
@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
@exit
else
inlinux=1
inUnix=1
endif
else
PWD:=$(firstword $(PWD))
endif
# Detect NT - NT sets OS to Windows_NT
ifndef inlinux
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inUnix
ifeq ($(OS),Windows_NT)
inWinNT=1
endif
endif
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inlinux
ifndef inWinNT
else
ifdef OS2_SHELL
inOS2=1
endif
@ -46,14 +42,14 @@ endif
endif
# The extension of executables
ifdef inlinux
EXEEXT=
ifdef inUnix
SRCEXEEXT=
else
EXEEXT=.exe
SRCEXEEXT=.exe
endif
# The path which is searched separated by spaces
ifdef inlinux
ifdef inUnix
SEARCHPATH=$(subst :, ,$(PATH))
else
SEARCHPATH=$(subst ;, ,$(PATH))
@ -76,15 +72,11 @@ ifndef FPC
ifdef PP
FPC=$(PP)
else
ifdef inOS2
FPC=ppos2
else
FPC=ppc386
endif
endif
endif
override FPC:=$(subst $(EXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
# Target OS
ifndef OS_TARGET
@ -146,7 +138,7 @@ endif
# Detect FPCDIR
ifeq ($(FPCDIR),wrong)
ifdef inlinux
ifdef inUnix
override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
ifeq ($(wildcard $(FPCDIR)/units),)
override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@ -228,7 +220,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
ifndef ECHO
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=echo
ECHOE:=echo
@ -269,7 +261,7 @@ endif
# To install files
ifndef INSTALL
ifdef inlinux
ifdef inUnix
INSTALL:=install -m 644
else
INSTALL:=$(COPY)
@ -278,7 +270,7 @@ endif
# To install programs
ifndef INSTALLEXE
ifdef inlinux
ifdef inUnix
INSTALLEXE:=install -m 755
else
INSTALLEXE:=$(COPY)
@ -287,7 +279,7 @@ endif
# To make a directory.
ifndef MKDIR
ifdef inlinux
ifdef inUnix
MKDIR:=install -m 755 -d
else
MKDIR:=ginstall -m 755 -d
@ -311,7 +303,7 @@ LD=ld
endif
# ppas.bat / ppas.sh
ifdef inlinux
ifdef inUnix
PPAS=ppas.sh
else
ifdef inOS2
@ -322,7 +314,7 @@ endif
endif
# ldconfig to rebuild .so cache
ifdef inlinux
ifdef inUnix
LDCONFIG=ldconfig
else
LDCONFIG=
@ -330,7 +322,7 @@ endif
# ppumove
ifndef PPUMOVE
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUMOVE),)
PPUMOVE=
else
@ -341,7 +333,7 @@ export PPUMOVE
# ppufiles
ifndef PPUFILES
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUFILES),)
PPUFILES=
else
@ -360,7 +352,7 @@ ifeq ($(OS_TARGET),win32)
UPXPROG:=1
endif
ifdef UPXPROG
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(UPXPROG),)
UPXPROG=
else
@ -374,7 +366,7 @@ export UPXPROG
# ZipProg, you can't use Zip as the var name (PFV)
ifndef ZIPPROG
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ZIPPROG),)
ZIPPROG=
else
@ -388,7 +380,7 @@ ZIPEXT=.zip
# Tar
ifndef TARPROG
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(TARPROG),)
TARPROG=
else
@ -411,6 +403,7 @@ endif
# Default needed extensions (Go32v2,Linux)
LOADEREXT=.as
EXEEXT=.exe
PPLEXT=.ppl
PPUEXT=.ppu
OEXT=.o
@ -439,9 +432,18 @@ endif
# Linux
ifeq ($(OS_TARGET),linux)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.lnx
endif
# Linux
ifeq ($(OS_TARGET),freebsd)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.freebsd
endif
# Win32
ifeq ($(OS_TARGET),win32)
PPUEXT=.ppw
@ -602,9 +604,17 @@ endif
# Default Directories
#####################################################################
# Linux and freebsd use unix dirs with /usr/bin, /usr/lib
ifeq ($(OS_TARGET),linux)
UNIXINSTALLDIR=1
endif
ifeq ($(OS_TARGET),freebsd)
UNIXINSTALLDIR=1
endif
# set the prefix directory where to install everything
ifndef PREFIXINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
PREFIXINSTALLDIR=/usr
else
PREFIXINSTALLDIR=/pp
@ -624,7 +634,7 @@ export DESTZIPDIR
# set the base directory where to install everything
ifndef BASEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
else
BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@ -633,7 +643,7 @@ endif
# set the directory where to install the binaries
ifndef BININSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
else
BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@ -650,7 +660,7 @@ endif
# Where to install shared libraries
ifndef LIBINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
else
LIBINSTALLDIR=$(UNITINSTALLDIR)
@ -659,7 +669,7 @@ endif
# Where the source files will be stored
ifndef SOURCEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
else
SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@ -671,7 +681,7 @@ endif
# Where the doc files will be stored
ifndef DOCINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
else
DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@ -681,7 +691,7 @@ endif
# Where to install the examples, under linux we use the doc dir
# because the copytree command will create a subdir itself
ifndef EXAMPLEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
else
EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@ -705,7 +715,7 @@ REDIRFILE=log
endif
ifdef REDIR
ifndef inlinux
ifndef inUnix
override FPC=redir -eo $(FPC)
endif
# set the verbosity to max
@ -793,9 +803,27 @@ override FPCOPT+=$(addprefix -Fi,$(NEEDINCDIR))
endif
# Target dirs
# Target dirs and the prefix to use for clean/install
ifdef TARGETDIR
override FPCOPT+=-FE$(TARGETDIR)
ifeq ($(TARGETDIR),.)
override TARGETDIRPREFIX=
else
override TARGETDIRPREFIX=$(TARGETDIR)/
endif
endif
ifdef UNITTARGETDIR
override FPCOPT+=-FU$(UNITTARGETDIR)
ifeq ($(UNITTARGETDIR),.)
override UNITTARGETDIRPREFIX=
else
override UNITTARGETDIRPREFIX=$(TARGETDIR)/
endif
else
ifdef TARGETDIR
override UNITTARGETDIR=$(TARGETDIR)
override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
endif
endif
# Add commandline options last so they can override
@ -829,11 +857,14 @@ endif
override COMPILER:=$(FPC) $(FPCOPT)
# also call ppas if with command option -s
# but only if the OS_SOURCE and OS_TARGE are equal
ifeq (,$(findstring -s ,$(COMPILER)))
EXECPPAS=
else
ifeq ($(OS_SOURCE),$(OS_TARGET))
EXECPPAS:=@$(PPAS)
endif
endif
#####################################################################
# Standard rules
@ -902,6 +933,11 @@ fpc_all: fpc_packages $(FPCMADE)
fpc_debug:
$(MAKE) all DEBUG=1
# Search paths for .ppu if targetdir is set
ifdef UNITTARGETDIR
vpath %$(PPUEXT) $(UNITTARGETDIR)
endif
# General compile rules, available for both possible PASEXT
.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
@ -943,7 +979,7 @@ fpc_smart:
$(MAKE) all LINKSMART=1 CREATESMART=1
fpc_shared: all
ifdef inlinux
ifdef HASSHAREDLIB
ifndef LIBNAME
@$(ECHO) "LIBNAME not set"
else
@ -964,11 +1000,17 @@ override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
endif
ifdef INSTALLPPUFILES
override INSTALLPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPUFILES))
ifdef PPUFILES
INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
else
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))))
endif
override INSTALLPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLPPULINKFILES))
endif
ifdef INSTALLEXEFILES
override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
endif
fpc_showinstall: $(SHOWINSTALLTARGET)
@ -982,7 +1024,7 @@ ifneq ($(INSTALLPPULINKFILES),)
endif
ifneq ($(wildcard $(LIBFULLNAME)),)
@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
ifdef inlinux
ifdef HASSHAREDLIB
@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -1010,7 +1052,7 @@ endif
ifneq ($(wildcard $(LIBFULLNAME)),)
$(MKDIR) $(LIBINSTALLDIR)
$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
ifdef inlinux
ifdef inUnix
ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -1071,7 +1113,7 @@ endif
# Temporary path to pack a file
ifndef PACKDIR
ifndef inlinux
ifndef inUnix
PACKDIR=$(BASEDIR)/pack_tmp
else
PACKDIR=/tmp/fpc-pack
@ -1087,7 +1129,7 @@ endif
# Use tar by default under linux
ifndef USEZIP
ifdef inlinux
ifdef inUnix
USETAR=1
endif
endif
@ -1129,16 +1171,19 @@ override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
endif
ifdef CLEANPPUFILES
override CLEANPPUFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPUFILES))
# Get the .o and .a files created for the units
ifdef PPUFILES
CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
else
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))))
endif
override CLEANPPULINKFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANPPULINKFILES))
endif
fpc_clean: $(CLEANTARGET)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
-$(DEL) $(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
endif
ifdef CLEANPPUFILES
-$(DEL) $(CLEANPPUFILES)
@ -1147,7 +1192,7 @@ ifneq ($(CLEANPPULINKFILES),)
-$(DEL) $(CLEANPPULINKFILES)
endif
ifdef CLEANRSTFILES
-$(DEL) $(CLEANRSTFILES)
-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
endif
ifdef EXTRACLEANFILES
-$(DEL) $(EXTRACLEANFILES)
@ -1159,7 +1204,13 @@ endif
fpc_distclean: fpc_clean
fpc_cleanall: $(CLEANTARGET)
# Also run clean first if targetdir is set. Unittargetdir is always
# set if targetdir or unittargetdir is specified
ifdef UNITTARGETDIR
TARGETDIRCLEAN=fpc_clean
endif
fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
endif