Browse Source

* merged updates

peter 27 years ago
parent
commit
c5d602d627
5 changed files with 208 additions and 257 deletions
  1. 46 96
      rtl/dos/go32v1/Makefile
  2. 31 65
      rtl/dos/go32v2/Makefile
  3. 33 40
      rtl/linux/Makefile
  4. 48 6
      rtl/objpas/Makefile
  5. 50 50
      rtl/win32/Makefile

+ 46 - 96
rtl/dos/go32v1/Makefile

@@ -21,24 +21,14 @@
 # with the main makefile.
 #####################################################################
 
-# set the directory where to install the units.
-ifndef UNITINSTALLDIR
-UNITINSTALLDIR=c:\lib\ppc\go32v1
-endif
-
-# set the directory where to install libraries
-ifndef LIBINSTALLDIR
-LIBINSTALLDIR=c:\lib
-endif
-
 # What is the Operating System
-ifndef OS_SRC
-OS_SRC=GO32V2
+ifndef OS_SOURCE
+OS_SOURCE=go32v2
 endif
 
 # What is the target operating system ?
 ifndef OS_TARGET
-OS_TARGET=GO32V1
+OS_TARGET=go32v1
 endif
 
 # What is the target processor :
@@ -47,23 +37,6 @@ CPU=i386
 #CPU=m68k
 endif
 
-# What compiler to use ?
-# I think ppc386 is better (it's mostly in path) (FK)
-ifndef PP
-PP=ppc386
-endif
-
-# What options to pass to the compiler ?
-# You may want to specify a config file or error definitions file here.
-ifndef OPT
-OPT=
-endif
-
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
 #####################################################################
 # End of configurable section.
 # Do not edit after this line.
@@ -106,21 +79,13 @@ PPIDEPS=$(addprefix $(PPI)/,$(PPIINCNAMES))
 SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 
 
-
 #####################################################################
 # System dependent
 #####################################################################
 
-# Determine needed extensions
-PPUEXT=.pp1
-PPLEXT=.ppl
-OEXT=.o1
-ASMEXT=.s1
-LIBEXT=.a1
-
 # Define Linux Units
 SYSTEMPPU=system$(PPUEXT)
-OBJECTS=strings go32 objpas sysutils math\
+OBJECTS=strings go32 \
 	dos crt objects printer \
 	cpu mmx mouse getopts graph \
 
@@ -139,14 +104,16 @@ PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
 	 libs libsclean \
 	 diffs diffclean \
 
-all : $(OBJLOADERS) $(PPUOBJECTS)
+all : $(OBJLOADERS) $(PPUOBJECTS) objpas
 
 install : all
 	$(MKDIR) $(UNITINSTALLDIR)
 	$(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
 
 clean :
-	-$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
+	-$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) $(PPAS) link.res log
+	-$(DELTREE) *$(SMARTEXT)
+	make -C $(OBJPASDIR) clean
 
 #####################################################################
 # Files
@@ -157,45 +124,32 @@ clean :
 #
 
 prt0$(OEXT) : prt0.as
-	as -D -o prt0$(OEXT) prt0.as
+	as -o prt0$(OEXT) prt0.as
 
 #
 # Base Units (System, strings, os-dependent-base-unit)
 #
 
 $(SYSTEMPPU) : system.pp $(SYSDEPS)
-	$(PP) $(OPT) -Us -Sg system.pp $(REDIR)
+	$(COMPILER) -Us -Sg system.pp $(REDIR)
 
 strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
 	$(COPY) $(PROCINC)/strings.pp .
-	$(PP) $(OPT) strings.pp $(REDIR)
+	$(COMPILER) strings.pp $(REDIR)
 	$(DEL) strings.pp
 
 go32$(PPUEXT) : ../go32.pp $(SYSTEMPPU)
 	$(COPY) ../go32.pp .
-	$(PP) $(OPT) go32.pp $(REDIR)
+	$(COMPILER) go32.pp $(REDIR)
 	$(DEL) go32.pp
 
 #
 # Delphi Object Model
 #
 
-objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
-	$(COPY) $(OBJPASDIR)/objpas.pp .
-	$(PP) $(OPT) objpas $(REDIR)
-	$(DEL) objpas.pp
-
-sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(SYSTEMPPU) objpas$(PPUEXT) \
-                   dos$(PPUEXT)
-	$(COPY) $(OBJPASDIR)/sysutils.pp .
-	$(PP) $(OPT) -I$(OBJPASDIR) sysutils $(REDIR)
-	$(DEL) sysutils.pp
-
-math$(PPUEXT) : $(OBJPASDIR)/math.pp $(SYSTEMPPU) objpas$(PPUEXT) \
-                   dos$(PPUEXT)
-	$(COPY) $(OBJPASDIR)/math.pp .
-	$(PP) $(OPT) -I$(OBJPASDIR) math $(REDIR)
-	$(DEL) math.pp
+objpas:
+	make -C $(OBJPASDIR) UNITTARGETDIR=$(BASEDIR) UNITDIR=$(BASEDIR)
+
 #
 # System Dependent Units
 #
@@ -208,22 +162,22 @@ math$(PPUEXT) : $(OBJPASDIR)/math.pp $(SYSTEMPPU) objpas$(PPUEXT) \
 dos$(PPUEXT) : ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
 	       go32$(PPUEXT) strings$(PPUEXT) $(SYSTEMPPU)
 	$(COPY) ../dos.pp .
-	$(PP) $(OPT) dos $(REDIR)
+	$(COMPILER) dos $(REDIR)
 	$(DEL) dos.pp
 
 crt$(PPUEXT) : ../crt.pp $(INC)/textrec.inc go32$(PPUEXT) $(SYSTEMPPU)
 	$(COPY) ../crt.pp .
-	$(PP) $(OPT) crt $(REDIR)
+	$(COMPILER) crt $(REDIR)
 	$(DEL) crt.pp
 
 objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
 	$(COPY) $(INC)/objects.pp .
-	$(PP) $(OPT) objects.pp $(REDIR)
+	$(COMPILER) objects.pp $(REDIR)
 	$(DEL) objects.pp
 
 printer$(PPUEXT) : ../printer.pp $(SYSTEMPPU)
 	$(COPY) ../printer.pp .
-	$(PP) $(OPT) printer.pp $(REDIR)
+	$(COMPILER) printer.pp $(REDIR)
 	$(DEL) printer.pp
 
 #
@@ -232,70 +186,66 @@ printer$(PPUEXT) : ../printer.pp $(SYSTEMPPU)
 
 cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
 	$(COPY) $(PROCINC)/cpu.pp .
-	$(PP) $(OPT) cpu.pp $(REDIR)
+	$(COMPILER) cpu.pp $(REDIR)
 	$(DEL) cpu.pp
 
 mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
 	$(COPY) $(PROCINC)/mmx.pp .
-	$(PP) $(OPT) mmx.pp $(REDIR)
+	$(COMPILER) mmx.pp $(REDIR)
 	$(DEL) mmx.pp
 
 mouse$(PPUEXT) : ../mouse.pp $(SYSTEMPPU)
 	$(COPY) ../mouse.pp .
-	$(PP) $(OPT) mouse.pp $(REDIR)
+	$(COMPILER) mouse.pp $(REDIR)
 	$(DEL) mouse.pp
 
 getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
 	$(COPY) $(INC)/getopts.pp .
-	$(PP) $(OPT) getopts.pp $(REDIR)
+	$(COMPILER) getopts.pp $(REDIR)
 	$(DEL) getopts.pp
 
 PPIFILES:=$(wildcard $(PPI)/*.ppi)
 graph$(PPUEXT) : ../graph.pp go32$(PPUEXT) $(SYSTEMPPU) mmx$(PPUEXT) $(PPIFILES)
 	$(COPY) ../graph.pp .
-	$(PP) $(OPT) -I$(PPI) graph $(REDIR)
+	$(COMPILER) -I$(PPI) graph $(REDIR)
 	$(DEL) graph.pp
 
-
 #####################################################################
 # Libs
 #####################################################################
 
-libs: all
-
-libsclean : clean
-	-$(DEL) *.$(LIBEXT) *$(PPLEXT)
+staticlib:
+	make libsclean
+	make all SMARTLINK=YES LIBNAME=fpc LIBTYPE=static
 
-#####################################################################
-# Diffs
-#####################################################################
+sharedlib:
+	@echo Shared Libraries not supported for Go32v1
 
-%.dif : %.pp
-	-$(DIFF) $(DIFFOPTS) $*.pp $(REFPATH)/dos/go32v1/$*.pp > $*.dif
+staticlibinstall: staticlib
+	$(MKDIR) $(STATIC_LIBINSTALLDIR)
+	$(MKDIR) $(STATIC_UNITINSTALLDIR)
+	$(INSTALLEXE) fpc$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
+	$(INSTALL) *$(PPUEXT) *$(OEXT) $(STATIC_UNITINSTALLDIR)
 
-%.dif : %.inc
-	-$(DIFF) $(DIFFOPTS) $*.inc $(REFPATH)/dos/go32v1/$*.inc > $*.dif
+sharedlibinstall: sharedlib
 
-%.dif : %.as
-	-$(DIFF) $(DIFFOPTS) $*.as $(REFPATH)/dos/go32v1/$*.as > $*.dif
+libinstall: staticlibinstall
 
-diffclean:
-	-$(DEL) *.dif
-
-makefile.dif : makefile
-	-$(DIFF) $(DIFFOPTS) makefile $(REFPATH)/dos/go32v1/makefile > makefile.dif
-
-diffs: system.dif os.dif makefile.dif prt0.dif
+libsclean : clean
+	-$(DEL) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
 
 #####################################################################
-# Distribution
+# Default targets
 #####################################################################
 
-distclean : clean libsclean diffclean
+include $(CFG)/makefile.def
 
 #
 # $Log$
-# Revision 1.1  1998-09-10 14:15:48  peter
-#   - renamed makefile to Makefile
+# Revision 1.2  1998-09-15 12:09:08  peter
+#   * merged updates
+#
+# Revision 1.1.2.1  1998/09/15 12:02:02  peter
+#   * updates to get objpas using its own makefile
+#
 #
-#

+ 31 - 65
rtl/dos/go32v2/Makefile

@@ -23,12 +23,12 @@
 
 # What is the Operating System
 ifndef OS_SOURCE
-OS_SOURCE=GO32V2
+OS_SOURCE=go32v1
 endif
 
 # What is the target operating system ?
 ifndef OS_TARGET
-OS_TARGET=GO32V2
+OS_TARGET=go32v2
 endif
 
 # What is the target processor :
@@ -37,23 +37,6 @@ CPU=i386
 #CPU=m68k
 endif
 
-# What compiler to use ?
-# I think ppc386 is better (it's mostly in path) (FK)
-ifndef PP
-PP=ppc386
-endif
-
-# What options to pass to the compiler ?
-# You may want to specify a config file or error definitions file here.
-ifndef OPT
-OPT=
-endif
-
-# Where is the ppumove program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
 #####################################################################
 # End of configurable section.
 # Do not edit after this line.
@@ -97,19 +80,10 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 # Define Go32v2 Units
 SYSTEMPPU=system$(PPUEXT)
 
-# BUGFIX branch cannot handle sysutils
-ifndef BUGFIX
-OBJECTS=strings go32 objpas sysutils math\
+OBJECTS=strings go32 \
 	dpmiexcp profile dxeload emu387 \
 	dos crt objects printer \
 	cpu mmx mouse getopts graph
-else
-OBJECTS=strings go32 objpas math\
-	dpmiexcp profile dxeload emu387 \
-	dos crt objects printer \
-	cpu mmx mouse getopts graph
-endif
-
 
 LOADERS=prt0 exceptn fpu
 
@@ -125,16 +99,16 @@ PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
 	 libs libsclean \
 	 diffs diffclean \
 
-all : $(OBJLOADERS) $(PPUOBJECTS)
+all : $(OBJLOADERS) $(PPUOBJECTS) objpas
 
 install : all
-	$(MKDIR) $(BASEINSTALLDIR)
 	$(MKDIR) $(UNITINSTALLDIR)
 	$(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
 
 clean :
-	-$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
+	-$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) $(PPAS) link.res log
 	-$(DELTREE) *$(SMARTEXT)
+	make -C $(OBJPASDIR) clean
 
 #####################################################################
 # Files
@@ -158,55 +132,41 @@ fpu$(OEXT) : fpu.as
 #
 
 $(SYSTEMPPU) : system.pp $(SYSDEPS)
-	$(PP) $(OPT) -Us -Sg system.pp $(REDIR)
+	$(COMPILER) -Us -Sg system.pp $(REDIR)
 
 strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
 	$(COPY) $(PROCINC)/strings.pp .
-	$(PP) $(OPT) strings.pp $(REDIR)
+	$(COMPILER) strings.pp $(REDIR)
 	$(DEL) strings.pp
 
 go32$(PPUEXT) : ../go32.pp $(SYSTEMPPU)
 	$(COPY) ../go32.pp .
-	$(PP) $(OPT) go32.pp $(REDIR)
+	$(COMPILER) go32.pp $(REDIR)
 	$(DEL) go32.pp
 
 #
 # Delphi Object Model
 #
 
-objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
-	$(COPY) $(OBJPASDIR)/objpas.pp .
-	-$(PP) $(OPT) objpas.pp $(REDIR)
-	$(DEL) objpas.pp
-
-sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(SYSTEMPPU) objpas$(PPUEXT) \
-		   dos$(PPUEXT)
-	$(COPY) $(OBJPASDIR)/sysutils.pp .
-	$(PP) $(OPT) -I$(OBJPASDIR) sysutils $(REDIR)
-	$(DEL) sysutils.pp
-
-math$(PPUEXT) : $(OBJPASDIR)/math.pp $(SYSTEMPPU) objpas$(PPUEXT) \
-		   dos$(PPUEXT)
-	$(COPY) $(OBJPASDIR)/math.pp .
-	$(PP) $(OPT) -I$(OBJPASDIR) math $(REDIR)
-	$(DEL) math.pp
+objpas:
+	make -C $(OBJPASDIR) UNITTARGETDIR=$(BASEDIR) UNITDIR=$(BASEDIR)
 
 #
 # System Dependent Units
 #
 
 dpmiexcp$(PPUEXT) : dpmiexcp.pp exceptn$(OEXT) $(SYSTEMPPU)
-	$(PP) $(OPT) -Sg dpmiexcp.pp $(REDIR)
+	$(COMPILER) -Sg dpmiexcp.pp $(REDIR)
 
 profile$(PPUEXT) : profile.pp dpmiexcp$(PPUEXT) go32$(PPUEXT) $(SYSTEMPPU)
-	$(PP) $(OPT) profile.pp $(REDIR)
+	$(COMPILER) profile.pp $(REDIR)
 
 dxeload$(PPUEXT) : $(SYSTEMPPU)
-	$(PP) $(OPT) dxeload.pp $(REDIR)
+	$(COMPILER) dxeload.pp $(REDIR)
 
 emu387$(PPUEXT) : emu387.pp fpu$(OEXT) strings$(PPUEXT) dxeload$(PPUEXT) \
 		  dpmiexcp$(PPUEXT) $(SYSTEMPPU)
-	$(PP) $(OPT) emu387.pp $(REDIR)
+	$(COMPILER) emu387.pp $(REDIR)
 
 #
 # TP7 Compatible RTL Units
@@ -215,22 +175,22 @@ emu387$(PPUEXT) : emu387.pp fpu$(OEXT) strings$(PPUEXT) dxeload$(PPUEXT) \
 dos$(PPUEXT) : ../dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
 	       go32$(PPUEXT) strings$(PPUEXT) $(SYSTEMPPU)
 	$(COPY) ../dos.pp .
-	$(PP) $(OPT) dos $(REDIR)
+	$(COMPILER) dos $(REDIR)
 	$(DEL) dos.pp
 
 crt$(PPUEXT) : ../crt.pp $(INC)/textrec.inc go32$(PPUEXT) $(SYSTEMPPU)
 	$(COPY) ../crt.pp .
-	$(PP) $(OPT) crt $(REDIR)
+	$(COMPILER) crt $(REDIR)
 	$(DEL) crt.pp
 
 objects$(PPUEXT) : $(INC)/objects.pp $(INC)/platform.inc objinc.inc $(SYSTEMPPU)
 	$(COPY) $(INC)/objects.pp .
-	$(PP) $(OPT) objects.pp $(REDIR)
+	$(COMPILER) objects.pp $(REDIR)
 	$(DEL) objects.pp
 
 printer$(PPUEXT) : ../printer.pp $(SYSTEMPPU)
 	$(COPY) ../printer.pp .
-	$(PP) $(OPT) printer.pp $(REDIR)
+	$(COMPILER) printer.pp $(REDIR)
 	$(DEL) printer.pp
 
 #
@@ -239,28 +199,28 @@ printer$(PPUEXT) : ../printer.pp $(SYSTEMPPU)
 
 cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
 	$(COPY) $(PROCINC)/cpu.pp .
-	$(PP) $(OPT) cpu.pp $(REDIR)
+	$(COMPILER) cpu.pp $(REDIR)
 	$(DEL) cpu.pp
 
 mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
 	$(COPY) $(PROCINC)/mmx.pp .
-	$(PP) $(OPT) mmx.pp $(REDIR)
+	$(COMPILER) mmx.pp $(REDIR)
 	$(DEL) mmx.pp
 
 mouse$(PPUEXT) : ../mouse.pp $(SYSTEMPPU)
 	$(COPY) ../mouse.pp .
-	$(PP) $(OPT) mouse.pp $(REDIR)
+	$(COMPILER) mouse.pp $(REDIR)
 	$(DEL) mouse.pp
 
 getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
 	$(COPY) $(INC)/getopts.pp .
-	$(PP) $(OPT) getopts.pp $(REDIR)
+	$(COMPILER) getopts.pp $(REDIR)
 	$(DEL) getopts.pp
 
 PPIFILES:=$(wildcard $(PPI)/*.ppi)
 graph$(PPUEXT) : ../graph.pp go32$(PPUEXT) $(SYSTEMPPU) mmx$(PPUEXT) $(PPIFILES)
 	$(COPY) ../graph.pp .
-	$(PP) $(OPT) -I$(PPI) graph $(REDIR)
+	$(COMPILER) -I$(PPI) graph $(REDIR)
 	$(DEL) graph.pp
 
 #####################################################################
@@ -295,7 +255,13 @@ include $(CFG)/makefile.def
 
 #
 # $Log$
-# Revision 1.1  1998-09-10 14:13:28  peter
+# Revision 1.2  1998-09-15 12:09:09  peter
+#   * merged updates
+#
+# Revision 1.1.2.1  1998/09/15 12:02:03  peter
+#   * updates to get objpas using its own makefile
+#
+# Revision 1.1	1998/09/10 14:13:28  peter
 #   * renamed
 #
 # Revision 1.16  1998/09/10 10:20:41  florian

+ 33 - 40
rtl/linux/Makefile

@@ -94,6 +94,11 @@ endif
 # System independent
 #####################################################################
 
+# Check if we need C library.
+ifeq ($(LINK_TO_C),YES)
+override OPT+=-dCRTLIB
+endif
+
 # Where are the include files ?
 INC=../inc
 PROCINC=../$(CPU)
@@ -127,15 +132,9 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 # System dependent
 #####################################################################
 
-# Check if we need C library.
-ifeq ($(LINK_TO_C),YES)
-override OPT:=$(OPT) -dCRTLIB
-endif
-
-
 # Define Linux Units
 SYSTEMPPU=syslinux$(PPUEXT)
-OBJECTS=strings linux objpas sysutils math \
+OBJECTS=strings linux \
 	dos crt objects printer \
 	getopts errors sockets graph
 
@@ -185,15 +184,16 @@ PPUOBJECTS=$(SYSTEMPPU) $(addsuffix $(PPUEXT), $(OBJECTS))
 	 libs libsclean \
 	 diffs diffclean \
 
-all : $(OBJLOADERS) $(PPUOBJECTS)
+all : $(OBJLOADERS) $(PPUOBJECTS) objpas
 
 install : all
 	$(MKDIR) $(UNITINSTALLDIR)
 	$(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
 
 clean :
-	-$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
+	-$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) $(PPAS) link.res log
 	-$(DELTREE) *$(SMARTEXT)
+	make -C $(OBJPASDIR) clean
 
 #####################################################################
 # Files
@@ -220,37 +220,23 @@ lprt$(OEXT) : lprt.c
 #
 
 $(SYSTEMPPU) : syslinux.pp $(SYSLINUXDEPS) $(SYSDEPS)
-	$(PP) $(OPT) -Us -Sg syslinux.pp $(REDIR)
+	$(COMPILER) -Us -Sg syslinux.pp $(REDIR)
 
 strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
 	$(COPY) $(PROCINC)/strings.pp .
-	$(PP) $(OPT) strings $(REDIR)
+	$(COMPILER) strings $(REDIR)
 	$(DEL) strings.pp
 
 linux$(PPUEXT) : linux.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
 		 syscalls.inc systypes.inc sysconst.inc $(SYSTEMPPU)
-	$(PP) $(OPT) linux.pp $(REDIR)
+	$(COMPILER) linux.pp $(REDIR)
 
 #
 # Delphi Object Model
 #
 
-objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
-	$(COPY) $(OBJPASDIR)/objpas.pp .
-	$(PP) $(OPT) objpas $(REDIR)
-	$(DEL) objpas.pp
-
-sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(SYSTEMPPU) objpas$(PPUEXT) \
-                   dos$(PPUEXT)
-	$(COPY) $(OBJPASDIR)/sysutils.pp .
-	$(PP) $(OPT) -I$(OBJPASDIR) sysutils $(REDIR)
-	$(DEL) sysutils.pp
-
-math$(PPUEXT) : $(OBJPASDIR)/math.pp $(SYSTEMPPU) objpas$(PPUEXT) \
-                   dos$(PPUEXT)
-	$(COPY) $(OBJPASDIR)/math.pp .
-	$(PP) $(OPT) -I$(OBJPASDIR) math $(REDIR)
-	$(DEL) math.pp
+objpas:
+	make -C $(OBJPASDIR) UNITTARGETDIR=$(BASEDIR) UNITDIR=$(BASEDIR)
 
 #
 # System Dependent Units
@@ -258,31 +244,31 @@ math$(PPUEXT) : $(OBJPASDIR)/math.pp $(SYSTEMPPU) objpas$(PPUEXT) \
 
 sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
 		   linux$(PPUEXT) $(SYSTEMPPU)
-	$(PP) $(OPT) sockets.pp $(REDIR)
+	$(COMPILER) sockets.pp $(REDIR)
 
 errors$(PPUEXT) : errors.pp strings$(PPUEXT) $(SYSTEMPPU)
-	$(PP) $(OPT) errors.pp $(REDIR)
+	$(COMPILER) errors.pp $(REDIR)
 
 #
 # TP7 Compatible RTL Units
 #
 
 dos$(PPUEXT) : $(DOSDEPS) $(SYSTEMPPU)
-	$(PP) $(OPT) dos $(REDIR)
+	$(COMPILER) dos $(REDIR)
 
 crt$(PPUEXT) : crt.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
-	$(PP) $(OPT) crt $(REDIR)
+	$(COMPILER) crt $(REDIR)
 
 objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
 	$(COPY) $(INC)/objects.pp .
-	$(PP) $(OPT) objects $(REDIR)
+	$(COMPILER) objects $(REDIR)
 	$(DEL) objects.pp
 
 printer$(PPUEXT) : printer.pp $(INC)/textrec.inc linux$(PPUEXT) $(SYSTEMPPU)
-	$(PP) $(OPT) printer $(REDIR)
+	$(COMPILER) printer $(REDIR)
 
 graph$(PPUEXT) : graph.pp linux$(PPUEXT) objects$(PPUEXT)
-	$(PP) $(OPT) graph $(REDIR)
+	$(COMPILER) graph $(REDIR)
 
 #
 # Other RTL Units
@@ -290,7 +276,7 @@ graph$(PPUEXT) : graph.pp linux$(PPUEXT) objects$(PPUEXT)
 
 getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
 	$(COPY) $(INC)/getopts.pp .
-	$(PP) $(OPT) getopts $(REDIR)
+	$(COMPILER) getopts $(REDIR)
 	$(DEL) getopts.pp
 
 #####################################################################
@@ -306,20 +292,21 @@ staticlib:
 sharedlib:
 	make clean
 	make all
-	$(PPUMOVE) -o fpc $(SHAREDLIBFILES)
+	$(PPUMOVE) -ofpc $(SHAREDLIBFILES)
 
 staticlibinstall: staticlib
 	$(MKDIR) $(STATIC_LIBINSTALLDIR)
 	$(MKDIR) $(STATIC_UNITINSTALLDIR)
 	$(INSTALLEXE) libfpc$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
+	$(INSTALLEXE) libobjpas$(STATICLIBEXT) $(STATIC_LIBINSTALLDIR)
 	$(INSTALL) *$(PPUEXT) $(OBJLOADERS) $(STATIC_UNITINSTALLDIR)
 
 sharedlibinstall: sharedlib
 	$(MKDIR) $(SHARED_LIBINSTALLDIR)
 	$(MKDIR) $(SHARED_UNITINSTALLDIR)
 	$(INSTALLEXE) libfpc$(SHAREDLIBEXT) $(SHARED_LIBINSTALLDIR)
-	$(INSTALL) *$(PPUEXT)  $(OBJLOADERS) $(SHARED_UNITINSTALLDIR)
-	ldconfig
+	$(INSTALL) *$(PPUEXT) $(OBJLOADERS) $(SHARED_UNITINSTALLDIR)
+	$(LDCONFIG)
 
 libinstall: staticlibinstall sharedlibinstall
 
@@ -334,9 +321,15 @@ include $(CFG)/makefile.def
 
 #
 # $Log$
-# Revision 1.2  1998-09-11 13:14:01  michael
+# Revision 1.3  1998-09-15 12:09:10  peter
+#   * merged updates
+#
+# Revision 1.2  1998/09/11 13:14:01  michael
 # many libs and libinstall fixes
 #
+# Revision 1.1.2.1  1998/09/15 12:02:04  peter
+#   * updates to get objpas using its own makefile
+#
 # Revision 1.1  1998/09/10 14:15:49  peter
 #   - renamed makefile to Makefile
 #

+ 48 - 6
rtl/objpas/Makefile

@@ -14,7 +14,7 @@
 #
 
 #####################################################################
-# Include configuration makefile
+# Defaults
 #####################################################################
 
 # Where are the include files ?
@@ -22,6 +22,16 @@ CFG=../cfg
 INC=../inc
 PROCINC=../$(CPU)
 
+# Libname is always objpas
+override LIBNAME=objpas
+
+# Don't forget the -S2 switch
+override OPT+=-S2
+
+#####################################################################
+# Include configuration makefile
+#####################################################################
+
 # Get some defaults for Programs and OSes.
 # This will set the following variables :
 # inlinux COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
@@ -48,13 +58,33 @@ UNITOFILES=$(addsuffix $(OEXT),$(UNITOBJECTS))
 
 .PHONY : all clean diffs install diffclean
 
-all : $(EXEFILES) $(UNITFILES)
+
+all : $(EXEFILES) $(UNITFILES) targetdir
 
 $(EXEFILES): %$(EXEEXT): %$(PASEXT)
-	$(PP) $(OPT) $* 
+	$(COMPILER) $*
 
 $(UNITFILES): %$(PPUEXT): %$(PASEXT)
-	$(PP) $(OPT) $* 
+	$(COMPILER) $*
+
+
+targetdir:
+ifdef UNITTARGETDIR
+ifdef EXEOBJECTS
+	$(COPY) $(EXEFILES) $(BINTARGETDIR)
+endif
+endif
+ifdef UNITTARGETDIR
+ifdef UNITOBJECTS
+	$(COPY) $(UNITFILES) $(UNITTARGETDIR)
+ifeq ($(SMARTLINK),YES)
+	$(COPY) lib$(LIBNAME)$(LIBEXT) $(UNITTARGETDIR)
+else
+	$(COPY) $(UNITOFILES) $(UNITTARGETDIR)
+endif
+endif
+endif
+
 
 install : all
 ifdef EXEOBJECTS
@@ -63,11 +93,17 @@ ifdef EXEOBJECTS
 endif
 ifdef UNITOBJECTS
 	$(MKDIR) $(UNITINSTALLDIR)
+ifeq ($(SMARTLINK),YES)
+	$(INSTALL) lib$(LIBNAME)$(LIBEXT) $(UNITINSTALLDIR)
+else
 	$(INSTALL) $(UNITFILES) $(UNITOFILES) $(UNITINSTALLDIR)
 endif
+endif
+
 
 clean:
-	-$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) $(PPAS) link.res log
+	-$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) $(PPAS) link.res log
+	-$(DELTREE) *$(SMARTEXT)
 ifdef EXEOBJECTS
 	-$(DEL) $(EXEFILES)
 endif
@@ -84,7 +120,13 @@ include $(CFG)/makefile.def
 
 #
 # $Log$
-# Revision 1.2  1998-09-10 14:15:50  peter
+# Revision 1.3  1998-09-15 12:09:12  peter
+#   * merged updates
+#
+# Revision 1.2.2.1  1998/09/15 12:02:05  peter
+#   * updates to get objpas using its own makefile
+#
+# Revision 1.2	1998/09/10 14:15:50  peter
 #   - renamed makefile to Makefile
 #
 #

+ 50 - 50
rtl/win32/Makefile

@@ -37,22 +37,6 @@ CPU=i386
 #CPU=m68k
 endif
 
-# What compiler to use ?
-ifndef PP
-PP=ppc386
-endif
-
-# What options to pass to the compiler ?
-# You may want to specify a config file or error definitions file here.
-ifndef OPT
-OPT=
-endif
-
-# Where is the PPUMOVE program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
-
 # Use smartlinking ?
 ifndef SMARTLINK
 SMARTLINK=NO
@@ -116,16 +100,11 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 # System dependent
 #####################################################################
 
-# Override extensions
-PPUEXT=.ppw
-SHAREDLIBEXT=.dll
-
 # Define Linux Units
 SYSTEMPPU=syswin32$(PPUEXT)
-OBJECTS=strings objpas \
-	dos \
-        windows
-#	base messages defines
+OBJECTS=strings dos \
+	windows \
+	cpu mmx getopts
 
 # Files used by windows.pp
 WINDOWS_FILES=base errors defines \
@@ -142,7 +121,7 @@ WINDOWS_SOURCE_FILES=$(addsuffix .pp,$(WINDOWS_FILES))
 	 diffs diffclean \
 	dllnames test
 
-all : $(OBJLOADERS) $(PPUOBJECTS)
+all : $(OBJLOADERS) $(PPUOBJECTS) objpas
 
 install : all
 	$(MKDIR) $(UNITINSTALLDIR)
@@ -151,6 +130,7 @@ install : all
 clean :
 	-$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) log
 	-$(DELTREE) *$(SMARTEXT)
+	make -C $(OBJPASDIR) clean
 
 #####################################################################
 # Files
@@ -161,54 +141,68 @@ clean :
 #
 
 $(SYSTEMPPU) : syswin32.pp win32.inc $(SYSDEPS)
-	$(PP) $(OPT) -Us -Sg syswin32.pp $(REDIR)
+	$(COMPILER) -Us -Sg syswin32.pp $(REDIR)
 
 strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
 	$(COPY) $(PROCINC)/strings.pp .
-	$(PP) $(OPT) strings $(REDIR)
+	$(COMPILER) strings $(REDIR)
 	$(DEL) strings.pp
 
 #
 # Delphi Object Model
 #
 
-objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
-	$(COPY) $(OBJPASDIR)/objpas.pp .
-	$(PP) $(OPT) objpas $(REDIR)
-	$(DEL) objpas.pp
+objpas:
+	make -C $(OBJPASDIR) UNITTARGETDIR=$(BASEDIR) UNITDIR=$(BASEDIR)
 
 #
 # System Dependent Units
 #
 
 base$(PPUEXT) : base.pp $(SYSTEMPPU)
-	$(PP) $(OPT) base.pp $(REDIR)
+	$(COMPILER) base.pp $(REDIR)
 
 messages$(PPUEXT) : messages.pp $(SYSTEMPPU)
-	$(PP) $(OPT) messages.pp $(REDIR)
+	$(COMPILER) messages.pp $(REDIR)
 
 defines$(PPUEXT) : defines.pp $(SYSTEMPPU)
-	$(PP) $(OPT) defines.pp $(REDIR)
+	$(COMPILER) defines.pp $(REDIR)
 
 windows$(PPUEXT) : windows.pp $(WINDOWS_SOURCE_FILES) $(SYSTEMPPU)
-	$(PP) $(OPT) windows.pp $(REDIR)
+	$(COMPILER) windows.pp $(REDIR)
 
 #
 # TP7 Compatible RTL Units
 #
 
 dos$(PPUEXT) : $(DOSDEPS) $(INC)/filerec.inc $(INC)/textrec.inc $(SYSTEMPPU)
-	$(PP) $(OPT) dos $(REDIR)
+	$(COMPILER) dos $(REDIR)
 
 #objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
 #	 $(COPY) $(INC)/objects.pp .
-#	 $(PP) $(OPT) objects $(REDIR)
+#	 $(COMPILER) objects $(REDIR)
 #	 $(DEL) objects.pp
 
 #
 # Other RTL Units
 #
 
+cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
+	$(COPY) $(PROCINC)/cpu.pp .
+	$(COMPILER) cpu.pp $(REDIR)
+	$(DEL) cpu.pp
+
+mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
+	$(COPY) $(PROCINC)/mmx.pp .
+	$(COMPILER) mmx.pp $(REDIR)
+	$(DEL) mmx.pp
+
+getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
+	$(COPY) $(INC)/getopts.pp .
+	$(COMPILER) getopts.pp $(REDIR)
+	$(DEL) getopts.pp
+
+
 #####################################################################
 # Libs
 #####################################################################
@@ -244,7 +238,7 @@ libsclean : clean
 # not present in headers !!
 
 # first get the list of all exported function names
-# uses pedump 
+# uses pedump
 # for system dll 's
 # gdi32.exp will contain all exported functions names of gdi32.dll
 
@@ -269,7 +263,7 @@ dllexps : gdi32.exp kernel32.exp advapi32.exp user32.exp mapi32.exp  \
 allexps : $(notdir $(patsubst %.dll,%.exp,$(wildcard $(WINDOWS_DIR)/system/*.dll)) \
 	$(patsubst %.drv,%.exd,$(wildcard $(WINDOWS_DIR)/system/*.drv)))
 
-# extract the dllnames for which the real dll file is not 
+# extract the dllnames for which the real dll file is not
 # known yet
 # func.lst will contain all functions for which we still do
 # not know the origin DLL
@@ -278,13 +272,13 @@ allexps : $(notdir $(patsubst %.dll,%.exp,$(wildcard $(WINDOWS_DIR)/system/*.dll
 	sed -n -e "s/\(.*\)External_library name '\([^']*\)'\(.*\)/\2/p" $*.pp > $*.lst
 
 # get the DLL name from the listing in .exp files
-# of the current target 
+# of the current target
 define grepname
 $(filter %.dll %.drv ,$(subst .exd:,.drv ,$(subst .exp:,.dll ,$(shell grep @$*@ *.ex*))))
 endef
 
 # creating of a sed script that
-# will substitute all External_library 
+# will substitute all External_library
 # by the real name of the DLL if found in exports files
 
 # two stages
@@ -296,7 +290,7 @@ endef
 	-rm $*.sub
 	@echo # Substitutions for $* >$*.sub
 # call make for all names in lst file
-# define LongList if there is an error 
+# define LongList if there is an error
 # because the list is too long
 ifdef LongList
 	$(foreach name,$(shell cat $*.lst),$(MAKE) subfile=$*.sub $(name).find ; )
@@ -314,7 +308,7 @@ endif
 	sed -f $*.sub $*.pp > $*.npp
 	sed -n -e "s/\(.*\)External_library name \'\([^\']*\)\'\(.*\)/\2/p" $*.npp > $*.mis
 
-%.find : 
+%.find :
 	@echo $* is in $(grepname)
 ifdef subfile
 	@echo s/external External_library name \'$*\'/external\
@@ -323,7 +317,7 @@ ifdef subfile
 else
 	@echo external \
 	\'$(filter %.dll %.drv ,$(subst .exd:,.drv ,$(subst .exp:,.dll ,$(shell grep @$*@ *.ex*))))\'\
-	name $* 
+	name $*
 endif
 
 GNUWIN32LIBDIR=./
@@ -336,7 +330,7 @@ ifdef subfile
 else
 	sed -n -f find.sed alllibs.sym > $*.res
 endif
-	
+
 missing : $(GNUWIN32LIBDIR)alllibs.sym $(addsuffix .lst,$(WINDOWS_FILES))
 	-rm missing
 	$(MAKE) subfile=missing $(addsuffix .find2,$(shell cat *.lst))
@@ -357,7 +351,7 @@ test:
 
 # automatic conversion from ascfun.pp to ascdef.pp
 # and unifun.pp to unidef.pp
-# only if sed is present 
+# only if sed is present
 ifdef SED
 ascdef.pp : ascfun.pp ascdef.sed
 	sed -f ascdef.sed ascfun.pp > ascdef.pp
@@ -375,10 +369,16 @@ include $(CFG)/makefile.def
 
 #
 # $Log$
-# Revision 1.2  1998-09-11 15:09:48  michael
+# Revision 1.3  1998-09-15 12:09:13  peter
+#   * merged updates
+#
+# Revision 1.2  1998/09/11 15:09:48  michael
 # fixed colon problem
 #
-# Revision 1.1  1998/09/10 14:15:55  peter
+# Revision 1.1.2.1  1998/09/15 12:02:06  peter
+#   * updates to get objpas using its own makefile
+#
+# Revision 1.1	1998/09/10 14:15:55  peter
 #   - renamed makefile to Makefile
 #
 # Revision 1.13  1998/09/07 18:31:54  peter
@@ -398,12 +398,12 @@ include $(CFG)/makefile.def
 #   * small improvements in number of found functions
 #     all remaining are in func.pp
 #
-# Revision 1.9  1998/09/03 17:14:54  pierre
+# Revision 1.9	1998/09/03 17:14:54  pierre
 #   * most functions found in main DLL's
 #     still some missing
 #     use 'make dllnames' to get missing names
 #
-# Revision 1.7  1998/08/21 15:17:01  peter
+# Revision 1.7	1998/08/21 15:17:01  peter
 #   * win32 compiles a bit better, no growheap crash
 #
 #