mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-14 11:46:00 +02:00
398 lines
7.6 KiB
Makefile
398 lines
7.6 KiB
Makefile
#
|
|
# Makefile generated by fpcmake v0.99.13 [2000/01/28]
|
|
#
|
|
|
|
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
|
|
else
|
|
FPC=ppc386
|
|
endif
|
|
endif
|
|
endif
|
|
override FPC:=$(subst $(EXEEXT),,$(FPC))
|
|
override FPC:=$(subst \,/,$(FPC))$(EXEEXT)
|
|
|
|
# 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 inlinux
|
|
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 fake text)
|
|
|
|
# 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
|
|
#####################################################################
|
|
|
|
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
|
|
#####################################################################
|
|
|
|
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))
|
|
|
|
distclean: $(addsuffix _distclean,$(DIROBJECTS))
|
|
|
|
cleanall: $(addsuffix _cleanall,$(DIROBJECTS))
|
|
|
|
require: $(addsuffix _require,$(DIROBJECTS))
|
|
|
|
.PHONY: debug examples test smart shared showinstall install sourceinstall clean distclean cleanall require
|
|
|
|
#####################################################################
|
|
# Directories
|
|
#####################################################################
|
|
|
|
OBJECTDIRFAKE=1
|
|
OBJECTDIRTEXT=1
|
|
|
|
# Dir fake
|
|
|
|
ifdef OBJECTDIRFAKE
|
|
.PHONY: fake_all fake_debug fake_examples fake_test fake_smart fake_shared fake_showinstall fake_install fake_sourceinstall fake_zipinstall fake_zipsourceinstall fake_clean fake_distclean fake_cleanall fake_require fake_info
|
|
|
|
fake_all:
|
|
$(MAKE) -C fake all
|
|
|
|
fake_debug:
|
|
$(MAKE) -C fake debug
|
|
|
|
fake_examples:
|
|
$(MAKE) -C fake examples
|
|
|
|
fake_test:
|
|
$(MAKE) -C fake test
|
|
|
|
fake_smart:
|
|
$(MAKE) -C fake smart
|
|
|
|
fake_shared:
|
|
$(MAKE) -C fake shared
|
|
|
|
fake_showinstall:
|
|
$(MAKE) -C fake showinstall
|
|
|
|
fake_install:
|
|
$(MAKE) -C fake install
|
|
|
|
fake_sourceinstall:
|
|
$(MAKE) -C fake sourceinstall
|
|
|
|
fake_zipinstall:
|
|
$(MAKE) -C fake zipinstall
|
|
|
|
fake_zipsourceinstall:
|
|
$(MAKE) -C fake zipsourceinstall
|
|
|
|
fake_clean:
|
|
$(MAKE) -C fake clean
|
|
|
|
fake_distclean:
|
|
$(MAKE) -C fake distclean
|
|
|
|
fake_cleanall:
|
|
$(MAKE) -C fake cleanall
|
|
|
|
fake_require:
|
|
$(MAKE) -C fake require
|
|
|
|
fake_info:
|
|
$(MAKE) -C fake info
|
|
endif
|
|
|
|
# Dir text
|
|
|
|
ifdef OBJECTDIRTEXT
|
|
.PHONY: text_all text_debug text_examples text_test text_smart text_shared text_showinstall text_install text_sourceinstall text_zipinstall text_zipsourceinstall text_clean text_distclean text_cleanall text_require text_info
|
|
|
|
text_all:
|
|
$(MAKE) -C text all
|
|
|
|
text_debug:
|
|
$(MAKE) -C text debug
|
|
|
|
text_examples:
|
|
$(MAKE) -C text examples
|
|
|
|
text_test:
|
|
$(MAKE) -C text test
|
|
|
|
text_smart:
|
|
$(MAKE) -C text smart
|
|
|
|
text_shared:
|
|
$(MAKE) -C text shared
|
|
|
|
text_showinstall:
|
|
$(MAKE) -C text showinstall
|
|
|
|
text_install:
|
|
$(MAKE) -C text install
|
|
|
|
text_sourceinstall:
|
|
$(MAKE) -C text sourceinstall
|
|
|
|
text_zipinstall:
|
|
$(MAKE) -C text zipinstall
|
|
|
|
text_zipsourceinstall:
|
|
$(MAKE) -C text zipsourceinstall
|
|
|
|
text_clean:
|
|
$(MAKE) -C text clean
|
|
|
|
text_distclean:
|
|
$(MAKE) -C text distclean
|
|
|
|
text_cleanall:
|
|
$(MAKE) -C text cleanall
|
|
|
|
text_require:
|
|
$(MAKE) -C text require
|
|
|
|
text_info:
|
|
$(MAKE) -C text info
|
|
endif
|
|
|
|
#####################################################################
|
|
# Local Makefile
|
|
#####################################################################
|
|
|
|
ifneq ($(wildcard fpcmake.loc),)
|
|
include fpcmake.loc
|
|
endif
|
|
|
|
#####################################################################
|
|
# Users rules
|
|
#####################################################################
|
|
|
|
.PHONY: gdb full fullgdb clean_compiler
|
|
|
|
all:
|
|
$(MAKE) -C text all
|
|
|
|
gdb:
|
|
$(MAKE) -C text all GDB=1
|
|
|
|
full:
|
|
$(MAKE) -C text all FULL=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
|
|
|
|
fullgdb:
|
|
$(MAKE) -C text all FULL=1 GDB=1 "NEEDOPT+=-Sg -dGDB -dBROWSERCOL"
|
|
|
|
#
|
|
# Misc
|
|
#
|
|
clean_compiler:
|
|
make -C ../../compiler clean
|