|
@@ -2,6 +2,22 @@
|
|
; Templates used by fpcmake to create a Makefile from Makefile.fpc
|
|
; Templates used by fpcmake to create a Makefile from Makefile.fpc
|
|
;
|
|
;
|
|
|
|
|
|
|
|
+[defines]
|
|
|
|
+#####################################################################
|
|
|
|
+# Misc defines to be used by anyone
|
|
|
|
+#####################################################################
|
|
|
|
+
|
|
|
|
+# OS categories
|
|
|
|
+BSDs = freebsd netbsd openbsd darwin
|
|
|
|
+UNIXs = linux $(BSDs) sunos qnx
|
|
|
|
+
|
|
|
|
+#Empty target for rules that always should run. Needed if
|
|
|
|
+#the target is non-phoney, and there is non-phony prereqisites.
|
|
|
|
+#Then add FORCE as an prerequisite
|
|
|
|
+#See gnu make manual: 4.7 Rules without Commands or Prerequisites
|
|
|
|
+FORCE:
|
|
|
|
+.PHONY: FORCE
|
|
|
|
+
|
|
[osdetect]
|
|
[osdetect]
|
|
#####################################################################
|
|
#####################################################################
|
|
# Autodetect source OS (Linux or Dos or Windows NT or OS/2 or other)
|
|
# Autodetect source OS (Linux or Dos or Windows NT or OS/2 or other)
|
|
@@ -15,14 +31,22 @@
|
|
# We need only / in the path also remove the current dir
|
|
# We need only / in the path also remove the current dir
|
|
override PATH:=$(subst \,/,$(PATH))
|
|
override PATH:=$(subst \,/,$(PATH))
|
|
|
|
|
|
-# Determine if we've a unix searchpath using : by looking for a ;
|
|
|
|
-# that normally doesn't exists in path names.
|
|
|
|
|
|
+# Detect unix
|
|
|
|
+# Darwin is handled specially
|
|
|
|
+ifneq ($(findstring darwin,$(OSTYPE)),)
|
|
|
|
+inUnix=1 #darwin
|
|
|
|
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
|
|
|
|
+else
|
|
|
|
+# Determine if we've a unix searchpath by looking for a ;
|
|
|
|
+# that normally doesn't exists in the unix PATH var.
|
|
ifeq ($(findstring ;,$(PATH)),)
|
|
ifeq ($(findstring ;,$(PATH)),)
|
|
inUnix=1
|
|
inUnix=1
|
|
SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
|
|
SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
|
|
else
|
|
else
|
|
SEARCHPATH:=$(subst ;, ,$(PATH))
|
|
SEARCHPATH:=$(subst ;, ,$(PATH))
|
|
endif
|
|
endif
|
|
|
|
+endif
|
|
|
|
+
|
|
# Add path were make is located
|
|
# Add path were make is located
|
|
SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
|
|
SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
|
|
|
|
|
|
@@ -167,9 +191,6 @@ unexport CHECKDEPEND ALLDEPENDENCIES
|
|
# FPC Target Detection
|
|
# FPC Target Detection
|
|
#####################################################################
|
|
#####################################################################
|
|
|
|
|
|
-# Some defines
|
|
|
|
-BSDTARGETS=freebsd netbsd openbsd darwin
|
|
|
|
-
|
|
|
|
# Fall back to default values if needed
|
|
# Fall back to default values if needed
|
|
ifndef CPU_TARGET
|
|
ifndef CPU_TARGET
|
|
ifdef CPU_TARGET_DEFAULT
|
|
ifdef CPU_TARGET_DEFAULT
|
|
@@ -223,7 +244,7 @@ endif
|
|
|
|
|
|
|
|
|
|
# Detect BSD, since BSD uses a slightly different directory hierarchy.
|
|
# Detect BSD, since BSD uses a slightly different directory hierarchy.
|
|
-ifneq ($(findstring $(OS_TARGET),$(BSDTARGETS)),)
|
|
|
|
|
|
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
|
|
BSDhier=1
|
|
BSDhier=1
|
|
endif
|
|
endif
|
|
|
|
|
|
@@ -388,55 +409,18 @@ override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
|
|
endif
|
|
endif
|
|
|
|
|
|
|
|
|
|
-# Linux, netbsd and freebsd use unix dirs with /usr/bin, /usr/lib
|
|
|
|
-# When zipping use the target as default, when normal install then
|
|
|
|
|
|
+# Unixes use unix dirs with /usr/bin, /usr/lib
|
|
|
|
+# When zipping use the target os default, when normal install then
|
|
# use the source os as default
|
|
# use the source os as default
|
|
ifdef ZIPINSTALL
|
|
ifdef ZIPINSTALL
|
|
# Zipinstall
|
|
# Zipinstall
|
|
-ifeq ($(OS_TARGET),linux)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_TARGET),freebsd)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_TARGET),netbsd)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_TARGET),openbsd)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_TARGET),darwin)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
-ifeq ($(OS_TARGET),sunos)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_TARGET),qnx)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
|
|
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
|
|
|
|
+UNIXHier=1
|
|
endif
|
|
endif
|
|
else
|
|
else
|
|
# Normal install
|
|
# Normal install
|
|
-ifeq ($(OS_SOURCE),linux)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_SOURCE),freebsd)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_SOURCE),netbsd)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_SOURCE),openbsd)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_SOURCE),darwin)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_TARGET),sunos)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
-endif
|
|
|
|
-ifeq ($(OS_TARGET),qnx)
|
|
|
|
-UNIXINSTALLDIR=1
|
|
|
|
|
|
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
|
|
|
|
+UNIXHier=1
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
|
|
@@ -449,7 +433,7 @@ endif
|
|
|
|
|
|
# set the prefix directory where to install everything
|
|
# set the prefix directory where to install everything
|
|
ifndef INSTALL_PREFIX
|
|
ifndef INSTALL_PREFIX
|
|
-ifdef UNIXINSTALLDIR
|
|
|
|
|
|
+ifdef UNIXHier
|
|
INSTALL_PREFIX=/usr/local
|
|
INSTALL_PREFIX=/usr/local
|
|
else
|
|
else
|
|
ifdef INSTALL_FPCPACKAGE
|
|
ifdef INSTALL_FPCPACKAGE
|
|
@@ -480,7 +464,7 @@ export DIST_DESTDIR
|
|
|
|
|
|
# set the base directory where to install everything
|
|
# set the base directory where to install everything
|
|
ifndef INSTALL_BASEDIR
|
|
ifndef INSTALL_BASEDIR
|
|
-ifdef UNIXINSTALLDIR
|
|
|
|
|
|
+ifdef UNIXHier
|
|
ifdef INSTALL_FPCPACKAGE
|
|
ifdef INSTALL_FPCPACKAGE
|
|
INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
|
|
INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
|
|
else
|
|
else
|
|
@@ -493,7 +477,7 @@ endif
|
|
|
|
|
|
# set the directory where to install the binaries
|
|
# set the directory where to install the binaries
|
|
ifndef INSTALL_BINDIR
|
|
ifndef INSTALL_BINDIR
|
|
-ifdef UNIXINSTALLDIR
|
|
|
|
|
|
+ifdef UNIXHier
|
|
ifdef CROSSCOMPILE
|
|
ifdef CROSSCOMPILE
|
|
INSTALL_BINDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin
|
|
INSTALL_BINDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin
|
|
else
|
|
else
|
|
@@ -529,7 +513,7 @@ endif
|
|
|
|
|
|
# Where to install shared libraries
|
|
# Where to install shared libraries
|
|
ifndef INSTALL_LIBDIR
|
|
ifndef INSTALL_LIBDIR
|
|
-ifdef UNIXINSTALLDIR
|
|
|
|
|
|
+ifdef UNIXHier
|
|
INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
|
|
INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
|
|
else
|
|
else
|
|
INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
|
|
INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
|
|
@@ -538,7 +522,7 @@ endif
|
|
|
|
|
|
# Where the source files will be stored
|
|
# Where the source files will be stored
|
|
ifndef INSTALL_SOURCEDIR
|
|
ifndef INSTALL_SOURCEDIR
|
|
-ifdef UNIXINSTALLDIR
|
|
|
|
|
|
+ifdef UNIXHier
|
|
ifdef BSDhier
|
|
ifdef BSDhier
|
|
SRCPREFIXDIR=share/src
|
|
SRCPREFIXDIR=share/src
|
|
else
|
|
else
|
|
@@ -572,7 +556,7 @@ endif
|
|
|
|
|
|
# Where the doc files will be stored
|
|
# Where the doc files will be stored
|
|
ifndef INSTALL_DOCDIR
|
|
ifndef INSTALL_DOCDIR
|
|
-ifdef UNIXINSTALLDIR
|
|
|
|
|
|
+ifdef UNIXHier
|
|
ifdef BSDhier
|
|
ifdef BSDhier
|
|
DOCPREFIXDIR=share/doc
|
|
DOCPREFIXDIR=share/doc
|
|
else
|
|
else
|
|
@@ -599,7 +583,7 @@ endif
|
|
# Where to install the examples, under linux we use the doc dir
|
|
# Where to install the examples, under linux we use the doc dir
|
|
# because the copytree command will create a subdir itself
|
|
# because the copytree command will create a subdir itself
|
|
ifndef INSTALL_EXAMPLEDIR
|
|
ifndef INSTALL_EXAMPLEDIR
|
|
-ifdef UNIXINSTALLDIR
|
|
|
|
|
|
+ifdef UNIXHier
|
|
ifdef INSTALL_FPCPACKAGE
|
|
ifdef INSTALL_FPCPACKAGE
|
|
|
|
|
|
ifdef BSDhier
|
|
ifdef BSDhier
|
|
@@ -1769,6 +1753,9 @@ endif
|
|
|
|
|
|
ifdef CLEANPPUFILES
|
|
ifdef CLEANPPUFILES
|
|
override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
|
|
override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
|
|
|
|
+ifdef DEBUGSYMEXT
|
|
|
|
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
|
|
|
|
+endif
|
|
override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
|
|
override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
|
|
override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
|
|
override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
|
|
endif
|
|
endif
|
|
@@ -1791,11 +1778,9 @@ ifdef CLEAN_FILES
|
|
endif
|
|
endif
|
|
ifdef LIB_NAME
|
|
ifdef LIB_NAME
|
|
-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
|
|
-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
|
|
-endif
|
|
|
|
-ifdef DEBUGSYMEXT
|
|
|
|
- -$(DEL) *$(DEBUGSYMEXT)
|
|
|
|
endif
|
|
endif
|
|
-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
|
|
-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
|
|
|
|
+ -$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
|
|
|
|
|
|
fpc_distclean: clean
|
|
fpc_distclean: clean
|
|
|
|
|
|
@@ -1816,6 +1801,9 @@ endif
|
|
ifdef AOUTEXT
|
|
ifdef AOUTEXT
|
|
-$(DEL) *$(AOUTEXT)
|
|
-$(DEL) *$(AOUTEXT)
|
|
endif
|
|
endif
|
|
|
|
+ifdef DEBUGSYMEXT
|
|
|
|
+ -$(DEL) *$(DEBUGSYMEXT)
|
|
|
|
+endif
|
|
|
|
|
|
|
|
|
|
[baseinforules]
|
|
[baseinforules]
|