fpc/rtl/Makefile
1999-11-14 15:54:21 +00:00

363 lines
7.0 KiB
Makefile

#
# Makefile generated by fpcmake v0.99.13 on 1999-11-14 16:40
#
defaultrule: native
#####################################################################
# Autodetect OS (Linux or Dos or Windows NT)
# define inlinux when running under linux
# define inWinNT when running under WinNT
#####################################################################
# We need only / in the path
override PATH:=$(subst \,/,$(PATH))
# Search for PWD and determine also if we are under linux
PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
ifeq ($(PWD),)
PWD:=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
ifeq ($(PWD),)
nopwd:
@echo You need the GNU utils package to use this Makefile!
@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
@exit
else
inlinux=1
endif
else
PWD:=$(firstword $(PWD))
endif
# Detect NT - NT sets OS to Windows_NT
ifndef inlinux
ifeq ($(OS),Windows_NT)
inWinNT=1
endif
endif
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inlinux
ifndef inWinNT
ifdef OS2_SHELL
inOS2=1
endif
endif
endif
# The extension of executables
ifdef inlinux
EXEEXT=
else
EXEEXT=.exe
endif
# The path which is search separated by spaces
ifdef inlinux
SEARCHPATH=$(subst :, ,$(PATH))
else
SEARCHPATH=$(subst ;, ,$(PATH))
endif
#####################################################################
# FPC version/target Detection
#####################################################################
# What compiler to use ?
ifndef FPC
ifdef inOS2
export FPC=ppos2$(EXEEXT)
else
export FPC=ppc386$(EXEEXT)
endif
endif
# Target OS
ifndef OS_TARGET
export OS_TARGET:=$(shell $(FPC) -iTO)
endif
# Source OS
ifndef OS_SOURCE
export OS_SOURCE:=$(shell $(FPC) -iSO)
endif
# Target CPU
ifndef CPU_TARGET
export CPU_TARGET:=$(shell $(FPC) -iTP)
endif
# Source CPU
ifndef CPU_SOURCE
export CPU_SOURCE:=$(shell $(FPC) -iSP)
endif
# FPC version
ifndef FPC_VERSION
export FPC_VERSION:=$(shell $(FPC) -iV)
endif
#####################################################################
# Default Settings
#####################################################################
# Release ? Then force OPT and don't use extra opts via commandline
ifdef RELEASE
override OPT:=-Xs -OG2p3 -n
endif
# Verbose settings (warning,note,info)
ifdef VERBOSE
override OPT+=-vwni
endif
#####################################################################
# User Settings
#####################################################################
# Pre Settings
# Set redir to YES if you want a log file to be kept.
ifndef REDIR
REDIR=NO
endif
# Set NODEBUG to YES if you DON'T want debugging
ifndef NODEBUG
NODEBUG=YES
endif
# Optional : Specify the place of the log file.
# default is 'log' in the source directory
ifndef REDIRFILE
REDIRFILE=
endif
# Optional: Error definitions file you want the compiler to use.
# !! If you specify a path, specify an absolute path. !!
ifndef ERRORFILE
ERRORFILE=
endif
#######################################################################
# Fix options
#######################################################################
# Check debugging.
ifneq ($(NODEBUG),YES)
override FPCOPT+=-g
endif
# Check error definitions file.
ifdef ERRORFILE
override FPCOPT+=-Fr$(ERRORFILE)
endif
# Check logfile.
ifeq ($(REDIR),YES)
ifndef inlinux
override FPC=redir -eo $(PP)
endif
# set the verbosity to max
override FPCOPT+=-va
ifdef REDIRFILE
override REDIR:= >> $(REDIRFILE)
else
override REDIR:= >> log
endif
else
override REDIR:=
endif
# Variables to export
export REDIR REDIRFILE ERRORFILE
# Targets
# Clean
# Install
# Defaults
# Directories
# Libraries
#####################################################################
# Default rules
#####################################################################
.PHONY: defaultrule all staticlib sharedlib showinstall install \
staticinstall sharedinstall libinstall zipinstall zipinstalladd \
clean cleanall depend info
all: fpc_all
staticlib: fpc_staticlib
sharedlib: fpc_sharedlib
showinstall: fpc_showinstall
staticinstall: fpc_staticinstall
sharedinstall: fpc_sharedinstall
zipinstall: fpc_zipinstall
zipinstalladd: fpc_zipinstalladd
clean_all: fpc_clean_all
depend: fpc_depend
info: fpc_info
#####################################################################
# Users rules
#####################################################################
############################################################################
# RTLs
############################################################################
.PHONY: native rtls rtlgo32v1 rtlgo32v2 rtllinux rtlos2 rtlwin32 rtlamiga
native: rtl$(OS_SOURCE)
rtls: rtlgo32v1 rtlgo32v2 rtllinux rtlos2 rtlwin32
rtlgo32v1:
$(MAKE) -C go32v1
rtlgo32v2:
$(MAKE) -C go32v2
rtllinux:
$(MAKE) -C linux
rtlos2:
$(MAKE) -C os2
rtlwin32:
$(MAKE) -C win32
rtlamiga:
$(MAKE) -C amiga
############################################################################
# Libs
############################################################################
.PHONY: nativelibs libs libgo32v1 libgo32v2 liblinux libos2 libwin32
nativelibs : $(OS_SOURCE)libs
libs: go32v1libs go32v2libs linuxlibs os2libs win32libs
go32v1libs:
$(MAKE) -C go32v1 libs
go32v2libs:
$(MAKE) -C go32v2 libs
linuxlibs:
$(MAKE) -C linux libs
os2libs:
$(MAKE) -C os2 libs
win32libs:
$(MAKE) -C win32 libs
############################################################################
# Install
############################################################################
.PHONY: install native_install install_go32v1 install_go32v2 install_linux \
install_os2 install_win32
install: install_linux install_go32v1 install_go32v2 install_os2 install_win32
native_install: install_$(OS_SOURCE)
install_go32v1:
$(MAKE) -C go32v1 install
install_go32v2:
$(MAKE) -C go32v2 install
install_linux:
$(MAKE) -C linux install
install_os2:
$(MAKE) -C os2 install
install_win32:
$(MAKE) -C win32 install
############################################################################
# LibInstall
############################################################################
.PHONY: native_libinstall libinstall libinstall_go32v1 libinstall_go32v2 \
libinstall_linux libinstall_os2 libinstall_win32
libinstall: libinstall_linux libinstall_go32v1 libinstall_go32v2 \
libinstall_os2 libinstall_win32
native_libinstall: libinstall_$(OS_SOURCE)
libinstall_go32v1:
$(MAKE) -C go32v1 libinstall
libinstall_go32v2:
$(MAKE) -C go32v2 libinstall
libinstall_linux:
$(MAKE) -C linux libinstall
libinstall_os2:
$(MAKE) -C os2 libinstall
libinstall_win32:
$(MAKE) -C win32 libinstall
############################################################################
# Clean
############################################################################
.PHONY: clean native_clean clean_go32v1 clean_go32v2 clean_linux \
clean_os2 clean_win32
clean: clean_linux clean_go32v1 clean_go32v2 clean_os2 clean_win32
native_clean: clean_$(OS_SOURCE)
clean_go32v1:
$(MAKE) -C go32v1 clean
clean_go32v2:
$(MAKE) -C go32v2 clean
clean_linux:
$(MAKE) -C linux clean
clean_os2:
$(MAKE) -C os2 clean
clean_win32:
$(MAKE) -C win32 clean