Commit 5bba00ad authored by Diederik van Arkel's avatar Diederik van Arkel

processor dependant paths

parent e48f58ca
...@@ -36,8 +36,11 @@ MakeABCPathname name = RemoveSuffix name +++ ".abc"; ...@@ -36,8 +36,11 @@ MakeABCPathname name = RemoveSuffix name +++ ".abc";
MakeObjPathname :: !Processor !String -> Pathname; MakeObjPathname :: !Processor !String -> Pathname;
MakeObjPathname processor name MakeObjPathname processor name
= RemoveSuffix name +++ ProcessorSuffix processor
/*
| processor == CurrentProcessor | processor == CurrentProcessor
= RemoveSuffix name +++ ".o"; // = RemoveSuffix name +++ ".o";
= RemoveSuffix name +++ ".xo";
| processor == MC68000 | processor == MC68000
= RemoveSuffix name +++ ".obj0"; = RemoveSuffix name +++ ".obj0";
| processor == MC68020 | processor == MC68020
...@@ -45,7 +48,7 @@ MakeObjPathname processor name ...@@ -45,7 +48,7 @@ MakeObjPathname processor name
| processor == MC68020_and_68881 | processor == MC68020_and_68881
= RemoveSuffix name +++ ".obj2"; = RemoveSuffix name +++ ".obj2";
= abort ("MakeObjPathname: " +++ toString processor +++ " : No such processor "); = abort ("MakeObjPathname: " +++ toString processor +++ " : No such processor ");
*/
MakeProjectPathname :: !String -> Pathname; MakeProjectPathname :: !String -> Pathname;
MakeProjectPathname name = RemoveSuffix name +++ ".prj"; MakeProjectPathname name = RemoveSuffix name +++ ".prj";
...@@ -83,8 +86,11 @@ where ...@@ -83,8 +86,11 @@ where
MakeObjSystemPathname :: !Processor !Pathname -> Pathname MakeObjSystemPathname :: !Processor !Pathname -> Pathname
MakeObjSystemPathname processor name MakeObjSystemPathname processor name
= files_and_path (ProcessorSuffix processor)
/*
| processor == CurrentProcessor | processor == CurrentProcessor
= files_and_path ".o"; // = files_and_path ".o";
= files_and_path ".xo";
| processor == MC68000 | processor == MC68000
= files_and_path ".obj0"; = files_and_path ".obj0";
| processor == MC68020 | processor == MC68020
...@@ -92,6 +98,7 @@ MakeObjSystemPathname processor name ...@@ -92,6 +98,7 @@ MakeObjSystemPathname processor name
| processor == MC68020_and_68881 | processor == MC68020_and_68881
= files_and_path ".obj2"; = files_and_path ".obj2";
= abort ("MakeObjSystemPathname: " +++ toString processor +++ " : No such processor "); = abort ("MakeObjSystemPathname: " +++ toString processor +++ " : No such processor ");
*/
where where
files_and_path extension = directory_name_plus_system_dir +++ sep +++ file+++extension files_and_path extension = directory_name_plus_system_dir +++ sep +++ file+++extension
directory_name_plus_system_dir directory_name_plus_system_dir
......
...@@ -10,8 +10,9 @@ import UtilDate ...@@ -10,8 +10,9 @@ import UtilDate
:: Modulename :== String :: Modulename :== String
:: Processor = CurrentProcessor | MC68000 | MC68020 | MC68020_and_68881 :: Processor //= CurrentProcessor | MC68000 | MC68020 | MC68020_and_68881
ProcessorSuffix :: !Processor -> String
instance == Processor instance == Processor
instance toString Processor instance toString Processor
instance fromString Processor instance fromString Processor
......
...@@ -8,7 +8,7 @@ from UtilNewlinesFile import :: NewlineConvention(..) ...@@ -8,7 +8,7 @@ from UtilNewlinesFile import :: NewlineConvention(..)
import PmCompilerOptions import PmCompilerOptions
from StdPathname import :: Pathname from StdPathname import :: Pathname
import StdFile import StdFile
import Platform
:: Modulename :== String :: Modulename :== String
...@@ -32,47 +32,65 @@ UnexpectedConstructor typeName string defaultValue ...@@ -32,47 +32,65 @@ UnexpectedConstructor typeName string defaultValue
//-- //--
:: Processor = CurrentProcessor | MC68000 | MC68020 | MC68020_and_68881 :: Processor
= CurrentProcessor
| MC68000
| MC68020
| MC68020_and_68881
| PowerPC_Classic
| PowerPC_Carbon
| PowerPC_MachO
| I386
DefaultProcessor :== PlatformDependant I386 PowerPC_Carbon
ProcessorSuffix :: !Processor -> String
ProcessorSuffix CurrentProcessor = ProcessorSuffix DefaultProcessor
ProcessorSuffix MC68000 = ".obj0"
ProcessorSuffix MC68020 = ".obj1"
ProcessorSuffix MC68020_and_68881 = ".obj2"
ProcessorSuffix PowerPC_Classic = ".cxo"
ProcessorSuffix PowerPC_Carbon = ".xo"
ProcessorSuffix PowerPC_MachO = ".o"
ProcessorSuffix I386 = ".o"
instance == Processor instance == Processor
where where
(==) :: Processor Processor -> Bool (==) :: Processor Processor -> Bool
(==) CurrentProcessor CurrentProcessor (==) CurrentProcessor CurrentProcessor = True
= True (==) MC68000 MC68000 = True
(==) MC68000 MC68000 (==) MC68020 MC68020 = True
= True (==) MC68020_and_68881 MC68020_and_68881 = True
(==) MC68020 MC68020 (==) PowerPC_Classic PowerPC_Classic = True
= True (==) PowerPC_Carbon PowerPC_Carbon = True
(==) MC68020_and_68881 MC68020_and_68881 (==) PowerPC_MachO PowerPC_MachO = True
= True (==) I386 I386 = True
(==) _ _ (==) _ _ = False
= False
instance fromString Processor instance fromString Processor
where where
fromString :: {#Char} -> Processor fromString :: {#Char} -> Processor
fromString "CurrentProcessor" fromString "CurrentProcessor" = CurrentProcessor
= CurrentProcessor fromString "MC68000" = MC68000
fromString "MC68000" fromString "MC68020" = MC68020
= MC68000 fromString "MC68020_and_68881" = MC68020_and_68881
fromString "MC68020" fromString "PowerPC_Classic" = PowerPC_Classic
= MC68020 fromString "PowerPC_Carbon" = PowerPC_Carbon
fromString "MC68020_and_68881" fromString "PowerPC_MachO" = PowerPC_MachO
= MC68020_and_68881 fromString "I386" = I386
fromString string fromString string = UnexpectedConstructor "Processor" string CurrentProcessor
= UnexpectedConstructor "Processor" string CurrentProcessor
instance toString Processor instance toString Processor
where where
toString :: Processor -> {#Char} toString :: Processor -> {#Char}
toString MC68000 toString MC68000 = "MC68000"
= "MC68000" toString MC68020 = "MC68020"
toString MC68020 toString MC68020_and_68881 = "MC68020_and_68881"
= "MC68020" toString PowerPC_Classic = "PowerPC_Classic"
toString MC68020_and_68881 toString PowerPC_Carbon = "PowerPC_Carbon"
= "MC68020_and_68881" toString PowerPC_MachO = "PowerPC_MachO"
toString CurrentProcessor toString I386 = "I386"
= "CurrentProcessor" toString CurrentProcessor = "CurrentProcessor"
:: ModInfoAndName = :: ModInfoAndName =
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment