|
@@ -1,22 +1,26 @@
|
|
-#****************************************************************************
|
|
|
|
#
|
|
#
|
|
-# Copyright (c) 1993,95 by Florian Klaempfl
|
|
|
|
-# Modified and enhanced for GNU make by
|
|
|
|
-# M. Van Canneyt and P. Muller
|
|
|
|
-#****************************************************************************
|
|
|
|
|
|
+# $Id$
|
|
|
|
+# This file is part of the Free Pascal run time library.
|
|
|
|
+# Copyright (c) 1993-98 by the Free Pascal Development Team
|
|
|
|
+#
|
|
|
|
+# Makefile for the Free Pascal Compiler
|
|
|
|
+#
|
|
|
|
+# See the file COPYING.FPC, included in this distribution,
|
|
|
|
+# for details about the copyright.
|
|
|
|
+#
|
|
|
|
+# This program is distributed in the hope that it will be useful,
|
|
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
#
|
|
#
|
|
-# The parameters are set in the main makefile.
|
|
|
|
-# here we specify the defaults.
|
|
|
|
-
|
|
|
|
-#############################
|
|
|
|
-# When compiling the compiler
|
|
|
|
-#############################
|
|
|
|
|
|
|
|
|
|
+#####################################################################
|
|
# Try to determine Operating System
|
|
# Try to determine Operating System
|
|
|
|
+#####################################################################
|
|
|
|
+
|
|
|
|
+BASEDIR=$(shell pwd)
|
|
|
|
|
|
-BASEDIR:=$(shell pwd)
|
|
|
|
# in linux no : in pathes
|
|
# in linux no : in pathes
|
|
-ifeq ($(findstring, ':', $(BASEDIR)),)
|
|
|
|
|
|
+ifeq ($(findstring :,$(BASEDIR)),)
|
|
inlinux=1
|
|
inlinux=1
|
|
endif
|
|
endif
|
|
|
|
|
|
@@ -31,6 +35,10 @@ ifndef PP
|
|
PP=ppc386
|
|
PP=ppc386
|
|
endif
|
|
endif
|
|
|
|
|
|
|
|
+#####################################################################
|
|
|
|
+# Setup Targets
|
|
|
|
+#####################################################################
|
|
|
|
+
|
|
# what target do we use
|
|
# what target do we use
|
|
# currently dos go32v2 os2 and linux are available
|
|
# currently dos go32v2 os2 and linux are available
|
|
ifdef inlinux
|
|
ifdef inlinux
|
|
@@ -39,30 +47,34 @@ else
|
|
TARGET=go32v2
|
|
TARGET=go32v2
|
|
endif
|
|
endif
|
|
|
|
|
|
-COMPILERDIR=$(BASEDIR)
|
|
|
|
-
|
|
|
|
-# What extra options to give to compiler ?
|
|
|
|
-# (Minimum options are added by the makefile itself)
|
|
|
|
-ifndef OPT
|
|
|
|
-# OPT= -g
|
|
|
|
-# for aout
|
|
|
|
-# OPT= -e/usr/i486-linuxaout/bin -a -Sg -OGa -g -q+ -w- -Up$(UNITDIR)
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
# What processor do you want to compile for : i386 m68k (case sensitive !!)
|
|
# What processor do you want to compile for : i386 m68k (case sensitive !!)
|
|
ifndef CPU
|
|
ifndef CPU
|
|
CPU= i386
|
|
CPU= i386
|
|
# CPU= m68k
|
|
# CPU= m68k
|
|
endif
|
|
endif
|
|
|
|
|
|
|
|
+#####################################################################
|
|
|
|
+# Setup Files Directories
|
|
|
|
+#####################################################################
|
|
|
|
+
|
|
|
|
+# Set os-dependent files and extensions
|
|
|
|
+ifdef inlinux
|
|
|
|
+EXEEXT=
|
|
|
|
+REPLACE=mv -f
|
|
|
|
+CP=cp -f
|
|
|
|
+else
|
|
|
|
+EXEEXT=.exe
|
|
|
|
+REPLACE=move /y
|
|
|
|
+CP=cp -f
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+COMPILERDIR=$(BASEDIR)
|
|
RTLDIR:=$(BASEDIR)/../rtl
|
|
RTLDIR:=$(BASEDIR)/../rtl
|
|
|
|
|
|
# specify where units are.
|
|
# specify where units are.
|
|
# This needs to be set correctly for the 'remake' target to work !
|
|
# This needs to be set correctly for the 'remake' target to work !
|
|
ifndef UNITDIR
|
|
ifndef UNITDIR
|
|
UNITDIR=$(RTLDIR)/$(TARGET)
|
|
UNITDIR=$(RTLDIR)/$(TARGET)
|
|
-#UNITDIR=/usr/lib/ppc/0.99.0/linuxunits
|
|
|
|
-# dos and go32v2 are special
|
|
|
|
ifeq ($(TARGET),dos)
|
|
ifeq ($(TARGET),dos)
|
|
UNITDIR=$(RTLDIR)/dos/go32v1
|
|
UNITDIR=$(RTLDIR)/dos/go32v1
|
|
endif
|
|
endif
|
|
@@ -75,17 +87,35 @@ endif
|
|
# Where to install the executable program/link
|
|
# Where to install the executable program/link
|
|
ifndef PROGINSTALLDIR
|
|
ifndef PROGINSTALLDIR
|
|
ifdef inlinux
|
|
ifdef inlinux
|
|
-PROGINSTALLDIR = /usr/local/bin
|
|
|
|
|
|
+PROGINSTALLDIR = /usr/bin
|
|
else
|
|
else
|
|
PROGINSTALLDIR = c:\pp\bin
|
|
PROGINSTALLDIR = c:\pp\bin
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
|
|
-# Linux only : Where to install the _real_executable.
|
|
|
|
|
|
+# !!! Linux only
|
|
|
|
+# Where to install the _real_executable and support files
|
|
ifndef LIBINSTALLDIR
|
|
ifndef LIBINSTALLDIR
|
|
-LIBINSTALLDIR = /usr/lib/ppc/0.99.0
|
|
|
|
-# for aout system
|
|
|
|
-# LIBINSTALLDIR = /usr/lib/ppc/aout/0.9.1
|
|
|
|
|
|
+ifdef inlinux
|
|
|
|
+LIBINSTALLDIR=/usr/lib/fpc/0.99.0
|
|
|
|
+# for a.out
|
|
|
|
+# LIBINSTALLDIR=/usr/lib/ppc/aout/0.99.0
|
|
|
|
+else
|
|
|
|
+LIBINSTALLDIR=$(PROGINSTALLDIR)
|
|
|
|
+endif
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+# Where the .msg files will be stored
|
|
|
|
+ifndef MSGINSTALLDIR
|
|
|
|
+MSGINSTALLDIR=$(LIBINSTALLDIR)/msg
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+ifndef UNITINSTALLDIR
|
|
|
|
+ifdef inlinux
|
|
|
|
+UNITINSTALLDIR=$(LIBINSTALLDIR)/linuxunits
|
|
|
|
+else
|
|
|
|
+UNITINSTALLDIR=$(UNITDIR)
|
|
|
|
+endif
|
|
endif
|
|
endif
|
|
|
|
|
|
# !!! Linux only
|
|
# !!! Linux only
|
|
@@ -94,9 +124,9 @@ ifndef GCCLIBPATH
|
|
GCCLIBPATH=/usr/lib/gcc-lib/i486-linux/2.6.3
|
|
GCCLIBPATH=/usr/lib/gcc-lib/i486-linux/2.6.3
|
|
endif
|
|
endif
|
|
|
|
|
|
-##################################
|
|
|
|
|
|
+#####################################################################
|
|
# When making diffs of the sources
|
|
# When making diffs of the sources
|
|
-##################################
|
|
|
|
|
|
+#####################################################################
|
|
|
|
|
|
# Diff program
|
|
# Diff program
|
|
DIFF = diff
|
|
DIFF = diff
|
|
@@ -125,90 +155,98 @@ endif
|
|
# End of configurable section. Do not edit after this line.
|
|
# End of configurable section. Do not edit after this line.
|
|
#####################################################################
|
|
#####################################################################
|
|
|
|
|
|
-# correct options with needed stuff
|
|
|
|
-PPOPTS:=$(OPT) -d$(CPU) -dGDB -dFPC -Sg
|
|
|
|
|
|
+# set correct defines (also needed by mkdep)
|
|
|
|
+PPDEFS:=-d$(CPU) -dGDB -dFPC
|
|
|
|
|
|
|
|
+# Set the needed compiler options
|
|
|
|
+PPOPTS:=$(OPT) $(PPDEFS) -Sg
|
|
|
|
+
|
|
|
|
+# Unitdir specified ?
|
|
ifneq ("$(UNITDIR)", "")
|
|
ifneq ("$(UNITDIR)", "")
|
|
PPOPTS:=$(PPOPTS) -Up$(UNITDIR)
|
|
PPOPTS:=$(PPOPTS) -Up$(UNITDIR)
|
|
endif
|
|
endif
|
|
|
|
|
|
-COMPILER = $(PP) $(PPOPTS)
|
|
|
|
-
|
|
|
|
# Do we need the GCC library ?
|
|
# Do we need the GCC library ?
|
|
ifeq ($(LINK_TO_C),YES)
|
|
ifeq ($(LINK_TO_C),YES)
|
|
-COMPILER:=$(COMPILER) -Fg$(GCCLIBPATH)
|
|
|
|
|
|
+PPOPTS:=$(PPOPTS) -Fg$(GCCLIBPATH)
|
|
endif
|
|
endif
|
|
|
|
|
|
-.SUFFIXES: .pas .exe .ppu .dif .d3p .d3i .d3m .new
|
|
|
|
|
|
+# Create the whole compiler commandline
|
|
|
|
+COMPILER=$(PP) $(PPOPTS)
|
|
|
|
|
|
-.PHONY : diff diff3 patch clean rtl toflor \
|
|
|
|
- test rtlzip remake3 remake cycle \
|
|
|
|
- info replacediff3 restorediff3
|
|
|
|
|
|
+#####################################################################
|
|
|
|
+# Setup os-independent filenames
|
|
|
|
+#####################################################################
|
|
|
|
|
|
|
|
+PPEXENAME=pp$(EXEEXT)
|
|
|
|
+EXENAME=ppc386$(EXEEXT)
|
|
|
|
+TEMPNAME=ppc$(EXEEXT)
|
|
|
|
+TEMPNAME1=ppc1$(EXEEXT)
|
|
|
|
+TEMPNAME2=ppc2$(EXEEXT)
|
|
|
|
+TEMPNAME3=ppc3$(EXEEXT)
|
|
|
|
+MAKEDEP=mkdep$(EXEEXT)
|
|
|
|
|
|
-.pas.ppu:
|
|
|
|
- $(COMPILER) $<
|
|
|
|
|
|
+PASFILES:=$(shell ls *.pas)
|
|
|
|
+INCFILES:=$(shell ls *.inc)
|
|
|
|
+MSGFILES:=$(shell ls *.msg)
|
|
|
|
|
|
-.pas.exe:
|
|
|
|
- $(COMPILER) $<
|
|
|
|
|
|
+#####################################################################
|
|
|
|
+# Default makefile
|
|
|
|
+#####################################################################
|
|
|
|
|
|
-.pas:
|
|
|
|
- $(COMPILER) $<
|
|
|
|
|
|
+.SUFFIXES: .pas $(EXEEXT) .ppu .dif .d3p .d3i .d3m .new
|
|
|
|
|
|
-#
|
|
|
|
-# Default target makes the compiler.
|
|
|
|
-#
|
|
|
|
|
|
+.PHONY : all clean info \
|
|
|
|
+ cycle remake remake3 \
|
|
|
|
+ install \
|
|
|
|
+ diff diff3 patch rtl toflor replacediff3 restorediff3 \
|
|
|
|
+ test rtlzip \
|
|
|
|
|
|
-ifeq ($(TARGET),linux)
|
|
|
|
-PPEXENAME=pp
|
|
|
|
-EXENAME=ppc386
|
|
|
|
-TEMPNAME=ppc
|
|
|
|
-TEMPNAME1=ppc1
|
|
|
|
-TEMPNAME2=ppc2
|
|
|
|
-TEMPNAME3=ppc3
|
|
|
|
-MAKEDEP=mkdep
|
|
|
|
-REPLACE=mv -f
|
|
|
|
-else
|
|
|
|
-PPEXENAME=pp.exe
|
|
|
|
-EXENAME=ppc386.exe
|
|
|
|
-TEMPNAME=ppc.exe
|
|
|
|
-TEMPNAME1=ppc1.exe
|
|
|
|
-TEMPNAME2=ppc2.exe
|
|
|
|
-TEMPNAME3=ppc3.exe
|
|
|
|
-MAKEDEP=mkdep.exe
|
|
|
|
-# DJGPP mv -f make problems under dos !!
|
|
|
|
-REPLACE=move /y
|
|
|
|
-endif
|
|
|
|
-CP=cp -f
|
|
|
|
|
|
+.pas.ppu:
|
|
|
|
+ $(COMPILER) $<
|
|
|
|
|
|
-all : $(EXENAME)
|
|
|
|
|
|
+.pas$(EXEEXT):
|
|
|
|
+ $(COMPILER) $<
|
|
|
|
|
|
-PASFILES:=$(shell ls *.pas)
|
|
|
|
|
|
+all : $(EXENAME)
|
|
|
|
|
|
-INCFILES:=$(shell ls *.inc)
|
|
|
|
|
|
+clean :
|
|
|
|
+ -rm -f *.o *.ppu *.s $(EXENAME)
|
|
|
|
|
|
-MSGFILES:=$(shell ls *.msg)
|
|
|
|
|
|
+#####################################################################
|
|
|
|
+# Info
|
|
|
|
+#####################################################################
|
|
|
|
|
|
info :
|
|
info :
|
|
- @echo Target is $(TARGET)
|
|
|
|
- @echo basedir is $(BASEDIR)
|
|
|
|
- @echo Pascal files are $(PASFILES)
|
|
|
|
- @echo Inc files are $(INCFILES)
|
|
|
|
- @echo Msg files are $(MSGFILES)
|
|
|
|
|
|
+ @echo - Target is $(TARGET)
|
|
|
|
+ @echo - Basedir is $(BASEDIR)
|
|
|
|
+ @echo - Pascal files are $(PASFILES)
|
|
|
|
+ @echo - Inc files are $(INCFILES)
|
|
|
|
+ @echo - Msg files are $(MSGFILES)
|
|
|
|
|
|
-ifdef inlinux
|
|
|
|
|
|
+#####################################################################
|
|
|
|
+# Include depencies (linux only)
|
|
|
|
+#####################################################################
|
|
|
|
+
|
|
|
|
+ifdef inlinux
|
|
$(MAKEDEP) : $(RTLDIR)/utils/mkdep.pp
|
|
$(MAKEDEP) : $(RTLDIR)/utils/mkdep.pp
|
|
$(PP) $(RTLDIR)/utils/mkdep.pp
|
|
$(PP) $(RTLDIR)/utils/mkdep.pp
|
|
$(CP) $(RTLDIR)/utils/$(MAKEDEP) $(MAKEDEP)
|
|
$(CP) $(RTLDIR)/utils/$(MAKEDEP) $(MAKEDEP)
|
|
|
|
|
|
dependencies : $(MAKEDEP)
|
|
dependencies : $(MAKEDEP)
|
|
- $(MAKEDEP) pp.pas $(PPOPTS) > depend
|
|
|
|
|
|
+ $(MAKEDEP) pp.pas $(PPDEFS) '-A$$(COMPILER)' > depend
|
|
|
|
|
|
include depend
|
|
include depend
|
|
endif
|
|
endif
|
|
|
|
|
|
|
|
+#####################################################################
|
|
|
|
+# Make targets
|
|
|
|
+#####################################################################
|
|
|
|
+
|
|
|
|
+# Make only the compiler
|
|
ifdef inlinux
|
|
ifdef inlinux
|
|
$(EXENAME) : $(PPEXENAME)
|
|
$(EXENAME) : $(PPEXENAME)
|
|
|
|
+ $(COMPILER) pp.pas
|
|
$(REPLACE) $(PPEXENAME) $(EXENAME)
|
|
$(REPLACE) $(PPEXENAME) $(EXENAME)
|
|
else
|
|
else
|
|
$(EXENAME) : $(PASFILES) $(INCFILES) $(MSGFILES)
|
|
$(EXENAME) : $(PASFILES) $(INCFILES) $(MSGFILES)
|
|
@@ -216,9 +254,7 @@ $(EXENAME) : $(PASFILES) $(INCFILES) $(MSGFILES)
|
|
$(REPLACE) $(PPEXENAME) $(EXENAME)
|
|
$(REPLACE) $(PPEXENAME) $(EXENAME)
|
|
endif
|
|
endif
|
|
|
|
|
|
-#
|
|
|
|
# This target remakes the units with the currently made version
|
|
# This target remakes the units with the currently made version
|
|
-#
|
|
|
|
remake: $(EXENAME)
|
|
remake: $(EXENAME)
|
|
$(REPLACE) $(EXENAME) $(TEMPNAME)
|
|
$(REPLACE) $(EXENAME) $(TEMPNAME)
|
|
$(MAKE) clean
|
|
$(MAKE) clean
|
|
@@ -254,31 +290,27 @@ cycle:
|
|
$(MAKE) clean
|
|
$(MAKE) clean
|
|
$(MAKE) -C $(UNITDIR) clean
|
|
$(MAKE) -C $(UNITDIR) clean
|
|
$(MAKE) -C $(UNITDIR)
|
|
$(MAKE) -C $(UNITDIR)
|
|
- $(MAKE) remake3
|
|
|
|
|
|
+ $(MAKE) remake
|
|
|
|
|
|
-install : all
|
|
|
|
|
|
+#####################################################################
|
|
|
|
+# Installation
|
|
|
|
+#####################################################################
|
|
|
|
+
|
|
|
|
+install:
|
|
|
|
+ umask 022
|
|
|
|
+ strip ppc386
|
|
install -m 755 -d $(LIBINSTALLDIR)
|
|
install -m 755 -d $(LIBINSTALLDIR)
|
|
install -m 755 ppc386 $(LIBINSTALLDIR)
|
|
install -m 755 ppc386 $(LIBINSTALLDIR)
|
|
ln -sf $(LIBINSTALLDIR)/ppc386 $(PROGINSTALLDIR)/ppc386
|
|
ln -sf $(LIBINSTALLDIR)/ppc386 $(PROGINSTALLDIR)/ppc386
|
|
- makecfg $(LIBINSTALLDIR) $(GCCLIBPATH)
|
|
|
|
- install -m 644 ppc386.cfg /etc
|
|
|
|
- install -m 644 errorE.msg $(LIBINSTALLDIR)
|
|
|
|
- @echo Wrote sample configuration file to /etc
|
|
|
|
|
|
+ makecfg $(LIBINSTALLDIR)/samplecfg $(UNITINSTALLDIR) $(MSGINSTALLDIR) $(GCCLIBPATH)
|
|
|
|
+ install -m 755 -d $(MSGINSTALLDIR)
|
|
|
|
+ install -m 644 errore.msg $(MSGINSTALLDIR)
|
|
|
|
+ install -m 644 errorn.msg $(MSGINSTALLDIR)
|
|
|
|
|
|
-clean :
|
|
|
|
-ifdef inlinux
|
|
|
|
- -rm -f *.o *.ppu *.s $(EXENAME) ppc386.cfg
|
|
|
|
-else
|
|
|
|
- -rm -f *.o *.ppu *.s $(EXENAME)
|
|
|
|
-endif
|
|
|
|
-
|
|
|
|
-dist :
|
|
|
|
- mkdir $(DISTDIR)/compiler
|
|
|
|
- cp *.pas *.inc makecfg Makefile depend errorE.msg $(DISTDIR)/compiler
|
|
|
|
|
|
+#####################################################################
|
|
|
|
+# Diffs
|
|
|
|
+#####################################################################
|
|
|
|
|
|
-#
|
|
|
|
-# Utilities for making archives.
|
|
|
|
-#
|
|
|
|
SOURCEFILES = $(PASFILES) $(INCFILES) $(MSGFILES) Makefile
|
|
SOURCEFILES = $(PASFILES) $(INCFILES) $(MSGFILES) Makefile
|
|
|
|
|
|
DIFFFILES = $(patsubst %.pas,%.dif,$(PASFILES)) \
|
|
DIFFFILES = $(patsubst %.pas,%.dif,$(PASFILES)) \
|
|
@@ -350,8 +382,8 @@ replacediff3 : diff3
|
|
copy /y *.d3m *.msg
|
|
copy /y *.d3m *.msg
|
|
copy /y Makefile.di3 Makefile
|
|
copy /y Makefile.di3 Makefile
|
|
|
|
|
|
-restorediff3 :
|
|
|
|
- copy /y *.bkp *.pas
|
|
|
|
|
|
+restorediff3 :
|
|
|
|
+ copy /y *.bkp *.pas
|
|
copy /y *.bki *.inc
|
|
copy /y *.bki *.inc
|
|
copy /y *.bkm *.msg
|
|
copy /y *.bkm *.msg
|
|
copy /y Makefile.old Makefile
|
|
copy /y Makefile.old Makefile
|
|
@@ -411,6 +443,14 @@ toflor : diff
|
|
src_comp.zip : $(SOURCEFILES)
|
|
src_comp.zip : $(SOURCEFILES)
|
|
$(ZIP) -u src_comp $(SOURCEFILES)
|
|
$(ZIP) -u src_comp $(SOURCEFILES)
|
|
|
|
|
|
|
|
+#####################################################################
|
|
|
|
+# Distribution
|
|
|
|
+#####################################################################
|
|
|
|
+
|
|
|
|
+dist :
|
|
|
|
+ mkdir $(DISTDIR)/compiler
|
|
|
|
+ cp *.pas *.inc makecfg Makefile depend errorE.msg $(DISTDIR)/compiler
|
|
|
|
+
|
|
#################################################
|
|
#################################################
|
|
# Obsolete
|
|
# Obsolete
|
|
# does not contains all directories
|
|
# does not contains all directories
|
|
@@ -479,4 +519,3 @@ rtlzip :
|
|
cd ..
|
|
cd ..
|
|
$(ZIP) -u rtl @rtl.cfg
|
|
$(ZIP) -u rtl @rtl.cfg
|
|
$(UNZIP) -v rtl >rtl.lst
|
|
$(UNZIP) -v rtl >rtl.lst
|
|
-cycle: clean
|
|
|