diff --git a/rtl/i386/makefile.cpu b/rtl/i386/makefile.cpu new file mode 100644 index 0000000000..286167c3b9 --- /dev/null +++ b/rtl/i386/makefile.cpu @@ -0,0 +1,7 @@ +# +# Here we set processor dependent include file names. +# + +CPUNAMES=i386 heap math set +CPUINCNAMES=$(addsuffix .inc,$(CPUNAMES)) + diff --git a/rtl/inc/makefile.inc b/rtl/inc/makefile.inc new file mode 100644 index 0000000000..6464b48387 --- /dev/null +++ b/rtl/inc/makefile.inc @@ -0,0 +1,15 @@ +# +# Here we set some variables, needed by all OSes. +# + +# System unit include files. These are composed from header and +# implementation files. + +SYSNAMES=systemh heaph mathh filerec textrec system real2str sstrings innr file typefile version +SYSINCNAMES=$(addsuffix .inc,$(SYSNAMES)) + +# Other files... +#astrings.pp +#complex.pp +#cpne.pp +#lstrings.pp diff --git a/rtl/linux/makefile b/rtl/linux/makefile index 49e80503e9..a1aef7b394 100644 --- a/rtl/linux/makefile +++ b/rtl/linux/makefile @@ -81,104 +81,48 @@ endif # Do not edit after this line. ##################################################################### +##################################################################### +# System independent +##################################################################### + # Where are the include files ? INC=../inc PROCINC=../$(CPU) +CFG=../cfg OBJPASDIR=../objpas -# To copy pograms -ifndef COPY -ifeq ($(DOS),YES) -COPY=copy -else -COPY=cp -p -endif -endif +# Get some defaults for Programs and OSes. +# This will set the following variables : +# inlinux indos COPY REPLACE DEL INSTALL INSTALLEXE MKDIR +# It will also set OPT for cross-compilation, and add required options. +# also checks for config file. +# it expects INC PROCINC to be set !! +include $(CFG)/makefile.cfg -# Check delete program -ifndef DEL -ifeq ($(DOS),YES) -DEL=del -else -DEL=rm -f -endif -endif +# Get the system independent include file names. +# This will set the following variables : +# SYSINCNAMES +include $(INC)/makefile.inc +SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES)) -# To install files -ifndef INSTALL -ifeq ($(DOS),YES) -INSTALL=copy -else -INSTALL=install -m 644 -endif -endif +# Get the processor dependent include file names. +# This will set the following variables : +# CPUINCNAMES +include $(PROCINC)/makefile.cpu +SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES)) -# To install programs -ifndef INSTALLEXE -ifeq ($(DOS),YES) -INSTALLEXE=copy -else -INSTALLEXE=install -m 755 -endif -endif +# Put system unit dependencies together. +SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) -# To make a directory. -ifndef MKDIR -ifeq ($(DOS),YES) -MKDIR=mkdir -else -MKDIR=install -m 755 -d -endif -endif - -# diff program -ifndef REFPATH -REFPATH=/usr/local/fpk/work/new/rtl -endif -ifndef DIFF -DIFF=diff -endif -ifndef DIFFOPTS -DIFFOPTS=-b -c -endif - -# -# System independent Commandline Options -# - -# Cross compiling ? -ifeq ($(OS_TARGET),$(OS_SRC)) -CROSSCOMPILE=NO -else -CROSSCOMPILE=YES -endif - -# add required options... (-dFPC is required for older versions) -override OPT:= $(OPT) -dFPC -d$(CPU) - -# Was a config file specified ? -ifdef CFGFILE -override OPT:=$(OPT) @$(CFGFILE) -endif - -# Check for crosscompile -ifeq ($(CROSSCOMPILE),YES) -override OPT:= $(OPT) -dCROSSCOMPILE -T$(OS_TARGET) -endif - -# -# System dependent Commandline Options -# +##################################################################### +# System dependent +##################################################################### # Check if we need C library. ifeq ($(LINK_TO_C),YES) override OPT:=$(OPT) -dCRTLIB endif -##################################################################### -# System dependent -##################################################################### - # check whether we make shared or static libs ifndef LIBTYPE LIBTYPE=shared @@ -235,27 +179,9 @@ else LOADERS=lprt endif -##################################################################### -# System independent Makefile -##################################################################### - -# OS Independent Depends -SYSTEMDEPS=system.inc systemh.inc mathh.inc real2str.inc \ - heaph.inc innr.inc sstrings.inc file.inc - -SYSTEMDEPS2=text.inc typefile.inc version.inc filerec.inc \ - textrec.inc - -# Processor Dependent Depends -SYSPROCDEPS=math.inc set.inc heap.inc $(CPU).inc - # Add Prefix and Suffixes OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS)) PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS)) -DSYSTEMDEPS=$(addprefix $(INC)/, $(SYSTEMDEPS)) -DSYSTEMDEPS2=$(addprefix $(INC)/, $(SYSTEMDEPS2)) -DSYSPROCDEPS=$(addprefix $(PROCINC)/, $(SYSPROCDEPS)) - .PHONY : all install clean \ libs libsclean \ @@ -291,14 +217,8 @@ lprt$(OEXT) : lprt.c # Base Units (System, strings, os-dependent-base-unit) # -$(SYSTEMPPU) : syslinux.pp $(SYSLINUXDEPS) $(DSYSTEMDEPS) $(DSYSPROCDEPS) - $(COPY) $(DSYSTEMDEPS) . - $(COPY) $(DSYSTEMDEPS2) . - $(COPY) $(DSYSPROCDEPS) . +$(SYSTEMPPU) : syslinux.pp $(SYSLINUXDEPS) $(SYSDEPS) $(PP) $(OPT) -Us -Sg syslinux.pp $(REDIR) - $(DEL) $(SYSTEMDEPS) - $(DEL) $(SYSTEMDEPS2) - $(DEL) $(SYSPROCDEPS) strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU) $(COPY) $(PROCINC)/strings.pp . @@ -307,9 +227,7 @@ strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU) linux$(PPUEXT) : linux.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \ syscalls.inc systypes.inc sysconst.inc $(SYSTEMPPU) - $(COPY) $(INC)/filerec.inc $(INC)/textrec.inc . $(PP) $(OPT) linux.pp $(REDIR) - $(DEL) filerec.inc textrec.inc # # Delphi Object Model @@ -326,9 +244,7 @@ objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU) sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \ linux$(PPUEXT) $(SYSTEMPPU) - $(COPY) $(INC)/filerec.inc $(INC)/textrec.inc . $(PP) $(OPT) sockets.pp $(REDIR) - $(DEL) filerec.inc textrec.inc errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMPPU) $(PP) $(OPT) errors.pp $(REDIR) @@ -338,23 +254,17 @@ errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMPPU) # dos$(PPUEXT) : $(DOSDEPS) $(SYSTEMPPU) - $(COPY) $(INC)/filerec.inc $(INC)/textrec.inc . $(PP) $(OPT) dos $(REDIR) - $(DEL) filerec.inc textrec.inc crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(INC)/filerec.inc linux$(PPUEXT)\ $(SYSTEMPPU) - $(COPY) $(INC)/filerec.inc $(INC)/textrec.inc . $(PP) $(OPT) crt $(REDIR) - $(DEL) filerec.inc textrec.inc objects$(PPUEXT) : objects.pp $(SYSTEMPPU) $(PP) $(OPT) objects $(REDIR) printer$(PPUEXT) : printer.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU) - $(COPY) $(INC)/textrec.inc . $(PP) $(OPT) printer $(REDIR) - $(DEL) textrec.inc graph$(PPUEXT) : graph.pp linux$(PPUEXT) objects$(PPUEXT) $(PP) $(OPT) graph $(REDIR) diff --git a/rtl/m68k/makefile.cpu b/rtl/m68k/makefile.cpu new file mode 100644 index 0000000000..024b4c0add --- /dev/null +++ b/rtl/m68k/makefile.cpu @@ -0,0 +1,7 @@ +# +# Here we set processor dependent include file names. +# + +CPUNAMES=m68k heap lowmath math set +CPUINCNAMES=$(addsuffix .inc,$(CPUNAMES)) +