fpc/ide/fake/Makefile
2000-01-18 00:25:15 +00:00

353 lines
6.8 KiB
Makefile

#
# Makefile generated by fpcmake v0.99.13 [2000/01/17]
#
defaultrule: all
#####################################################################
# 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 searched separated by spaces
ifdef inlinux
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
ifdef inOS2
FPC=ppos2$(EXEEXT)
else
FPC=ppc386$(EXEEXT)
endif
endif
endif
override FPC:=$(subst \,/,$(FPC))
# 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),)
override FPCDIR=wrong
endif
else
override FPCDIR=wrong
endif
# Detect FPCDIR
ifeq ($(FPCDIR),wrong)
ifdef inlinux
override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
else
override FPCDIR:=$(subst /$(FPC)$(EXEEXT),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC)$(EXEEXT),$(SEARCHPATH))))))
endif
endif
#####################################################################
# User Settings
#####################################################################
# Targets
override DIROBJECTS+=$(wildcard compiler gdb)
# Clean
# Install
ZIPTARGET=install
# Defaults
# Directories
# Packages
# Libraries
#####################################################################
# Default Directories
#####################################################################
# set the prefix directory where to install everything
ifndef PREFIXINSTALLDIR
ifdef inlinux
PREFIXINSTALLDIR=/usr
else
PREFIXINSTALLDIR=/pp
endif
endif
export PREFIXINSTALLDIR
# Where to place the resulting zip files
ifndef DESTZIPDIR
DESTZIPDIR:=$(BASEDIR)
endif
export DESTZIPDIR
#####################################################################
# Redirection
#####################################################################
# Release ? Then force OPT and don't use extra opts via commandline
ifndef REDIRFILE
REDIRFILE=log
endif
ifdef REDIR
ifndef inlinux
override FPC=redir -eo $(FPC)
endif
# set the verbosity to max
override FPCOPT+=-va
override REDIR:= >> $(REDIRFILE)
endif
#####################################################################
# Standard rules
#####################################################################
all: $(addsuffix _all,$(DIROBJECTS))
debug: $(addsuffix _debug,$(DIROBJECTS))
examples: $(addsuffix _examples,$(DIROBJECTS))
test: $(addsuffix _test,$(DIROBJECTS))
smart: $(addsuffix _smart,$(DIROBJECTS))
shared: $(addsuffix _shared,$(DIROBJECTS))
showinstall: $(addsuffix _showinstall,$(DIROBJECTS))
install: $(addsuffix _install,$(DIROBJECTS))
sourceinstall: $(addsuffix _sourceinstall,$(DIROBJECTS))
clean: $(addsuffix _clean,$(DIROBJECTS))
cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
require: $(addsuffix _require,$(DIROBJECTS))
.PHONY: all debug examples test smart shared showinstall install sourceinstall clean cleanall require
#####################################################################
# Directories
#####################################################################
OBJECTDIRCOMPILER=1
OBJECTDIRGDB=1
# Dir compiler
ifdef OBJECTDIRCOMPILER
.PHONY: compiler_all compiler_debug compiler_examples compiler_test compiler_smart compiler_shared compiler_showinstall compiler_install compiler_sourceinstall compiler_zipinstall compiler_zipsourceinstall compiler_clean compiler_cleanall compiler_require compiler_info
compiler_all:
$(MAKE) -C compiler all
compiler_debug:
$(MAKE) -C compiler debug
compiler_examples:
$(MAKE) -C compiler examples
compiler_test:
$(MAKE) -C compiler test
compiler_smart:
$(MAKE) -C compiler smart
compiler_shared:
$(MAKE) -C compiler shared
compiler_showinstall:
$(MAKE) -C compiler showinstall
compiler_install:
$(MAKE) -C compiler install
compiler_sourceinstall:
$(MAKE) -C compiler sourceinstall
compiler_zipinstall:
$(MAKE) -C compiler zipinstall
compiler_zipsourceinstall:
$(MAKE) -C compiler zipsourceinstall
compiler_clean:
$(MAKE) -C compiler clean
compiler_cleanall:
$(MAKE) -C compiler cleanall
compiler_require:
$(MAKE) -C compiler require
compiler_info:
$(MAKE) -C compiler info
endif
# Dir gdb
ifdef OBJECTDIRGDB
.PHONY: gdb_all gdb_debug gdb_examples gdb_test gdb_smart gdb_shared gdb_showinstall gdb_install gdb_sourceinstall gdb_zipinstall gdb_zipsourceinstall gdb_clean gdb_cleanall gdb_require gdb_info
gdb_all:
$(MAKE) -C gdb all
gdb_debug:
$(MAKE) -C gdb debug
gdb_examples:
$(MAKE) -C gdb examples
gdb_test:
$(MAKE) -C gdb test
gdb_smart:
$(MAKE) -C gdb smart
gdb_shared:
$(MAKE) -C gdb shared
gdb_showinstall:
$(MAKE) -C gdb showinstall
gdb_install:
$(MAKE) -C gdb install
gdb_sourceinstall:
$(MAKE) -C gdb sourceinstall
gdb_zipinstall:
$(MAKE) -C gdb zipinstall
gdb_zipsourceinstall:
$(MAKE) -C gdb zipsourceinstall
gdb_clean:
$(MAKE) -C gdb clean
gdb_cleanall:
$(MAKE) -C gdb cleanall
gdb_require:
$(MAKE) -C gdb require
gdb_info:
$(MAKE) -C gdb info
endif
#####################################################################
# Local Makefile
#####################################################################
ifneq ($(wildcard fpcmake.loc),)
include fpcmake.loc
endif