#
# Makefile generated by fpcmake v1.00 [2000/10/27]
#

defaultrule: all

#####################################################################
# Autodetect OS (Linux or Dos or Windows NT)
# define inUnix when running under Unix (Linux,FreeBSD)
# 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
inUnix=1
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

override DIROBJECTS+=$(wildcard go32v2 linux win32 os2 freebsd)
override EXAMPLEDIROBJECTS+=tests db/tests shedit/gtk

# Clean


# Install

EXAMPLESUBDIR=fcl
PACKAGENAME=fcl
ZIPTARGET=install

# Defaults


# Directories


# Packages


# Libraries


#####################################################################
# Shell tools
#####################################################################

# echo
ifndef ECHO
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=echo
ECHOE:=echo
else
ECHO:=$(firstword $(ECHO))
ECHOE=$(ECHO) -E
endif
else
ECHO:=$(firstword $(ECHO))
ECHOE=$(ECHO) -E
endif
endif

# 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 inUnix
INSTALL:=install -c -m 644
else
INSTALL:=$(COPY)
endif
endif

# To install programs
ifndef INSTALLEXE
ifdef inUnix
INSTALLEXE:=install -c -m 755
else
INSTALLEXE:=$(COPY)
endif
endif

# To make a directory.
ifndef MKDIR
ifdef inUnix
MKDIR:=install -m 755 -d
else
MKDIR:=ginstall -m 755 -d
endif
endif

export ECHO ECHOE 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 inUnix
PPAS=ppas.sh
else
ifdef inOS2
PPAS=ppas.cmd
else
PPAS=ppas.bat
endif
endif

# ldconfig to rebuild .so cache
ifdef inUnix
LDCONFIG=ldconfig
else
LDCONFIG=
endif

# ZipProg, you can't use Zip as the var name (PFV)
ifndef ZIPPROG
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ZIPPROG),)
ZIPPROG=
else
ZIPPROG:=$(firstword $(ZIPPROG))
endif
endif
export ZIPPROG

ZIPOPT=-9
ZIPEXT=.zip

# Tar
ifndef TARPROG
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(TARPROG),)
TARPROG=
else
TARPROG:=$(firstword $(TARPROG))
endif
endif
export TARPROG

ifeq ($(USETAR),bz2)
TAROPT=vI
TAREXT=.tar.bz2
else
TAROPT=vz
TAREXT=.tar.gz
endif



#####################################################################
# 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

#####################################################################
# Install Directories
#####################################################################

# set the base directory where to install everything
ifndef BASEINSTALLDIR
ifdef UNIXINSTALLDIR
BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
else
BASEINSTALLDIR=$(PREFIXINSTALLDIR)
endif
endif

# set the directory where to install the binaries
ifndef BININSTALLDIR
ifdef UNIXINSTALLDIR
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 UNIXINSTALLDIR
LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
else
LIBINSTALLDIR=$(UNITINSTALLDIR)
endif
endif

# Where the source files will be stored
ifndef SOURCEINSTALLDIR
ifdef UNIXINSTALLDIR
SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
else
SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
endif
ifdef SOURCESUBDIR
SOURCEINSTALLDIR:=$(SOURCEINSTALLDIR)/$(SOURCESUBDIR)
endif
endif

# Where the doc files will be stored
ifndef DOCINSTALLDIR
ifdef UNIXINSTALLDIR
DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
else
DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
endif
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 UNIXINSTALLDIR
EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
else
EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
endif
ifdef EXAMPLESUBDIR
EXAMPLEINSTALLDIR:=$(EXAMPLEINSTALLDIR)/$(EXAMPLESUBDIR)
endif
endif

# Where the some extra (data)files will be stored
ifndef DATAINSTALLDIR
DATAINSTALLDIR=$(BASEINSTALLDIR)
endif

#####################################################################
# 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
#####################################################################

all: $(addsuffix _all,$(OS_TARGET))

debug: $(addsuffix _debug,$(OS_TARGET))

examples: fpc_examples

test: fpc_test

smart: $(addsuffix _smart,$(OS_TARGET))

shared: $(addsuffix _shared,$(OS_TARGET))

showinstall: $(addsuffix _showinstall,$(OS_TARGET))

install: $(addsuffix _install,$(OS_TARGET))

sourceinstall: fpc_sourceinstall

exampleinstall: fpc_exampleinstall

zipinstall: fpc_zipinstall

zipsourceinstall: fpc_zipsourceinstall

zipexampleinstall: fpc_zipexampleinstall

clean: $(addsuffix _clean,$(OS_TARGET)) $(addsuffix _clean,$(EXAMPLEDIROBJECTS))

distclean: $(addsuffix _distclean,$(OS_TARGET))

cleanall: $(addsuffix _cleanall,$(OS_TARGET))

require: $(addsuffix _require,$(OS_TARGET))

.PHONY:  all debug examples test smart shared showinstall install sourceinstall exampleinstall zipinstall zipsourceinstall zipexampleinstall clean distclean cleanall require

#####################################################################
# Examples
#####################################################################

.PHONY: fpc_examples fpc_test

ifdef EXAMPLEOBJECTS
override EXAMPLESOURCEFILES:=$(addsuffix $(PASEXT),$(EXAMPLEOBJECTS))
override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(EXAMPLEOBJECTS))
override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(EXAMPLEOBJECTS)) $(addprefix $(LIBPREFIX),$(addsuffix $(STATICLIBEXT),$(EXAMPLEOBJECTS)))

override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
endif

fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(EXAMPLEDIROBJECTS))

fpc_test: examples

#####################################################################
# SourceInstall rules
#####################################################################

.PHONY: fpc_sourceinstall

ifndef SOURCETOPDIR
SOURCETOPDIR=$(BASEDIR)
endif

fpc_sourceinstall: clean
	$(MKDIR) $(SOURCEINSTALLDIR)
	$(COPYTREE) $(SOURCETOPDIR) $(SOURCEINSTALLDIR)

#####################################################################
# exampleinstall rules
#####################################################################

.PHONY: fpc_exampleinstall

fpc_exampleinstall: $(addsuffix _clean,$(EXAMPLEDIROBJECTS))
ifdef EXAMPLESOURCEFILES
	$(MKDIR) $(EXAMPLEINSTALLDIR)
	$(COPY) $(EXAMPLESOURCEFILES) $(EXAMPLEINSTALLDIR)
endif
ifdef EXAMPLEDIROBJECTS
ifndef EXAMPLESOURCEFILES
	$(MKDIR) $(EXAMPLEINSTALLDIR)
endif
	$(COPYTREE) $(addsuffix /*,$(EXAMPLEDIROBJECTS)) $(EXAMPLEINSTALLDIR)
endif

#####################################################################
# Zip
#####################################################################

.PHONY: fpc_zipinstall

# Create suffix to add
ifndef PACKAGESUFFIX
PACKAGESUFFIX=$(OS_TARGET)
ifeq ($(OS_TARGET),go32v2)
PACKAGESUFFIX=go32
endif
ifeq ($(OS_TARGET),win32)
PACKAGESUFFIX=w32
endif
endif

# Temporary path to pack a file
ifndef PACKDIR
ifndef inUnix
PACKDIR=$(BASEDIR)/pack_tmp
else
PACKDIR=/tmp/fpc-pack
endif
endif

# Maybe create default zipname from packagename
ifndef ZIPNAME
ifdef PACKAGENAME
ZIPNAME=$(PACKAGEPREFIX)$(PACKAGENAME)$(PACKAGESUFFIX)
endif
endif

# Use tar by default under linux
ifndef USEZIP
ifdef inUnix
USETAR=1
endif
endif

fpc_zipinstall:
ifndef ZIPNAME
	@$(ECHO) "Please specify ZIPNAME!"
	@exit 1
else
	$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
ifdef USETAR
	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT)
	cd $(PACKDIR) ; $(TARPROG) cf$(TAROPT) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR)
else
	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT)
	cd $(PACKDIR) ; $(ZIPPROG) -Dr $(ZIPOPT) $(DESTZIPDIR)/$(ZIPNAME)$(ZIPEXT) * ; cd $(BASEDIR)
endif
	$(DELTREE) $(PACKDIR)
endif

.PHONY:  fpc_zipsourceinstall

fpc_zipsourceinstall:
	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall PACKAGESUFFIX=src

.PHONY:  fpc_zipexampleinstall

fpc_zipexampleinstall:
	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall PACKAGESUFFIX=exm

#####################################################################
# Directories
#####################################################################

OBJECTDIRGO32V2=1
OBJECTDIRLINUX=1
OBJECTDIRWIN32=1
OBJECTDIROS2=1
OBJECTDIRFREEBSD=1

# Dir go32v2

ifdef OBJECTDIRGO32V2
.PHONY:  go32v2_all go32v2_debug go32v2_examples go32v2_test go32v2_smart go32v2_shared go32v2_showinstall go32v2_install go32v2_sourceinstall go32v2_exampleinstall go32v2_zipinstall go32v2_zipsourceinstall go32v2_zipexampleinstall go32v2_clean go32v2_distclean go32v2_cleanall go32v2_require go32v2_info

go32v2_all:
	$(MAKE) -C go32v2 all

go32v2_debug:
	$(MAKE) -C go32v2 debug

go32v2_examples:
	$(MAKE) -C go32v2 examples

go32v2_test:
	$(MAKE) -C go32v2 test

go32v2_smart:
	$(MAKE) -C go32v2 smart

go32v2_shared:
	$(MAKE) -C go32v2 shared

go32v2_showinstall:
	$(MAKE) -C go32v2 showinstall

go32v2_install:
	$(MAKE) -C go32v2 install

go32v2_sourceinstall:
	$(MAKE) -C go32v2 sourceinstall

go32v2_exampleinstall:
	$(MAKE) -C go32v2 exampleinstall

go32v2_zipinstall:
	$(MAKE) -C go32v2 zipinstall

go32v2_zipsourceinstall:
	$(MAKE) -C go32v2 zipsourceinstall

go32v2_zipexampleinstall:
	$(MAKE) -C go32v2 zipexampleinstall

go32v2_clean:
	$(MAKE) -C go32v2 clean

go32v2_distclean:
	$(MAKE) -C go32v2 distclean

go32v2_cleanall:
	$(MAKE) -C go32v2 cleanall

go32v2_require:
	$(MAKE) -C go32v2 require

go32v2_info:
	$(MAKE) -C go32v2 info
endif

# Dir linux

ifdef OBJECTDIRLINUX
.PHONY:  linux_all linux_debug linux_examples linux_test linux_smart linux_shared linux_showinstall linux_install linux_sourceinstall linux_exampleinstall linux_zipinstall linux_zipsourceinstall linux_zipexampleinstall linux_clean linux_distclean linux_cleanall linux_require linux_info

linux_all:
	$(MAKE) -C linux all

linux_debug:
	$(MAKE) -C linux debug

linux_examples:
	$(MAKE) -C linux examples

linux_test:
	$(MAKE) -C linux test

linux_smart:
	$(MAKE) -C linux smart

linux_shared:
	$(MAKE) -C linux shared

linux_showinstall:
	$(MAKE) -C linux showinstall

linux_install:
	$(MAKE) -C linux install

linux_sourceinstall:
	$(MAKE) -C linux sourceinstall

linux_exampleinstall:
	$(MAKE) -C linux exampleinstall

linux_zipinstall:
	$(MAKE) -C linux zipinstall

linux_zipsourceinstall:
	$(MAKE) -C linux zipsourceinstall

linux_zipexampleinstall:
	$(MAKE) -C linux zipexampleinstall

linux_clean:
	$(MAKE) -C linux clean

linux_distclean:
	$(MAKE) -C linux distclean

linux_cleanall:
	$(MAKE) -C linux cleanall

linux_require:
	$(MAKE) -C linux require

linux_info:
	$(MAKE) -C linux info
endif

# Dir win32

ifdef OBJECTDIRWIN32
.PHONY:  win32_all win32_debug win32_examples win32_test win32_smart win32_shared win32_showinstall win32_install win32_sourceinstall win32_exampleinstall win32_zipinstall win32_zipsourceinstall win32_zipexampleinstall win32_clean win32_distclean win32_cleanall win32_require win32_info

win32_all:
	$(MAKE) -C win32 all

win32_debug:
	$(MAKE) -C win32 debug

win32_examples:
	$(MAKE) -C win32 examples

win32_test:
	$(MAKE) -C win32 test

win32_smart:
	$(MAKE) -C win32 smart

win32_shared:
	$(MAKE) -C win32 shared

win32_showinstall:
	$(MAKE) -C win32 showinstall

win32_install:
	$(MAKE) -C win32 install

win32_sourceinstall:
	$(MAKE) -C win32 sourceinstall

win32_exampleinstall:
	$(MAKE) -C win32 exampleinstall

win32_zipinstall:
	$(MAKE) -C win32 zipinstall

win32_zipsourceinstall:
	$(MAKE) -C win32 zipsourceinstall

win32_zipexampleinstall:
	$(MAKE) -C win32 zipexampleinstall

win32_clean:
	$(MAKE) -C win32 clean

win32_distclean:
	$(MAKE) -C win32 distclean

win32_cleanall:
	$(MAKE) -C win32 cleanall

win32_require:
	$(MAKE) -C win32 require

win32_info:
	$(MAKE) -C win32 info
endif

# Dir os2

ifdef OBJECTDIROS2
.PHONY:  os2_all os2_debug os2_examples os2_test os2_smart os2_shared os2_showinstall os2_install os2_sourceinstall os2_exampleinstall os2_zipinstall os2_zipsourceinstall os2_zipexampleinstall os2_clean os2_distclean os2_cleanall os2_require os2_info

os2_all:
	$(MAKE) -C os2 all

os2_debug:
	$(MAKE) -C os2 debug

os2_examples:
	$(MAKE) -C os2 examples

os2_test:
	$(MAKE) -C os2 test

os2_smart:
	$(MAKE) -C os2 smart

os2_shared:
	$(MAKE) -C os2 shared

os2_showinstall:
	$(MAKE) -C os2 showinstall

os2_install:
	$(MAKE) -C os2 install

os2_sourceinstall:
	$(MAKE) -C os2 sourceinstall

os2_exampleinstall:
	$(MAKE) -C os2 exampleinstall

os2_zipinstall:
	$(MAKE) -C os2 zipinstall

os2_zipsourceinstall:
	$(MAKE) -C os2 zipsourceinstall

os2_zipexampleinstall:
	$(MAKE) -C os2 zipexampleinstall

os2_clean:
	$(MAKE) -C os2 clean

os2_distclean:
	$(MAKE) -C os2 distclean

os2_cleanall:
	$(MAKE) -C os2 cleanall

os2_require:
	$(MAKE) -C os2 require

os2_info:
	$(MAKE) -C os2 info
endif

# Dir freebsd

ifdef OBJECTDIRFREEBSD
.PHONY:  freebsd_all freebsd_debug freebsd_examples freebsd_test freebsd_smart freebsd_shared freebsd_showinstall freebsd_install freebsd_sourceinstall freebsd_exampleinstall freebsd_zipinstall freebsd_zipsourceinstall freebsd_zipexampleinstall freebsd_clean freebsd_distclean freebsd_cleanall freebsd_require freebsd_info

freebsd_all:
	$(MAKE) -C freebsd all

freebsd_debug:
	$(MAKE) -C freebsd debug

freebsd_examples:
	$(MAKE) -C freebsd examples

freebsd_test:
	$(MAKE) -C freebsd test

freebsd_smart:
	$(MAKE) -C freebsd smart

freebsd_shared:
	$(MAKE) -C freebsd shared

freebsd_showinstall:
	$(MAKE) -C freebsd showinstall

freebsd_install:
	$(MAKE) -C freebsd install

freebsd_sourceinstall:
	$(MAKE) -C freebsd sourceinstall

freebsd_exampleinstall:
	$(MAKE) -C freebsd exampleinstall

freebsd_zipinstall:
	$(MAKE) -C freebsd zipinstall

freebsd_zipsourceinstall:
	$(MAKE) -C freebsd zipsourceinstall

freebsd_zipexampleinstall:
	$(MAKE) -C freebsd zipexampleinstall

freebsd_clean:
	$(MAKE) -C freebsd clean

freebsd_distclean:
	$(MAKE) -C freebsd distclean

freebsd_cleanall:
	$(MAKE) -C freebsd cleanall

freebsd_require:
	$(MAKE) -C freebsd require

freebsd_info:
	$(MAKE) -C freebsd info
endif
EXAMPLEDIRTESTS=1
EXAMPLEDIRDB/TESTS=1
EXAMPLEDIRSHEDIT/GTK=1

# Dir tests

ifdef EXAMPLEDIRTESTS
.PHONY:  tests_all tests_debug tests_examples tests_test tests_smart tests_shared tests_showinstall tests_install tests_sourceinstall tests_exampleinstall tests_zipinstall tests_zipsourceinstall tests_zipexampleinstall tests_clean tests_distclean tests_cleanall tests_require tests_info

tests_all:
	$(MAKE) -C tests all

tests_debug:
	$(MAKE) -C tests debug

tests_examples:
	$(MAKE) -C tests examples

tests_test:
	$(MAKE) -C tests test

tests_smart:
	$(MAKE) -C tests smart

tests_shared:
	$(MAKE) -C tests shared

tests_showinstall:
	$(MAKE) -C tests showinstall

tests_install:
	$(MAKE) -C tests install

tests_sourceinstall:
	$(MAKE) -C tests sourceinstall

tests_exampleinstall:
	$(MAKE) -C tests exampleinstall

tests_zipinstall:
	$(MAKE) -C tests zipinstall

tests_zipsourceinstall:
	$(MAKE) -C tests zipsourceinstall

tests_zipexampleinstall:
	$(MAKE) -C tests zipexampleinstall

tests_clean:
	$(MAKE) -C tests clean

tests_distclean:
	$(MAKE) -C tests distclean

tests_cleanall:
	$(MAKE) -C tests cleanall

tests_require:
	$(MAKE) -C tests require

tests_info:
	$(MAKE) -C tests info
endif

# Dir db/tests

ifdef EXAMPLEDIRDB/TESTS
.PHONY:  db/tests_all db/tests_debug db/tests_examples db/tests_test db/tests_smart db/tests_shared db/tests_showinstall db/tests_install db/tests_sourceinstall db/tests_exampleinstall db/tests_zipinstall db/tests_zipsourceinstall db/tests_zipexampleinstall db/tests_clean db/tests_distclean db/tests_cleanall db/tests_require db/tests_info

db/tests_all:
	$(MAKE) -C db/tests all

db/tests_debug:
	$(MAKE) -C db/tests debug

db/tests_examples:
	$(MAKE) -C db/tests examples

db/tests_test:
	$(MAKE) -C db/tests test

db/tests_smart:
	$(MAKE) -C db/tests smart

db/tests_shared:
	$(MAKE) -C db/tests shared

db/tests_showinstall:
	$(MAKE) -C db/tests showinstall

db/tests_install:
	$(MAKE) -C db/tests install

db/tests_sourceinstall:
	$(MAKE) -C db/tests sourceinstall

db/tests_exampleinstall:
	$(MAKE) -C db/tests exampleinstall

db/tests_zipinstall:
	$(MAKE) -C db/tests zipinstall

db/tests_zipsourceinstall:
	$(MAKE) -C db/tests zipsourceinstall

db/tests_zipexampleinstall:
	$(MAKE) -C db/tests zipexampleinstall

db/tests_clean:
	$(MAKE) -C db/tests clean

db/tests_distclean:
	$(MAKE) -C db/tests distclean

db/tests_cleanall:
	$(MAKE) -C db/tests cleanall

db/tests_require:
	$(MAKE) -C db/tests require

db/tests_info:
	$(MAKE) -C db/tests info
endif

# Dir shedit/gtk

ifdef EXAMPLEDIRSHEDIT/GTK
.PHONY:  shedit/gtk_all shedit/gtk_debug shedit/gtk_examples shedit/gtk_test shedit/gtk_smart shedit/gtk_shared shedit/gtk_showinstall shedit/gtk_install shedit/gtk_sourceinstall shedit/gtk_exampleinstall shedit/gtk_zipinstall shedit/gtk_zipsourceinstall shedit/gtk_zipexampleinstall shedit/gtk_clean shedit/gtk_distclean shedit/gtk_cleanall shedit/gtk_require shedit/gtk_info

shedit/gtk_all:
	$(MAKE) -C shedit/gtk all

shedit/gtk_debug:
	$(MAKE) -C shedit/gtk debug

shedit/gtk_examples:
	$(MAKE) -C shedit/gtk examples

shedit/gtk_test:
	$(MAKE) -C shedit/gtk test

shedit/gtk_smart:
	$(MAKE) -C shedit/gtk smart

shedit/gtk_shared:
	$(MAKE) -C shedit/gtk shared

shedit/gtk_showinstall:
	$(MAKE) -C shedit/gtk showinstall

shedit/gtk_install:
	$(MAKE) -C shedit/gtk install

shedit/gtk_sourceinstall:
	$(MAKE) -C shedit/gtk sourceinstall

shedit/gtk_exampleinstall:
	$(MAKE) -C shedit/gtk exampleinstall

shedit/gtk_zipinstall:
	$(MAKE) -C shedit/gtk zipinstall

shedit/gtk_zipsourceinstall:
	$(MAKE) -C shedit/gtk zipsourceinstall

shedit/gtk_zipexampleinstall:
	$(MAKE) -C shedit/gtk zipexampleinstall

shedit/gtk_clean:
	$(MAKE) -C shedit/gtk clean

shedit/gtk_distclean:
	$(MAKE) -C shedit/gtk distclean

shedit/gtk_cleanall:
	$(MAKE) -C shedit/gtk cleanall

shedit/gtk_require:
	$(MAKE) -C shedit/gtk require

shedit/gtk_info:
	$(MAKE) -C shedit/gtk info
endif

#####################################################################
# Local Makefile
#####################################################################

ifneq ($(wildcard fpcmake.loc),)
include fpcmake.loc
endif

