Ver código fonte

* fixes to work with the new makefile
* os2 compiles now correct under linux

peter 26 anos atrás
pai
commit
f7812b9f34
9 arquivos alterados com 335 adições e 267 exclusões
  1. 100 79
      rtl/Makefile
  2. 36 16
      rtl/go32v1/Makefile
  3. 19 7
      rtl/go32v1/go32.pp
  4. 6 2
      rtl/go32v1/objinc.inc
  5. 6 2
      rtl/go32v1/system.pp
  6. 9 5
      rtl/go32v2/Makefile
  7. 141 152
      rtl/os2/Makefile
  8. 3 1
      rtl/os2/moncalls.pas
  9. 15 3
      rtl/os2/sysos2.pas

+ 100 - 79
rtl/Makefile

@@ -17,6 +17,9 @@
 # Start of configurable section
 #####################################################################
 
+# Default place of makefile.fpc
+DEFAULTFPCDIR=..
+
 # Set redir to YES if you want a log file to be kept.
 ifndef REDIR
 REDIR=NO
@@ -39,17 +42,6 @@ ifndef ERRORFILE
 ERRORFILE=
 endif
 
-# Everything else has been moved to rtl/cfg/makefile.cfg
-
-
-#####################################################################
-# Include default makefile
-#####################################################################
-
-CFG=cfg
-
-include $(CFG)/makefile.cfg
-
 
 #######################################################################
 # Fix options
@@ -78,7 +70,7 @@ else
 override REDIR:= >> log
 endif
 else
-override REDIR:= >> con
+override REDIR:=
 endif
 
 # Variables to export
@@ -95,18 +87,65 @@ export PP OPT REDIR REDIRFILE ERRORFILE
 	clean install native diffs diffclean \
 	libs libinstall \
 
-all: rtls
+all: native
 
 clean:
-	make -C template clean
-	make -C go32v1 clean
-	make -C go32v2 clean
-	make -C linux clean
-	make -C win32 clean
-	make -C os2 clean
+	$(MAKE) -C go32v1 clean
+	$(MAKE) -C go32v2 clean
+	$(MAKE) -C linux clean
+	$(MAKE) -C win32 clean
+	$(MAKE) -C os2 clean
 	-$(DEL) *.dif
 
 
+#####################################################################
+# Include default makefile
+#####################################################################
+
+# test if FPCMAKE is still valid
+ifndef FPCMAKE
+ifdef FPCDIR
+FPCMAKE=$(FPCDIR)/makefile.fpc
+endif
+endif
+ifdef FPCMAKE
+ifeq ($(strip $(wildcard $(FPCMAKE))),)
+FPCDIR=
+FPCMAKE=
+endif
+endif
+
+ifndef FPCDIR
+ifdef DEFAULTFPCDIR
+FPCDIR=$(DEFAULTFPCDIR)
+endif
+endif
+
+ifndef FPCMAKE
+ifdef FPCDIR
+FPCMAKE=$(FPCDIR)/makefile.fpc
+else
+FPCMAKE=makefile.fpc
+endif
+endif
+
+override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
+ifndef FPCMAKE
+testfpcmake:
+	@echo makefile.fpc not found!
+	@echo Check the FPCMAKE and FPCDIR environment variables.
+	@stopnow
+ifndef NODEFAULTALL
+all: testfpcmake
+endif
+install: testfpcmake
+clean: testfpcmake
+else
+include $(FPCMAKE)
+testfpcmake:
+endif
+
+
 ############################################################################
 # RTLs
 ############################################################################
@@ -116,22 +155,23 @@ native: rtl$(OS_SOURCE)
 rtls: rtlgo32v1 rtlgo32v2 rtllinux rtlos2 rtlwin32
 
 rtlgo32v1:
-	make -C go32v1
+	$(MAKE) -C go32v1
 
 rtlgo32v2:
-	make -C go32v2
+	$(MAKE) -C go32v2
 
 rtllinux:
-	make -C linux
+	$(MAKE) -C linux
 
 rtlos2:
-	make -C os2
+	$(MAKE) -C os2
 
 rtlwin32:
-	make -C win32
+	$(MAKE) -C win32
 
 rtlamiga:
-	make -C amiga
+	$(MAKE) -C amiga
+
 
 ############################################################################
 # Libs
@@ -142,19 +182,19 @@ nativelibs : $(OS_SOURCE)libs
 libs: go32v1libs go32v2libs linuxlibs os2libs win32libs
 
 go32v1libs:
-	make -C go32v1 libs
+	$(MAKE) -C go32v1 libs
 
 go32v2libs:
-	make -C go32v2 libs
+	$(MAKE) -C go32v2 libs
 
 linuxlibs:
-	make -C linux libs
+	$(MAKE) -C linux libs
 
 os2libs:
-	make -C os2 libs
+	$(MAKE) -C os2 libs
 
 win32libs:
-	make -C win32 libs
+	$(MAKE) -C win32 libs
 
 
 ############################################################################
@@ -166,15 +206,15 @@ install: install_linux install_go32v1 install_go32v2 install_os2 install_win32
 native_install: install_$(OS_SRC)
 
 install_go32v1:
-	make -C go32v1 install
+	$(MAKE) -C go32v1 install
 install_go32v2:
-	make -C go32v2 install
+	$(MAKE) -C go32v2 install
 install_linux:
-	make -C linux install
+	$(MAKE) -C linux install
 install_os2:
-	make -C os2 install
+	$(MAKE) -C os2 install
 install_win32:
-	make -C win32 install
+	$(MAKE) -C win32 install
 
 
 ############################################################################
@@ -187,15 +227,15 @@ libinstall: libinstall_linux libinstall_go32v1 libinstall_go32v2 \
 native_libinstall: libinstall_$(OS_SOURCE)
 
 libinstall_go32v1:
-	make -C go32v1 libinstall
+	$(MAKE) -C go32v1 libinstall
 libinstall_go32v2:
-	make -C go32v2 libinstall
+	$(MAKE) -C go32v2 libinstall
 libinstall_linux:
-	make -C linux libinstall
+	$(MAKE) -C linux libinstall
 libinstall_os2:
-	make -C os2 libinstall
+	$(MAKE) -C os2 libinstall
 libinstall_win32:
-	make -C win32 libinstall
+	$(MAKE) -C win32 libinstall
 
 
 ############################################################################
@@ -212,59 +252,40 @@ makefile.dif : makefile
 diffs_rtl: makefile.dif
 
 diffs_inc:
-	make -C inc diffs
+	$(MAKE) -C inc diffs
 diffs_i386:
-	make -C i386 diffs
+	$(MAKE) -C i386 diffs
 diffs_m68k:
-	make -C m68k diffs
+	$(MAKE) -C m68k diffs
 diffs_cfg:
-	make -C cfg diffs
+	$(MAKE) -C cfg diffs
 diffs_template:
-	make -C template diffs
+	$(MAKE) -C template diffs
 diffs_go32v1:
-	make -C go32v1 diffs
+	$(MAKE) -C go32v1 diffs
 diffs_go32v2:
-	make -C go32v2 diffs
+	$(MAKE) -C go32v2 diffs
 diffs_linux:
-	make -C linux diffs
+	$(MAKE) -C linux diffs
 diffs_os2:
-	make -C os2 diffs
+	$(MAKE) -C os2 diffs
 diffs_win32:
-	make -C win32 diffs
+	$(MAKE) -C win32 diffs
 
 diffclean:
-	make -C template diffclean
-	make -C dos diffclean
-	make -C go32v1 diffclean
-	make -C go32v2 diffclean
-	make -C linux diffclean
-	make -C os2 diffclean
-	make -C win32 diffclean
+	$(MAKE) -C template diffclean
+	$(MAKE) -C dos diffclean
+	$(MAKE) -C go32v1 diffclean
+	$(MAKE) -C go32v2 diffclean
+	$(MAKE) -C linux diffclean
+	$(MAKE) -C os2 diffclean
+	$(MAKE) -C win32 diffclean
 	-$(DEL) *.dif
 
 #
 # $Log$
-# Revision 1.6  1999-05-19 10:59:48  peter
-#   * remove utils
-#
-# Revision 1.5  1999/02/24 15:59:04  michael
-# * fixed clean target
-#
-# Revision 1.4  1998/12/21 14:26:52  pierre
-#  * go32v? directory change reflected
-#
-# Revision 1.3  1998/10/22 16:45:23  pierre
-#  + added rtlamiga target
-#
-# Revision 1.2  1998/09/16 16:47:20  peter
-#   * merged fixes
-#
-# Revision 1.1.2.1  1998/09/16 16:17:46  peter
-#   * updates to install with go32,win32
-#
-# Revision 1.1	1998/09/10 14:19:02  peter
-#   - renamed
+# Revision 1.7  1999-06-01 13:23:07  peter
+#   * fixes to work with the new makefile
+#   * os2 compiles now correct under linux
 #
-# Revision 1.10  1998/09/04 17:32:36  pierre
-#   * REDIR handling corrected
 #

+ 36 - 16
rtl/go32v1/Makefile

@@ -55,11 +55,12 @@ SYSTEMUNIT=system
 LOADEROBJECTS=prt0
 
 # Unit Objects
-UNITOBJECTS=$(SYSTEMUNIT) strings go32 \
-	  dos crt objects printer \
-	  objpas sysutils math typinfo \
+UNITOBJECTS=$(SYSTEMUNIT) objpas strings \
+	  go32 \
+          dos crt objects printer \
+	  sysutils math typinfo \
 	  cpu mmx getopts heaptrc \
-	  msmouse
+          msmouse
 
 #####################################################################
 # Common targets
@@ -170,29 +171,25 @@ prt0$(OEXT) : prt0.as
 $(SYSTEMPPU) : system.pp $(SYSDEPS)
 	$(COMPILER) -Us -Sg system.pp $(REDIR)
 
+objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMPPU)
+	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp $(REDIR)
+
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
 		   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
 		   $(SYSTEMPPU)
 
-go32$(PPUEXT) : go32.pp $(SYSTEMPPU)
-
-#
-# Delphi Object Model
-#
-
-include $(OBJPASDIR)/makefile.op
-
-
 #
 # System Dependent Units
 #
 
+go32$(PPUEXT) : go32.pp objpas$(PPUEXT) $(SYSTEMPPU)
+
 #
 # TP7 Compatible RTL Units
 #
 
 dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
-	       go32$(PPUEXT) strings$(PPUEXT) $(SYSTEMPPU)
+               go32$(PPUEXT) strings$(PPUEXT) $(SYSTEMPPU)
 
 crt$(PPUEXT) : crt.pp $(INC)/textrec.inc go32$(PPUEXT) $(SYSTEMPPU)
 
@@ -201,7 +198,21 @@ objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
 printer$(PPUEXT) : printer.pp $(SYSTEMPPU)
 
 #
-# Other RTL Units
+# Delphi Compatible Units
+#
+
+sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \
+		    filutil.inc disk.inc objpas$(PPUEXT) dos$(PPUEXT) go32$(PPUEXT)
+	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/sysutils.pp $(REDIR)
+
+typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
+	$(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)
+
+math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/math.pp $(REDIR)
+
+#
+# Other system-independent RTL Units
 #
 
 cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
@@ -211,12 +222,21 @@ mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
 getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
 
 heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
+	$(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
+
+#
+# Other system-dependent RTL Units
+#
 
 msmouse$(PPUEXT) : msmouse.pp $(SYSTEMPPU)
 
 #
 # $Log$
-# Revision 1.6  1999-04-08 12:22:52  peter
+# Revision 1.7  1999-06-01 13:23:08  peter
+#   * fixes to work with the new makefile
+#   * os2 compiles now correct under linux
+#
+# Revision 1.6  1999/04/08 12:22:52  peter
 #   * removed os.inc
 #
 #

+ 19 - 7
rtl/go32v1/go32.pp

@@ -15,7 +15,9 @@
 
 unit go32;
 
+{$mode objfpc}
 {$S-}{no stack check, used by DPMIEXCP !! }
+
   interface
 
     const
@@ -574,16 +576,16 @@ end ['EAX','EDX'];
       begin
          asm
             pushl %ebx
-            movw  $0,U_GO32_INT31ERROR
+            movw  $0,INT31ERROR
             movl  flag,%ebx
             testb $1,%bl
-            jz    1f
-            movw  %ax,U_GO32_INT31ERROR
+            jz    .L1
+            movw  %ax,INT31ERROR
             xorl  %eax,%eax
-            jmp   2f
-            1:
+            jmp   .L2
+            .L1:
             movl  $1,%eax
-            2:
+            .L2:
             popl  %ebx
          end;
       end;
@@ -1104,6 +1106,9 @@ end ['EAX','EDX'];
          sti
       end;
 
+    var
+      _run_mode : word;external name '_run_mode';
+
     function get_run_mode : word;
 
       begin
@@ -1129,6 +1134,9 @@ end ['EAX','EDX'];
          end;
       end;
 
+    var
+      _core_selector : word;external name '_core_selector';
+
     function get_core_selector : word;
 
       begin
@@ -1203,7 +1211,11 @@ end.
 
 {
   $Log$
-  Revision 1.1  1998-12-21 13:07:02  peter
+  Revision 1.2  1999-06-01 13:23:09  peter
+    * fixes to work with the new makefile
+    * os2 compiles now correct under linux
+
+  Revision 1.1  1998/12/21 13:07:02  peter
     * use -FE
 
   Revision 1.12  1998/08/27 10:30:50  pierre

+ 6 - 2
rtl/go32v1/objinc.inc

@@ -26,7 +26,7 @@ begin
       movw handle,%bx
       movb $0x3e,%ah
       pushl %ebp
-      intl $0x21
+      int $0x21
       popl %ebp
    end;
    FileClose := 0;
@@ -173,7 +173,11 @@ END;
 
 {
   $Log$
-  Revision 1.1  1998-12-21 13:07:02  peter
+  Revision 1.2  1999-06-01 13:23:10  peter
+    * fixes to work with the new makefile
+    * os2 compiles now correct under linux
+
+  Revision 1.1  1998/12/21 13:07:02  peter
     * use -FE
 
   Revision 1.4  1998/07/06 12:26:19  carl

+ 6 - 2
rtl/go32v1/system.pp

@@ -220,7 +220,7 @@ asm
         movl    h,%ebx
         movb    $0x3e,%ah
         pushl   %ebp
-        intl    $0x21
+        int     $0x21
         popl    %ebp
         jnc     .LCLOSE1
         movw    %ax,inoutres
@@ -614,7 +614,11 @@ Begin
 End.
 {
   $Log$
-  Revision 1.4  1999-04-08 12:22:57  peter
+  Revision 1.5  1999-06-01 13:23:11  peter
+    * fixes to work with the new makefile
+    * os2 compiles now correct under linux
+
+  Revision 1.4  1999/04/08 12:22:57  peter
     * removed os.inc
 
   Revision 1.3  1999/01/18 10:05:49  pierre

+ 9 - 5
rtl/go32v2/Makefile

@@ -63,10 +63,10 @@ LOADEROBJECTS=prt0 exceptn fpu
 
 # Unit Objects
 UNITOBJECTS=$(SYSTEMUNIT) objpas strings \
-	  go32 initc dpmiexcp profile dxeload emu387 \
+          go32 initc dpmiexcp profile dxeload emu387 \
           dos crt objects printer graph \
-	  sysutils math typinfo \
-	  cpu mmx getopts heaptrc \
+          sysutils math typinfo \
+          cpu mmx getopts heaptrc \
           msmouse
 
 
@@ -189,7 +189,7 @@ strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
 # System Dependent Units
 #
 
-go32$(PPUEXT) : go32.pp $(SYSTEMPPU)
+go32$(PPUEXT) : go32.pp objpas$(PPUEXT) $(SYSTEMPPU)
 
 dpmiexcp$(PPUEXT) : dpmiexcp.pp exceptn$(OEXT) $(SYSTEMPPU)
 	$(COMPILER) -Sg dpmiexcp.pp $(REDIR)
@@ -255,7 +255,11 @@ msmouse$(PPUEXT) : msmouse.pp $(SYSTEMPPU)
 
 #
 # $Log$
-# Revision 1.15  1999-05-13 22:38:02  peter
+# Revision 1.16  1999-06-01 13:23:13  peter
+#   * fixes to work with the new makefile
+#   * os2 compiles now correct under linux
+#
+# Revision 1.15  1999/05/13 22:38:02  peter
 #   * -Sg for heaptrc
 #
 # Revision 1.14  1999/05/04 23:23:53  pierre

+ 141 - 152
rtl/os2/Makefile

@@ -18,75 +18,121 @@
 # spaces, or the makefile won't work anymore after you save.
 
 #####################################################################
-# Start of configurable section.
-# Please note that all these must be set in the main makefile, and
-# should be set there.
-# Don't remove the indef statements. They serve to avoid conflicts
-# with the main makefile.
+# Makefile Defaults
 #####################################################################
 
-# What is the target operating system ?
-ifndef OS_TARGET
-OS_TARGET=os2
-endif
+# Default place of the makefile.fpc
+DEFAULTFPCDIR=../..
 
-# What is the target processor :
-ifndef CPU
-CPU=i386
-#CPU=m68k
-endif
+# set target and cpu which are required
+override OS_TARGET=os2
+override CPU=i386
 
-# What compiler to use ?
-ifndef PP
-PP=ppc386
-endif
+# Where are the include files
+RTL=..
+INC=$(RTL)/inc
+PROCINC=$(RTL)/$(CPU)
 
-# 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 to place the result files
+TARGETDIR=.
 
-# Where is the PPUMOVE program ?
-ifndef PPUMOVE
-PPUMOVE=ppumove
-endif
+# These units belong to the RTL
+UNITPREFIX=rtl
 
-# Set this to 'shared' or 'static'
-# LIBTYPE=shared
 
-# AOUT should be defined in main makefile.
-# But you can set it here too.
-# AOUT = -DAOUT
+#####################################################################
+# Own defaults
+#####################################################################
+
+# Paths
+OBJPASDIR=$(RTL)/objpas
+
+# Define os2 system Unit name
+SYSTEMUNIT=sysos2
+
+# Loaders
+LOADEROBJECTS=prt0 prt1 code2 code3
+
+# Unit Objects
+UNITOBJECTS=$(SYSTEMUNIT) objpas strings \
+	  os2def doscalls moncalls kbdcalls viocalls \
+	  dos crt objects printer \
+	  objpas sysutils math typinfo \
+	  cpu mmx getopts heaptrc \
 
-# Do you want to link to the C library ?
-# Standard it is NO. You can set it to YES to link in th C library.
-ifndef LINK_TO_C
-LINK_TO_C=NO
-endif
 
 #####################################################################
-# End of configurable section.
-# Do not edit after this line.
+# Common targets
 #####################################################################
 
+.PHONY: all clean install info \
+	staticlib sharedlib libsclean \
+	staticinstall sharedinstall libinstall \
+
+all: testfpcmake fpc_all
+
+clean: testfpcmake fpc_clean
+
+install: testfpcmake fpc_install
+
+info: testfpcmake fpc_info
+
+staticlib: testfpcmake fpc_staticlib
+
+sharedlib: testfpcmake fpc_sharedlib
+
+libsclean: testfpcmake fpc_libsclean
+
+staticinstall: testfpcmake fpc_staticinstall
+
+sharedinstall: testfpcmake fpc_sharedinstall
+
+libinstall: testfpcmake fpc_libinstall
+
+
 #####################################################################
-# System independent
+# Include default makef
 #####################################################################
 
-# Where are the include files ?
-INC=../inc
-PROCINC=../$(CPU)
-CFG=../cfg
-OBJPASDIR=../objpas
+# test if FPCMAKE is still valid
+ifdef FPCMAKE
+ifeq ($(strip $(wildcard $(FPCMAKE))),)
+FPCDIR=
+FPCMAKE=
+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
+ifndef FPCDIR
+ifdef DEFAULTFPCDIR
+FPCDIR=$(DEFAULTFPCDIR)
+endif
+endif
+
+ifndef FPCMAKE
+ifdef FPCDIR
+FPCMAKE=$(FPCDIR)/makefile.fpc
+else
+FPCMAKE=makefile.fpc
+endif
+endif
+
+override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
+ifeq ($(FPCMAKE),)
+testfpcmake:
+	@echo makefile.fpc not found!
+	@echo Check the FPCMAKE and FPCDIR environment variables.
+	@exit
+else
+include $(FPCMAKE)
+testfpcmake:
+endif
+
+
+#####################################################################
+# Include system unit dependencies
+#####################################################################
+
+SYSTEMPPU=$(addsuffix $(PPUEXT),$(SYSTEMUNIT))
 
 # Get the system independent include file names.
 # This will set the following variables :
@@ -103,45 +149,13 @@ SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
 # Put system unit dependencies together.
 SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 
-#####################################################################
-# System dependent
-#####################################################################
-
-PPUEXT=.ppo
-ASMEXT=.so2
-OEXT=.oo2
-
-# Define Linux Units
-SYSTEMPPU=sysos2$(PPUEXT)
-OBJECTS=strings dos crt objpas sysutils
-# objects still not implemented !!
-
-LOADERS=prt0 prt1 code2 code3
 
 #####################################################################
-# System independent Makefile
+# Dependencies
 #####################################################################
 
-# Add Prefix and Suffixes
-OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
-PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
-
-.PHONY : all install clean \
-	 libs libsclean \
-	 diffs diffclean \
-
-all : $(OBJLOADERS) $(PPUOBJECTS)
-
-install : all
-	$(MKDIR) $(UNITINSTALLDIR)
-	$(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
-
-clean :
-	-$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) log
-
-#####################################################################
-# Files
-#####################################################################
+vpath %.pas $(INC) $(PROCINC)
+vpath %.pp $(INC) $(PROCINC)
 
 #
 # Loaders
@@ -150,6 +164,7 @@ clean :
 %$(OEXT) : %.as
 	as -o $*$(OEXT) $*.as
 
+
 #
 # Base Units (System, strings, os-dependent-base-unit)
 #
@@ -157,99 +172,73 @@ clean :
 $(SYSTEMPPU) : sysos2.pas $(SYSDEPS)
 	$(COMPILER) -Us -Sg sysos2.pas $(REDIR)
 
-strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
-                   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
+objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMPPU)
+	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp $(REDIR)
+
+strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
+                   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
                    $(SYSTEMPPU)
-	$(COMPILER) $(INC)/strings.pp $(REDIR)
 
 #
-# Delphi Object Model
+# System Dependent Units
 #
 
-objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(INC)/except.inc
-	$(COPY) $(OBJPASDIR)/objpas.pp .
-	$(COMPILER) -S2 -I$(OBJPASDIR) objpas $(REDIR)
-	$(DEL) objpas.pp
-
-SYSUTILINC = $(wildcard $(OBJPASDIR)/*.inc)
+doscalls$(PPUEXT) : doscalls.pas strings$(PPUEXT) objects$(PPUEXT) $(SYSTEMPPU)
 
-sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(SYSUTILINC) filutil.inc disk.inc
-	$(COPY) $(OBJPASDIR)/sysutils.pp .
-	$(COMPILER) -S2 -I$(OBJPASDIR) sysutils $(REDIR)
-	$(DEL) sysutils.pp
+kbdcalls$(PPUEXT) : kbdcalls.pas $(SYSTEMPPU)
 
-
-#
-# System Dependent Units
-#
+moncalls$(PPUEXT) : moncalls.pas strings$(PPUEXT) $(SYSTEMPPU)
 
 #
 # TP7 Compatible RTL Units
 #
 
-dos$(PPUEXT) : dos.pas $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) $(SYSTEMPPU)
-	$(COMPILER) dos.pas $(REDIR)
+dos$(PPUEXT) : dos.pas $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
+	       $(SYSTEMPPU)
+
+crt$(PPUEXT) : crt.pas $(INC)/textrec.inc $(SYSTEMPPU)
 
-crt$(PPUEXT) : crt.pas dos$(PPUEXT)
-	$(COMPILER) crt.pas $(REDIR)
+objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
 
-#objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
-#	 $(COPY) $(INC)/objects.pp .
-#	 $(COMPILER) $(OPT) objects $(REDIR)
-#	 $(DEL) objects.pp
+printer$(PPUEXT) : printer.pas $(INC)/textrec.inc $(SYSTEMPPU)
+
+#graph$(PPUEXT) : graph.pp
 
 #
-# Other RTL Units
+# Delphi Compatible Units
 #
 
-#####################################################################
-# Libs
-#####################################################################
+sysutils$(PPUEXT) : $(OBJPASDIR)/sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \
+                    filutil.inc disk.inc objpas$(PPUEXT)
+	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/sysutils.pp $(REDIR)
 
-libs	: all libfpc$(LIBEXT)
+typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
+	$(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)
 
-libfpc.so:
-	$(PPUMOVE) -o fpc *.ppu
+math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/math.pp $(REDIR)
 
-libfpc.a:
-	$(PPUMOVE) -s -o fpc *.ppu
+#
+# Other system-independent RTL Units
+#
 
-libinstall : libs
-	$(INSTALLEXE) libfpc$(LIBEXT) $(LIBINSTALLDIR)
-	$(INSTALL) *$(PPLEXT) $(UNITINSTALLDIR)
-	ldconfig
+cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMPPU)
 
-libsclean : clean
-	-$(DEL) *.a *.so *$(PPLEXT)
+mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMPPU)
 
-#####################################################################
-# Default targets
-#####################################################################
+getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMPPU)
 
-include $(CFG)/makefile.def
+heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMPPU)
+	$(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
 
 #
-# $Log$
-# Revision 1.6  1999-02-25 10:01:25  michael
-# + Fixed type in strings target
-#
-# Revision 1.5  1999/02/25 07:39:22  michael
-# * Joined strings and sysutils
+# Other system-dependent RTL Units
 #
-# Revision 1.4  1998/11/24 19:51:21  jonas
-#   + added warning about TABs
-#
-# Revision 1.3  1998/10/27 15:14:03  pierre
-#   * update sys_os2 so that it compiles with current RTL
-#     (do_isdevice might be wrong !! Daniel could you check this !!)
-#   * fixed makefile (works from go32v2 compiler)
-#     I had to remove library=shared !!
-#     (it tried to use ld with -CD !!)
-#
-# Revision 1.2  1998/10/11 13:46:31  michael
-# Sysutils changes
+
 #
-# Revision 1.1  1998/09/10 14:17:51  peter
-#   -renamed
+# $Log$
+# Revision 1.7  1999-06-01 13:23:14  peter
+#   * fixes to work with the new makefile
+#   * os2 compiles now correct under linux
 #
 #

+ 3 - 1
rtl/os2/moncalls.pas

@@ -157,7 +157,7 @@ on return number of bytes of data moved.}
 * For a detailed description of this call see the chapter "Character Device
   Monitors" in the IBM Operating System/2 Version 1.2 I/O Subsystems And
   Device Support Volume 1.}
-function DosMonRead(var InBuf;WaitFlag:byte;var DataBuf;
+function DosMonRead(var InBuf;WaitFlag:word;var DataBuf;
                                                       var ByteCount:word):word;
 
 {Establish an input and output buffers to monitor an I/O stream for a character
@@ -239,6 +239,8 @@ external 'EMXWRAP' index 404;
 {external 'MONCALLS' index 4;}
 
 function DosMonOpen(DevName:string;var MonHandle:word):word;
+var
+  i : byte;
 begin
     if DevName[0]=#255 then
     begin

+ 15 - 3
rtl/os2/sysos2.pas

@@ -100,6 +100,13 @@ const   UnusedHandle=$ffff;
         StdOutputHandle=1;
         StdErrorHandle=2;
 
+var
+{ C-compatible arguments and environment }
+  argc  : longint;external name '_argc';
+  argv  : ppchar;external name '_argv';
+  envp  : ppchar;external name '_environ';
+
+
 implementation
 
 {$I SYSTEM.INC}
@@ -669,10 +676,11 @@ var pib:Pprocessinfoblock;
 begin
     {Determine the operating system we are running on.}
     asm
+        movl $0,os_mode
         movw $0x7f0a,%ax
         call syscall
-        testw $512,%bx         {Bit 9 is OS/2 flag.}
-        setnzl os_mode
+        testw$512,%bx         {Bit 9 is OS/2 flag.}
+        setnzb os_mode
         testw $4096,%bx
         jz .LnoRSX
         movl $2,os_mode
@@ -742,7 +750,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.15  1999-05-17 21:52:44  florian
+  Revision 1.16  1999-06-01 13:23:16  peter
+    * fixes to work with the new makefile
+    * os2 compiles now correct under linux
+
+  Revision 1.15  1999/05/17 21:52:44  florian
     * most of the Object Pascal stuff moved to the system unit
 
 }