mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-01 06:29:53 +00:00
Add the -R
option
This commit is contained in:
parent
3ce2249399
commit
6c4dc81c1b
@ -2,6 +2,8 @@
|
||||
|
||||
## Current version
|
||||
|
||||
* Added `-R` option for specifying extra commandline parameters for emulators.
|
||||
|
||||
* Added full 16-bit multiplication.
|
||||
|
||||
* Added preliminary support for EasyFlash.
|
||||
|
@ -60,6 +60,8 @@ Unlike `-I`, this does not replace the default include directory and allows usin
|
||||
|
||||
* `-r <program>` – Run given program after successful compilation. Useful for automatically launching emulators without any external scripting.
|
||||
|
||||
* `-R <param>` – Adds a parameter to the command line of the program run with `-r`. All `-R` options are added in order, before the output file name.
|
||||
|
||||
* `-D <feature>=<value>` – Defines a feature value for the preprocessor.
|
||||
|
||||
* `-finput_intel_syntax`, `-finput_zilog_syntax` –
|
||||
|
@ -37,9 +37,9 @@ x64 hello_world.prg
|
||||
|
||||
The following options are obligatory when compiling your sources:
|
||||
|
||||
* `-o FILENAME` – specifies the base name for your output file, an appropriate file extension will be appended.
|
||||
* `-o <FILENAME>` – specifies the base name for your output file, an appropriate file extension will be appended.
|
||||
|
||||
* `-t PLATFORM` – specifies the target platform.
|
||||
* `-t <PLATFORM>` – specifies the target platform.
|
||||
Each platform is defined in an `.ini` file in the include directory.
|
||||
For the list of supported platforms, see [Supported platforms](target-platforms.md)
|
||||
|
||||
@ -58,7 +58,7 @@ You may be also interested in the following:
|
||||
|
||||
* `-g` – additionally generate a label file
|
||||
|
||||
* `-r PROGRAM` – automatically launch given program after successful compilation
|
||||
* `-r <PROGRAM>` – automatically launch given program after successful compilation; you can supply extra params for it with `-R <PARAM>`
|
||||
|
||||
* `-Wall` – enable all warnings
|
||||
|
||||
|
@ -10,6 +10,7 @@ case class Context(errorReporting: Logger,
|
||||
inputFileNames: List[String],
|
||||
outputFileName: Option[String] = None,
|
||||
runFileName: Option[String] = None,
|
||||
runParams: Seq[String] = Vector(),
|
||||
optimizationLevel: Option[Int] = None,
|
||||
zpRegisterSize: Option[Int] = None,
|
||||
platform: Option[String] = None,
|
||||
|
@ -135,8 +135,9 @@ object Main {
|
||||
errorReporting.debug(s"Total time: ${Math.round((System.nanoTime() - startTime)/1e6)} ms")
|
||||
c.runFileName.foreach{ program =>
|
||||
val outputAbsolutePath = Paths.get(defaultPrgOutput).toAbsolutePath.toString
|
||||
errorReporting.debug(s"Running: $program $outputAbsolutePath")
|
||||
new ProcessBuilder(program, outputAbsolutePath).start()
|
||||
val cmdline = program +: c.runParams :+ outputAbsolutePath
|
||||
errorReporting.debug(s"Running: ${cmdline.mkString(" ")}")
|
||||
new ProcessBuilder(cmdline.toArray: _*).directory(new File(program).getParentFile).start()
|
||||
}
|
||||
if (platform.generateBbcMicroInfFile) {
|
||||
val start = platform.codeAllocators("default").startAt
|
||||
@ -409,6 +410,10 @@ object Main {
|
||||
c.copy(runFileName = Some(p))
|
||||
}.description("Program to run after successful compilation.")
|
||||
|
||||
parameter("-R", "--run-param").placeholder("<param>").action { (p, c) =>
|
||||
c.copy(runParams = c.runParams :+ p)
|
||||
}.description("Adds a commandline parameter to the program launched with -r")
|
||||
|
||||
parameter("-D", "--define").placeholder("<feature>=<value>").action { (p, c) =>
|
||||
val tokens = p.split('=')
|
||||
if (tokens.length == 2) {
|
||||
|
Loading…
Reference in New Issue
Block a user