* fixed install

This commit is contained in:
peter 1998-03-28 23:53:13 +00:00
parent 4a47440c82
commit f7fb63a580

View File

@ -1,22 +1,26 @@
#****************************************************************************
# #
# Copyright (c) 1993,95 by Florian Klaempfl # $Id$
# Modified and enhanced for GNU make by # This file is part of the Free Pascal run time library.
# M. Van Canneyt and P. Muller # 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 ifdef inlinux
# for aout system LIBINSTALLDIR=/usr/lib/fpc/0.99.0
# LIBINSTALLDIR = /usr/lib/ppc/aout/0.9.1 # 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,76 +155,78 @@ 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 # set correct defines (also needed by mkdep)
PPOPTS:=$(OPT) -d$(CPU) -dGDB -dFPC -Sg 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 \ # Setup os-independent filenames
info replacediff3 restorediff3 #####################################################################
PPEXENAME=pp$(EXEEXT)
EXENAME=ppc386$(EXEEXT)
TEMPNAME=ppc$(EXEEXT)
TEMPNAME1=ppc1$(EXEEXT)
TEMPNAME2=ppc2$(EXEEXT)
TEMPNAME3=ppc3$(EXEEXT)
MAKEDEP=mkdep$(EXEEXT)
PASFILES:=$(shell ls *.pas)
INCFILES:=$(shell ls *.inc)
MSGFILES:=$(shell ls *.msg)
#####################################################################
# Default makefile
#####################################################################
.SUFFIXES: .pas $(EXEEXT) .ppu .dif .d3p .d3i .d3m .new
.PHONY : all clean info \
cycle remake remake3 \
install \
diff diff3 patch rtl toflor replacediff3 restorediff3 \
test rtlzip \
.pas.ppu: .pas.ppu:
$(COMPILER) $< $(COMPILER) $<
.pas.exe: .pas$(EXEEXT):
$(COMPILER) $< $(COMPILER) $<
.pas:
$(COMPILER) $<
#
# Default target makes the compiler.
#
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
all : $(EXENAME) all : $(EXENAME)
PASFILES:=$(shell ls *.pas) clean :
-rm -f *.o *.ppu *.s $(EXENAME)
INCFILES:=$(shell ls *.inc) #####################################################################
# Info
MSGFILES:=$(shell ls *.msg) #####################################################################
info : info :
@echo Target is $(TARGET) @echo - Target is $(TARGET)
@echo basedir is $(BASEDIR) @echo - Basedir is $(BASEDIR)
@echo Pascal files are $(PASFILES) @echo - Pascal files are $(PASFILES)
@echo Inc files are $(INCFILES) @echo - Inc files are $(INCFILES)
@echo Msg files are $(MSGFILES) @echo - Msg files are $(MSGFILES)
#####################################################################
# Include depencies (linux only)
#####################################################################
ifdef inlinux ifdef inlinux
$(MAKEDEP) : $(RTLDIR)/utils/mkdep.pp $(MAKEDEP) : $(RTLDIR)/utils/mkdep.pp
@ -202,13 +234,19 @@ $(MAKEDEP) : $(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) makecfg $(LIBINSTALLDIR)/samplecfg $(UNITINSTALLDIR) $(MSGINSTALLDIR) $(GCCLIBPATH)
install -m 644 ppc386.cfg /etc install -m 755 -d $(MSGINSTALLDIR)
install -m 644 errorE.msg $(LIBINSTALLDIR) install -m 644 errore.msg $(MSGINSTALLDIR)
@echo Wrote sample configuration file to /etc install -m 644 errorn.msg $(MSGINSTALLDIR)
clean : #####################################################################
ifdef inlinux # Diffs
-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
#
# Utilities for making archives.
#
SOURCEFILES = $(PASFILES) $(INCFILES) $(MSGFILES) Makefile SOURCEFILES = $(PASFILES) $(INCFILES) $(MSGFILES) Makefile
DIFFFILES = $(patsubst %.pas,%.dif,$(PASFILES)) \ DIFFFILES = $(patsubst %.pas,%.dif,$(PASFILES)) \
@ -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