* readded makefile

This commit is contained in:
peter 2000-12-18 18:05:52 +00:00
parent c6158587ef
commit e8a328c8c7

View File

@ -1,12 +1,12 @@
#
# Makefile generated by fpcmake v0.99.15 [2000/07/02]
# Makefile generated by fpcmake v1.00 [2000/10/27]
#
defaultrule: all
#####################################################################
# Autodetect OS (Linux or Dos or Windows NT)
# define inlinux when running under linux
# define inUnix when running under Unix (Linux,FreeBSD)
# define inWinNT when running under WinNT
#####################################################################
@ -23,22 +23,18 @@ nopwd:
@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
@exit
else
inlinux=1
inUnix=1
endif
else
PWD:=$(firstword $(PWD))
endif
# Detect NT - NT sets OS to Windows_NT
ifndef inlinux
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inUnix
ifeq ($(OS),Windows_NT)
inWinNT=1
endif
endif
# Detect OS/2 - OS/2 has OS2_SHELL defined
ifndef inlinux
ifndef inWinNT
else
ifdef OS2_SHELL
inOS2=1
endif
@ -46,14 +42,14 @@ endif
endif
# The extension of executables
ifdef inlinux
EXEEXT=
ifdef inUnix
SRCEXEEXT=
else
EXEEXT=.exe
SRCEXEEXT=.exe
endif
# The path which is searched separated by spaces
ifdef inlinux
ifdef inUnix
SEARCHPATH=$(subst :, ,$(PATH))
else
SEARCHPATH=$(subst ;, ,$(PATH))
@ -76,15 +72,11 @@ ifndef FPC
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)
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
# Target OS
ifndef OS_TARGET
@ -141,7 +133,7 @@ endif
# Detect FPCDIR
ifeq ($(FPCDIR),wrong)
ifdef inlinux
ifdef inUnix
override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
ifeq ($(wildcard $(FPCDIR)/units),)
override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
@ -235,7 +227,7 @@ INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall
ifndef ECHO
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(EXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=echo
ECHOE:=echo
@ -276,8 +268,8 @@ endif
# To install files
ifndef INSTALL
ifdef inlinux
INSTALL:=install -m 644
ifdef inUnix
INSTALL:=install -c -m 644
else
INSTALL:=$(COPY)
endif
@ -285,8 +277,8 @@ endif
# To install programs
ifndef INSTALLEXE
ifdef inlinux
INSTALLEXE:=install -m 755
ifdef inUnix
INSTALLEXE:=install -c -m 755
else
INSTALLEXE:=$(COPY)
endif
@ -294,7 +286,7 @@ endif
# To make a directory.
ifndef MKDIR
ifdef inlinux
ifdef inUnix
MKDIR:=install -m 755 -d
else
MKDIR:=ginstall -m 755 -d
@ -318,7 +310,7 @@ LD=ld
endif
# ppas.bat / ppas.sh
ifdef inlinux
ifdef inUnix
PPAS=ppas.sh
else
ifdef inOS2
@ -329,7 +321,7 @@ endif
endif
# ldconfig to rebuild .so cache
ifdef inlinux
ifdef inUnix
LDCONFIG=ldconfig
else
LDCONFIG=
@ -337,7 +329,7 @@ endif
# ppumove
ifndef PPUMOVE
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUMOVE),)
PPUMOVE=
else
@ -348,7 +340,7 @@ export PPUMOVE
# ppufiles
ifndef PPUFILES
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(PPUFILES),)
PPUFILES=
else
@ -367,7 +359,7 @@ ifeq ($(OS_TARGET),win32)
UPXPROG:=1
endif
ifdef UPXPROG
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(UPXPROG),)
UPXPROG=
else
@ -381,7 +373,7 @@ export UPXPROG
# ZipProg, you can't use Zip as the var name (PFV)
ifndef ZIPPROG
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ZIPPROG),)
ZIPPROG=
else
@ -395,7 +387,7 @@ ZIPEXT=.zip
# Tar
ifndef TARPROG
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(EXEEXT),$(SEARCHPATH))))
TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(TARPROG),)
TARPROG=
else
@ -418,6 +410,7 @@ endif
# Default needed extensions (Go32v2,Linux)
LOADEREXT=.as
EXEEXT=.exe
PPLEXT=.ppl
PPUEXT=.ppu
OEXT=.o
@ -446,9 +439,18 @@ endif
# Linux
ifeq ($(OS_TARGET),linux)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.lnx
endif
# Linux
ifeq ($(OS_TARGET),freebsd)
EXEEXT=
HASSHAREDLIB=1
FPCMADE=fpcmade.freebsd
endif
# Win32
ifeq ($(OS_TARGET),win32)
PPUEXT=.ppw
@ -643,9 +645,30 @@ 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 inlinux
ifdef UNIXINSTALLDIR
PREFIXINSTALLDIR=/usr
else
PREFIXINSTALLDIR=/pp
@ -665,7 +688,7 @@ export DESTZIPDIR
# set the base directory where to install everything
ifndef BASEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
else
BASEINSTALLDIR=$(PREFIXINSTALLDIR)
@ -674,7 +697,7 @@ endif
# set the directory where to install the binaries
ifndef BININSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
else
BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
@ -691,7 +714,7 @@ endif
# Where to install shared libraries
ifndef LIBINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
else
LIBINSTALLDIR=$(UNITINSTALLDIR)
@ -700,7 +723,7 @@ endif
# Where the source files will be stored
ifndef SOURCEINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
else
SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
@ -712,7 +735,7 @@ endif
# Where the doc files will be stored
ifndef DOCINSTALLDIR
ifdef inlinux
ifdef UNIXINSTALLDIR
DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc-$(FPC_VERSION)
else
DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
@ -722,7 +745,7 @@ 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 inlinux
ifdef UNIXINSTALLDIR
EXAMPLEINSTALLDIR=$(DOCINSTALLDIR)/examples
else
EXAMPLEINSTALLDIR=$(BASEINSTALLDIR)/examples
@ -746,7 +769,7 @@ REDIRFILE=log
endif
ifdef REDIR
ifndef inlinux
ifndef inUnix
override FPC=redir -eo $(FPC)
endif
# set the verbosity to max
@ -793,7 +816,7 @@ endif
# Debug
ifdef DEBUG
override FPCOPT+=-g -dDEBUG
override FPCOPT+=-gl -dDEBUG
endif
# Release mode (strip, optimize and don't load ppc386.cfg)
@ -833,9 +856,27 @@ ifdef UNITSDIR
override FPCOPT+=-Fu$(UNITSDIR)
endif
# Target dirs
# Target dirs and the prefix to use for clean/install
ifdef TARGETDIR
override FPCOPT+=-FE$(TARGETDIR)
ifeq ($(TARGETDIR),.)
override TARGETDIRPREFIX=
else
override TARGETDIRPREFIX=$(TARGETDIR)/
endif
endif
ifdef UNITTARGETDIR
override FPCOPT+=-FU$(UNITTARGETDIR)
ifeq ($(UNITTARGETDIR),.)
override UNITTARGETDIRPREFIX=
else
override UNITTARGETDIRPREFIX=$(TARGETDIR)/
endif
else
ifdef TARGETDIR
override UNITTARGETDIR=$(TARGETDIR)
override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
endif
endif
# Add commandline options last so they can override
@ -869,11 +910,14 @@ endif
override COMPILER:=$(FPC) $(FPCOPT)
# also call ppas if with command option -s
# but only if the OS_SOURCE and OS_TARGE are equal
ifeq (,$(findstring -s ,$(COMPILER)))
EXECPPAS=
else
ifeq ($(OS_SOURCE),$(OS_TARGET))
EXECPPAS:=@$(PPAS)
endif
endif
#####################################################################
# Standard rules
@ -919,11 +963,12 @@ info: fpc_info
ifdef EXEOBJECTS
override EXEFILES=$(addsuffix $(EXEEXT),$(EXEOBJECTS))
override EXEOFILES=$(addsuffix $(OEXT),$(EXEOBJECTS))
override EXEOFILES:=$(addsuffix $(OEXT),$(EXEOBJECTS)) $(addprefix $(LIBPREFIX),$(addsuffix $(STATICLIBEXT),$(EXEOBJECTS)))
override ALLTARGET+=fpc_exes
override INSTALLEXEFILES+=$(EXEFILES)
override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
endif
fpc_exes: $(EXEFILES)
@ -954,6 +999,11 @@ fpc_all: fpc_packages $(FPCMADE)
fpc_debug:
$(MAKE) all DEBUG=1
# Search paths for .ppu if targetdir is set
ifdef UNITTARGETDIR
vpath %$(PPUEXT) $(UNITTARGETDIR)
endif
# General compile rules, available for both possible PASEXT
.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
@ -995,7 +1045,7 @@ fpc_smart:
$(MAKE) all LINKSMART=1 CREATESMART=1
fpc_shared: all
ifdef inlinux
ifdef HASSHAREDLIB
ifndef LIBNAME
@$(ECHO) "LIBNAME not set"
else
@ -1016,11 +1066,17 @@ override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
endif
ifdef INSTALLPPUFILES
override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILES))
ifdef PPUFILES
INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
else
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))))
endif
override INSTALLPPULINKFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILES))
endif
ifdef INSTALLEXEFILES
override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(INSTALLEXEFILES))
endif
fpc_showinstall: $(SHOWINSTALLTARGET)
@ -1034,7 +1090,7 @@ ifneq ($(INSTALLPPULINKFILES),)
endif
ifneq ($(wildcard $(LIBFULLNAME)),)
@$(ECHO) $(LIBINSTALLDIR)/$(LIBFULLNAME)
ifdef inlinux
ifdef HASSHAREDLIB
@$(ECHO) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -1062,7 +1118,7 @@ endif
ifneq ($(wildcard $(LIBFULLNAME)),)
$(MKDIR) $(LIBINSTALLDIR)
$(INSTALL) $(LIBFULLNAME) $(LIBINSTALLDIR)
ifdef inlinux
ifdef inUnix
ln -sf $(LIBFULLNAME) $(LIBINSTALLDIR)/$(LIBNAME)
endif
endif
@ -1123,7 +1179,7 @@ endif
# Temporary path to pack a file
ifndef PACKDIR
ifndef inlinux
ifndef inUnix
PACKDIR=$(BASEDIR)/pack_tmp
else
PACKDIR=/tmp/fpc-pack
@ -1139,7 +1195,7 @@ endif
# Use tar by default under linux
ifndef USEZIP
ifdef inlinux
ifdef inUnix
USETAR=1
endif
endif
@ -1152,7 +1208,7 @@ else
$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
ifdef USETAR
$(DEL) $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT)
cd $(PACKDIR) ; $(TARPROG) c$(TAROPT) --file $(DESTZIPDIR)/$(ZIPNAME)$(TAREXT) * ; cd $(BASEDIR)
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)
@ -1176,16 +1232,23 @@ fpc_zipexampleinstall:
.PHONY: fpc_clean fpc_cleanall fpc_distclean
ifdef EXEFILES
override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
endif
ifdef EXTRACLEANUNITS
override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
endif
ifdef CLEANPPUFILES
override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
# Get the .o and .a files created for the units
ifdef PPUFILES
CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
else
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(LIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))))
endif
override CLEANPPULINKFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES))
endif
fpc_clean: $(CLEANTARGET)
@ -1199,7 +1262,7 @@ ifneq ($(CLEANPPULINKFILES),)
-$(DEL) $(CLEANPPULINKFILES)
endif
ifdef CLEANRSTFILES
-$(DEL) $(CLEANRSTFILES)
-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
endif
ifdef EXTRACLEANFILES
-$(DEL) $(EXTRACLEANFILES)
@ -1211,7 +1274,13 @@ endif
fpc_distclean: fpc_clean
fpc_cleanall: $(CLEANTARGET)
# Also run clean first if targetdir is set. Unittargetdir is always
# set if targetdir or unittargetdir is specified
ifdef UNITTARGETDIR
TARGETDIRCLEAN=fpc_clean
endif
fpc_cleanall: $(CLEANTARGET) $(TARGETDIRCLEAN)
ifdef CLEANEXEFILES
-$(DEL) $(CLEANEXEFILES)
endif