123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450 |
- #
- # $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.
- #
- #####################################################################
- # Configuration section
- #####################################################################
- ifndef LANGUAGE
- LANGUAGE=e
- endif
- ifndef CPU
- CPU=i386
- endif
- # Local defines for the compiler only
- ifndef LOCALDEF
- LOCALDEF=
- endif
- # Local options for the compiler only
- ifndef LOCALOPT
- LOCALOPT=
- endif
- # Options for the RTL only when cycling
- ifndef RTLOPTS
- RTLOPTS=
- endif
- # Path to libgcc.a
- ifndef GCCLIBPATH
- GCCLIBPATH=/usr/lib/gcc-lib/i486-linux/2.7.2.3
- endif
- export RTLOPTS
- #####################################################################
- # Defaults
- #####################################################################
- # Where is the makefile.cfg ?
- CFG=../rtl/cfg
- # At least set -Sg
- override LOCALOPT+=-Sg
- # set correct defines (-d$(CPU) is automaticly added in makefile.cfg)
- override LOCALDEF+=-dGDB -dFPC
- override LOCALOPT+=$(LOCALDEF)
- #####################################################################
- # Include default makefile
- #####################################################################
- include $(CFG)/makefile.cfg
- # for i386 also insert MMX support
- ifneq ($(findstring -di386,$(COMPILER)),)
- override LOCALDEF+=-dSUPPORT_MMX
- endif
- #####################################################################
- # Setup Targets
- #####################################################################
- MSGFILE=error$(LANGUAGE).msg
- DIFFEXIST:=$(shell $(DIFF) --help)
- # Used to avoid unnecessary steps in remake3
- ifdef DIFFEXIST
- ifdef OLDPP
- DIFFRESULT:=$(shell $(DIFF) $(OLDPP) $(PP))
- else
- DIFFRESULT=Not equal
- endif
- else
- DIFFRESULT=No diff program
- endif
- #####################################################################
- # Setup os-independent filenames
- #####################################################################
- PPEXENAME=pp$(EXEEXT)
- EXENAME=ppc386$(EXEEXT)
- M68KEXENAME=ppc68k$(EXEEXT)
- TEMPNAME=ppc$(EXEEXT)
- TEMPNAME1=ppc1$(EXEEXT)
- TEMPNAME2=ppc2$(EXEEXT)
- TEMPNAME3=ppc3$(EXEEXT)
- MAKEDEP=mkdep$(EXEEXT)
- MSG2INC=msg2inc$(EXEEXT)
- #####################################################################
- # Default makefile
- #####################################################################
- .SUFFIXES: .pas $(EXEEXT) .ppu .dif .d3p .d3i .d3m .new
- .PHONY : all clean info \
- cycle remake remake3 \
- install next \
- diff diff3 patch replacediff3 restorediff3 \
- test rtl rtlclean \
- # also call ppas if with command option -s
- ifeq (,$(findstring -s ,$(COMPILER)))
- EXECPPAS=
- else
- EXECPPAS=@$(PPAS)
- endif
- .pas$(PPUEXT):
- $(COMPILER) $(LOCALOPT) $<
- $(EXECPPAS)
- .pas$(EXEEXT):
- $(COMPILER) $(LOCALOPT) $<
- $(EXECPPAS)
- all : $(EXENAME)
- # @echo Start $(STARTTIME) now $(ENDTIME)
- # does not work because $(ENDTIME) is expanded
- # before execution !!
- make echotime
- ifeq ($(MAKELEVEL),0)
- ifndef STARTTIME
- STARTTIME:=$(shell $(DATE) +%T)
- endif
- endif
- export STARTTIME
- ENDTIME=$(shell $(DATE) +%T)
- echotime:
- @echo Start $(STARTTIME) now $(ENDTIME)
- ifndef DIFFRESULT
- next :
- @echo $(OLDPP) and $(PP) are equal
- $(COPY) $(PP) $(EXENAME)
- else
- next :
- make execlean
- make -C $(UNITDIR) libsclean
- make -C $(UNITDIR) 'PP=$(COMPILERDIR)/$(PP)' 'OPT=$(RTLOPTS)' all
- make clean
- make all
- endif
- clean :
- -$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) $(EXENAME)
- -$(DELTREE) $(SMARTEXT)
- execlean :
- -$(DEL) $(EXENAME)
- distclean: clean
- -$(DEL) $(TEMPNAME) $(TEMPNAME1) $(TEMPNAME2) $(TEMPNAME3)
- #####################################################################
- # Include depencies (linux only)
- #####################################################################
- ifdef USEDEPEND
- $(MAKEDEP) : $(RTLDIR)/utils/mkdep.pp
- $(COMPILER) $(RTLDIR)/utils/mkdep.pp
- $(COPY) $(RTLDIR)/utils/$(MAKEDEP) $(MAKEDEP)
- dependencies : $(MAKEDEP)
- $(MAKEDEP) pp.pas $(PPOPTDEF) $(LOCALDEF) '-F$$(COMPILER) $$(LOCALOPT)' > depend
- include depend
- endif
- #####################################################################
- # Make targets
- #####################################################################
- $(MSG2INC): $(RTLDIR)/utils/msg2inc.pp
- $(COMPILER) $(RTLDIR)/utils/msg2inc.pp
- $(COPY) $(RTLDIR)/utils/$(MSG2INC) $(MSG2INC)
- msgtxt.inc: $(MSGFILE) $(MSG2INC)
- $(RTLDIR)/utils/$(MSG2INC) $(MSGFILE) msg msg
- msg: msgtxt.inc
- # Make only the compiler
- ifdef inlinux
- $(EXENAME) : $(PPEXENAME)
- $(MOVE) $(PPEXENAME) $(EXENAME)
- else
- $(EXENAME) : $(wildcard *.pas) $(wildcard *.inc)
- $(COMPILER) $(LOCALOPT) pp.pas
- $(EXECPPAS)
- $(MOVE) $(PPEXENAME) $(EXENAME)
- endif
- # This target remakes the units with the currently made version
- remake: $(EXENAME)
- $(MOVE) $(EXENAME) $(TEMPNAME)
- make execlean
- make -C $(UNITDIR) libsclean
- make clean
- make 'PP=./$(TEMPNAME)' all
- remake3: $(TEMPNAME3)
- make 'PP=./$(TEMPNAME3)' 'OLDPP=./$(TEMPNAME2)' next
- $(DIFF) $(TEMPNAME3) $(EXENAME)
- $(TEMPNAME1) : $(EXENAME)
- -$(DEL) $(TEMPNAME1)
- $(MOVE) $(EXENAME) $(TEMPNAME1)
- $(TEMPNAME2) : $(TEMPNAME1)
- make 'PP=./$(TEMPNAME1)' 'OLDPP=' next
- -$(DEL) $(TEMPNAME2)
- $(MOVE) $(EXENAME) $(TEMPNAME2)
- $(TEMPNAME3) : $(TEMPNAME2)
- make 'PP=./$(TEMPNAME2)' 'OLDPP=./$(TEMPNAME1)' next
- -$(DEL) $(TEMPNAME3)
- $(MOVE) $(EXENAME) $(TEMPNAME3)
- cycle:
- make clean
- make -C $(UNITDIR) libsclean
- make -C $(UNITDIR) 'OPT=$(RTLOPTS)' all
- make remake3
- make echotime
- cycledep:
- make cycle USEDEPEND=1
- cvstest:
- make cycle 'LOCALOPT=-n' 'RTLOPTS=-n'
- #####################################################################
- # Installation
- #####################################################################
- install:
- ifdef inlinux
- umask 022
- strip ppc386
- $(MKDIR) $(LIBINSTALLDIR)
- $(INSTALLEXE) ppc386 $(LIBINSTALLDIR)
- ln -sf $(LIBINSTALLDIR)/ppc386 $(BININSTALLDIR)/ppc386
- chmod 755 makecfg
- makecfg $(LIBINSTALLDIR)/samplecfg $(UNITINSTALLDIR) $(MSGINSTALLDIR) $(GCCLIBPATH)
- else
- $(MKDIR) $(BININSTALLDIR)
- $(INSTALLEXE) ppc386$(EXEEXT) $(BININSTALLDIR)
- endif
- $(MKDIR) $(MSGINSTALLDIR)
- $(INSTALL) errore.msg errorn.msg $(MSGINSTALLDIR)
- #####################################################################
- # Misc
- #####################################################################
- rtl :
- make -C $(UNITDIR) all
- rtlclean :
- make -C $(UNITDIR) libsclean
- # just a quick way to get ppc68k
- $(M68KEXENAME):
- make clean
- $(PP) -uI386 -uSUPPORT_MMX -dm68k -o$(M68KEXENAME) pp
- make clean
- ansirtl:
- make -C $(UNITDIR) libsclean
- make -C $(UNITDIR) PP=$(COMPILERDIR)/ppc386 OPT='-g -dUSeAnsiStrings' all
- test:
- @echo time is $(STARTTIME) date.exe is $(DATE)
- #####################################################################
- # local user configurable file
- # in makefile.loc you can add any desired target
- #####################################################################
- localmake:=$(strip $(wildcard makefile.loc))
- ifdef localmake
- include ./$(localmake)
- endif
- #####################################################################
- # Default targets
- #####################################################################
- include $(CFG)/makefile.def
- #
- # $Log$
- # Revision 1.10 1998-10-09 12:59:07 pierre
- # * MMX_SUPPORT used by default
- #
- # Revision 1.9 1998/10/09 11:07:44 peter
- # + cycledep
- #
- # Revision 1.8 1998/10/09 08:54:18 pierre
- # + added cvstest target
- # uses -n option to avoid use of local ppc386.cfg
- #
- # Revision 1.7 1998/09/29 18:34:45 peter
- # + chmod 755 makecfg
- #
- # Revision 1.6 1998/09/23 15:41:42 pierre
- # export for RTLOPTS (useful for make) !!
- #
- # Revision 1.5 1998/09/22 13:09:24 pierre
- # + added possibility to read makefile.loc if it exists
- # this allows simple addition of private rules
- # * restored EXENAME dependencies
- # PASFILES and INCFILES where not defined anymore !!
- #
- # Revision 1.4 1998/09/16 16:41:38 peter
- # * merged fixes
- #
- # Revision 1.1.2.2 1998/09/16 16:12:43 peter
- # * uses makefile.cfg
- #
- # Revision 1.3 1998/09/11 13:12:45 michael
- # + makecfg has support for different kinds of units
- #
- # Revision 1.2 1998/09/11 12:27:04 pierre
- # added execlean target to be able to keep *.s files
- #
- # Revision 1.1.2.1 1998/09/11 12:07:51 pierre
- # + added execlean to be able to keep last *.s files
- #
- # Revision 1.1 1998/09/10 13:53:54 peter
- # * msg2inc compile works
- #
- # Revision 1.31 1998/09/09 18:26:25 michael
- # Spaces to tabs...
- #
- # Revision 1.30 1998/09/09 18:17:15 florian
- # * version number changed to 0.99.8
- #
- # Revision 1.29 1998/09/02 08:51:30 pierre
- # + added -s support must be defined as LOCALOPT
- # because it does not work for rtl building
- # + added some compilation time info
- #
- # Revision 1.28 1998/08/29 13:52:30 peter
- # + new messagefile
- # * merged optione.msg into errore.msg
- #
- # Revision 1.27 1998/08/21 15:16:56 peter
- # * win32 compiles a bit better, no growheap crash
- #
- # Revision 1.26 1998/08/21 14:08:46 pierre
- # + TEST_FUNCRET now default (old code removed)
- # works also for m68k (at least compiles)
- #
- # Revision 1.25 1998/08/18 09:24:41 pierre
- # * small warning position bug fixed
- # * support_mmx switches splitting was missing
- # * rhide error and warning output corrected
- #
- # Revision 1.24 1998/08/14 09:29:53 michael
- # Updated compiler number
- #
- # Revision 1.23 1998/08/06 10:42:56 pierre
- # + faster remake3 :
- # stops when two executables are equal
- #
- # Revision 1.22 1998/07/23 18:17:58 michael
- # + Added ansirtl target to make an ansistrings capable rtl
- #
- # Revision 1.21 1998/07/22 21:33:32 michael
- # + COPY and Replace back to mv and cp
- #
- # 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
|