123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463 |
- #
- # $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.
- #
- #####################################################################
- # Try to determine Operating System
- #####################################################################
- BASEDIR=$(shell pwd)
- # in linux no : in pathes
- ifeq ($(findstring :,$(BASEDIR)),)
- inlinux=1
- endif
- # in case pwd is not present on the DOS-OS
- ifeq ($(strip $(BASEDIR)),'')
- inlinux=
- BASEDIR:=.
- endif
- # What compiler to use
- ifndef PP
- PP=ppc386
- endif
- #####################################################################
- # Setup Targets
- #####################################################################
- # what target do we use
- # currently dos go32v2 os2 and linux are available
- ifndef TARGET
- ifdef inlinux
- TARGET=linux
- else
- TARGET=go32v2
- endif
- endif
- # What processor do you want to compile for : i386 m68k (case sensitive !!)
- ifndef CPU
- CPU= i386
- # CPU= m68k
- endif
- #####################################################################
- # Setup Files Directories
- #####################################################################
- # Set os-dependent files and extensions
- ifdef inlinux
- EXEEXT=
- REPLACE=mv -f
- CP=cp -f
- else
- EXEEXT=.exe
- # mv -f gives problem under dos
- # claiming source and destinaztion are the same files !
- REPLACE=copy /y
- CP=cp -f
- endif
- COMPILERDIR=$(BASEDIR)
- RTLDIR:=$(BASEDIR)/../rtl
- # specify where units are.
- # This needs to be set correctly for the 'remake' target to work !
- ifndef UNITDIR
- UNITDIR=$(RTLDIR)/$(TARGET)
- ifeq ($(TARGET),go32v1)
- UNITDIR=$(RTLDIR)/dos/go32v1
- endif
- ifeq ($(TARGET),go32v2)
- UNITDIR=$(RTLDIR)/dos/go32v2
- endif
- endif
- # not def UNITDIR
- # Where to install the executable program/link
- ifndef PROGINSTALLDIR
- ifdef inlinux
- PROGINSTALLDIR = /usr/bin
- else
- PROGINSTALLDIR = c:\pp\bin
- endif
- endif
- # !!! Linux only
- # Where to install the _real_executable and support files
- ifndef LIBINSTALLDIR
- ifdef inlinux
- LIBINSTALLDIR=/usr/lib/fpc/0.99.6
- # for a.out
- # LIBINSTALLDIR=/usr/lib/ppc/aout/0.99.6
- 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
- # !!! Linux only
- # GCCLIBPATH is wat is it on my PC... it MUST be set in the main Makefile
- ifndef GCCLIBPATH
- GCCLIBPATH=/usr/lib/gcc-lib/i486-linux/2.6.3
- endif
- #####################################################################
- # When making diffs of the sources
- #####################################################################
- # Diff program
- DIFF = diff
- # Diff3 program
- DIFF3 = diff3
- # Options to diff.
- DIFFOPTS = -b -c
- # Directory where files are to make diffs with..
- ifdef inlinux
- DIFDIR = /usr/local/fpk/work/new/compiler
- else
- DIFDIR = h:/cvs/compiler
- endif
- # Directory where reference files are for diff3
- ifdef inlinux
- REFDIR = /usr/local/fpk/dist/source/compiler
- else
- REFDIR = h:/myref/compiler
- endif
- #####################################################################
- # End of configurable section. Do not edit after this line.
- #####################################################################
- # set correct defines (also needed by mkdep)
- PPDEFS:=-d$(CPU) -dGDB -dFPC
- # Set the needed compiler options
- PPOPTS:=$(OPT) $(PPDEFS) -Sg -T$(TARGET)
- # Unitdir specified ?
- ifneq ("$(UNITDIR)", "")
- PPOPTS:=$(PPOPTS) -Up$(UNITDIR)
- endif
- # Do we need the GCC library ?
- ifeq ($(LINK_TO_C),YES)
- PPOPTS:=$(PPOPTS) -Fg$(GCCLIBPATH)
- endif
- # Create the whole compiler commandline
- COMPILER=$(PP) $(PPOPTS)
- #####################################################################
- # 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)
- PASFILES:=$(wildcard *.pas)
- INCFILES:=$(wildcard *.inc)
- MSGFILES:=$(wildcard *.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:
- $(COMPILER) $<
- .pas$(EXEEXT):
- $(COMPILER) $<
- all : $(EXENAME)
- clean :
- -rm -f *.o *.ppu *.s $(EXENAME)
- distclean: clean
- -rm -f $(TEMPNAME) $(TEMPNAME1) $(TEMPNAME2) $(TEMPNAME3)
- #####################################################################
- # Info
- #####################################################################
- info :
- @echo - Target is $(TARGET)
- @echo - Basedir is $(BASEDIR)
- @echo - Unitdir is $(UNITDIR)
- @echo - Pascal files are $(PASFILES)
- @echo - Inc files are $(INCFILES)
- @echo - Msg files are $(MSGFILES)
- #####################################################################
- # Include depencies (linux only)
- #####################################################################
- ifdef inlinux
- $(MAKEDEP) : $(RTLDIR)/utils/mkdep.pp
- $(PP) $(RTLDIR)/utils/mkdep.pp
- $(CP) $(RTLDIR)/utils/$(MAKEDEP) $(MAKEDEP)
- dependencies : $(MAKEDEP)
- $(MAKEDEP) pp.pas $(PPDEFS) '-F$$(COMPILER)' > depend
- include depend
- endif
- #####################################################################
- # Make targets
- #####################################################################
- msgtxt.inc: errore.msg
- msg2inc errore.msg msgtxt.inc msgtxt
- optmsg.inc: optione.msg
- msg2inc optione.msg optmsg.inc optiontxt
- msg: msgtxt.inc optmsg.inc
- # Make only the compiler
- ifdef inlinux
- $(EXENAME) : $(PPEXENAME)
- $(REPLACE) $(PPEXENAME) $(EXENAME)
- else
- $(EXENAME) : $(PASFILES) $(INCFILES) $(MSGFILES)
- $(COMPILER) pp.pas
- $(REPLACE) $(PPEXENAME) $(EXENAME)
- endif
- # This target remakes the units with the currently made version
- remake: $(EXENAME)
- $(REPLACE) $(EXENAME) $(TEMPNAME)
- $(MAKE) clean
- $(MAKE) -C $(UNITDIR) clean
- $(MAKE) -C $(UNITDIR) 'PP=$(COMPILERDIR)/$(TEMPNAME)' all
- $(MAKE) 'PP=./$(TEMPNAME)' all
- remake3: $(TEMPNAME3)
- $(MAKE) clean
- $(MAKE) -C $(UNITDIR) clean
- $(MAKE) -C $(UNITDIR) 'PP=$(COMPILERDIR)/$(TEMPNAME3)' all
- $(MAKE) 'PP=./$(TEMPNAME3)' all
- diff $(TEMPNAME3) $(EXENAME)
- $(TEMPNAME1) : $(EXENAME)
- $(REPLACE) $(EXENAME) $(TEMPNAME1)
- $(TEMPNAME2) : $(TEMPNAME1)
- $(MAKE) clean
- $(MAKE) -C $(UNITDIR) clean
- $(MAKE) -C $(UNITDIR) 'PP=$(COMPILERDIR)/$(TEMPNAME1)' all
- $(MAKE) 'PP=./$(TEMPNAME1)' all
- $(REPLACE) $(EXENAME) $(TEMPNAME2)
- $(TEMPNAME3) : $(TEMPNAME2)
- $(MAKE) clean
- $(MAKE) -C $(UNITDIR) clean
- $(MAKE) -C $(UNITDIR) 'PP=$(COMPILERDIR)/$(TEMPNAME2)' all
- $(MAKE) 'PP=./$(TEMPNAME2)' all
- $(REPLACE) $(EXENAME) $(TEMPNAME3)
- cycle:
- $(MAKE) clean
- $(MAKE) -C $(UNITDIR) clean
- $(MAKE) -C $(UNITDIR)
- $(MAKE) remake3
- #####################################################################
- # Installation
- #####################################################################
- install:
- umask 022
- strip ppc386
- install -m 755 -d $(LIBINSTALLDIR)
- install -m 755 ppc386 $(LIBINSTALLDIR)
- ln -sf $(LIBINSTALLDIR)/ppc386 $(PROGINSTALLDIR)/ppc386
- -makecfg $(LIBINSTALLDIR)/samplecfg $(UNITINSTALLDIR) $(MSGINSTALLDIR) $(GCCLIBPATH)
- install -m 755 -d $(MSGINSTALLDIR)
- install -m 666 errore.msg $(MSGINSTALLDIR)
- install -m 666 errorn.msg $(MSGINSTALLDIR)
- #####################################################################
- # Diffs
- #####################################################################
- SOURCEFILES = $(PASFILES) $(INCFILES) $(MSGFILES) Makefile
- DIFFFILES = $(patsubst %.pas,%.dif,$(PASFILES)) \
- $(patsubst %.inc,%.dif,$(INCFILES)) \
- $(patsubst %.msg,%.dif,$(MSGFILES)) \
- Makefile.dif
- DIFF3FILES = $(patsubst %.pas,%.d3p,$(PASFILES)) \
- $(patsubst %.inc,%.d3i,$(INCFILES)) \
- $(patsubst %.msg,%.d3m,$(MSGFILES)) \
- Makefile.di3
- PATCHFILES = $(patsubst %.pas,%.new,$(PASFILES)) \
- $(patsubst %.inc,%.new,$(INCFILES)) \
- $(patsubst %.msg,%.new,$(MSGFILES)) \
- Makefile.new
- %.dif : %.pas
- -$(DIFF) $(DIFFOPTS) $*.pas $(DIFDIR)/$*.pas > $*.dif
- %.dif : %.msg
- -$(DIFF) $(DIFFOPTS) $*.msg $(DIFDIR)/$*.msg > $*.dif
- %.dif : %.inc
- -$(DIFF) $(DIFFOPTS) $*.inc $(DIFDIR)/$*.inc > $*.dif
- Makefile.dif : Makefile
- -$(DIFF) $(DIFFOPTS) Makefile $(DIFDIR)/Makefile > Makefile.dif
- %.new : %.pas %.dif
- -copy /y $*.pas $*.new
- -patch $*.new $*.dif
- %.new : %.msg %.dif
- -copy /y $*.msg $*.new
- -patch $*.new $*.dif
- %.new : %.inc %.dif
- -copy /y $*.inc $*.new
- -patch $*.new $*.dif
- Makefile.new : Makefile Makefile.dif
- -copy /y Makefile Makefile.new
- -patch Makefile.new Makefile.dif
- %.d3p : %.pas
- -$(DIFF3) -m -E $*.pas $(REFDIR)/$*.pas $(DIFDIR)/$*.pas > $*.d3p
- %.d3m : %.msg
- -$(DIFF3) -m -E $*.msg $(REFDIR)/$*.msg $(DIFDIR)/$*.msg > $*.d3m
- %.d3i : %.inc
- -diff3 -m -E $*.inc $(REFDIR)/$*.inc $(DIFDIR)/$*.inc > $*.d3i
- Makefile.di3: Makefile
- -diff3 -m -E Makefile $(REFDIR)/Makefile $(DIFDIR)/Makefile > Makefile.di3
- diff : $(DIFFFILES)
- diff3 : $(DIFF3FILES)
- replacediff3 : diff3
- copy /y *.pas *.bkp
- copy /y *.inc *.bki
- copy /y *.msg *.bkm
- copy /y Makefile Makefile.old
- copy /y *.d3p *.pas
- copy /y *.d3i *.inc
- copy /y *.d3m *.msg
- copy /y Makefile.di3 Makefile
- restorediff3 :
- copy /y *.bkp *.pas
- copy /y *.bki *.inc
- copy /y *.bkm *.msg
- copy /y Makefile.old Makefile
- patch : $(PATCHFILES)
- diffclean :
- -del *.dif
- -del *.d3*
- -del *.new
- rtl :
- make -C $(UNITDIR) all
- rtlclean :
- make -C $(UNITDIR) clean
- # Test of log at the end
- # does CVS add # at start of each line ??
- # $Log$
- # Revision 1.20 1998-06-24 14:02:58 peter
- # * new depend for the new ra units
- #
- # Revision 1.19 1998/06/23 14:00:15 peter
- # * renamed RA* units
- #
- # Revision 1.18 1998/06/10 10:42:44 peter
- # * ifndef TARGET to allow target on commandline
- #
- # Revision 1.17 1998/06/08 09:22:02 michael
- # fixed dependcies and rules. Make would not run any more after peters changes.
- #
- # Revision 1.16 1998/06/05 14:37:28 pierre
- # * fixes for inline for operators
- # * inline procedure more correctly restricted
- #
- # Revision 1.15 1998/06/03 09:33:39 michael
- # added distclean target to remove ppc1-ppc3 too
- #
- # Revision 1.14 1998/06/03 09:27:51 michael
- # Clean cannot remove ppc1-ppc3 : make cycle uses clean
- #
- # Revision 1.13 1998/06/02 11:29:36 peter
- # + make clean removes also ppc1 - ppc3
- #
- # Revision 1.12 1998/05/31 14:09:45 peter
- # * use mv -f instead of move /y whch is not dos6.2 compatible
- #
- # Revision 1.11 1998/05/06 14:03:27 michael
- # + Make install doesn't stop if makecfg not found
- #
- # Revision 1.10 1998/04/23 13:21:46 michael
- # Updated version number
- #
- # Revision 1.9 1998/04/15 14:16:48 michael
- # + Removed CR characters
- #
- # Revision 1.8 1998/04/06 12:28:23 pierre
- # Test of makefile log !
- #
- # End of log
|