Commit fda66eaf authored by Ben Avison's avatar Ben Avison
Browse files

Add `-nosavepath` option

This prevents Squish from outputting an initial line containing `REM>` and
the output filename - in other words, the default pathname for the `SAVE`
statement. This is useful for a number of reasons:

* It is arguably a waste of space, since a Squished version of a program
  should ideally never be hand-edited.

* The output pathname used in ROM builds bears no relationship to anything
  on the target device (currently, the installed version of the Alarm and
  Chars programs both start with `REM>Resources.!RunImage` which relates to
  the layout of the source component directory tree).

* It is desirable for cross-compilation and native builds to be binary
  identical, so having a host pathname embedded in the output is unhelpful.
  We could have added an option to override the pathname used, to ensure
  consistency, but it's easier simply to omit the relevant line.
parent ec4c8245
...@@ -102,6 +102,7 @@ numerr%=0 ...@@ -102,6 +102,7 @@ numerr%=0
fa%=FALSE fa%=FALSE
m$="" m$=""
j$="" j$=""
savepath%=TRUE
PROCprocess_args(F$,f$) PROCprocess_args(F$,f$)
IF F$="" INPUT "Input file: "F$ IF F$="" INPUT "Input file: "F$
IF f$="" INPUT "Output file: "f$ IF f$="" INPUT "Output file: "f$
...@@ -767,9 +768,11 @@ qa%=5 ...@@ -767,9 +768,11 @@ qa%=5
linebase%=0 linebase%=0
newbase%=heapptr%+16 newbase%=heapptr%+16
newptr%=newbase% newptr%=newbase%
PROCstart_next_line IF savepath% THEN
PROCwrite(CHR$ 244+">"+f$) PROCstart_next_line
PROClog_str("REM>"+f$) PROCwrite(CHR$ 244+">"+f$)
PROClog_str("REM>"+f$)
ENDIF
PROCstart_next_line PROCstart_next_line
pt%=buf% pt%=buf%
asmflag%=0 asmflag%=0
...@@ -1171,6 +1174,7 @@ WHILE p%<w% ...@@ -1171,6 +1174,7 @@ WHILE p%<w%
PRINT "Squish ("+ver$+")"' PRINT "Squish ("+ver$+")"'
PRINT "Syntax: *Squish -from <file> -to <file> [-warn <level>] [-literal <file>]" PRINT "Syntax: *Squish -from <file> -to <file> [-warn <level>] [-literal <file>]"
PRINT " [-list <file> | -nolist] [-colour] [-nosys] [-sysfrom <file>]" PRINT " [-list <file> | -nolist] [-colour] [-nosys] [-sysfrom <file>]"
PRINT " [-nosavepath]"
END END
WHEN "-FROM" WHEN "-FROM"
IF p%<w%-1 THEN IF p%<w%-1 THEN
...@@ -1222,6 +1226,8 @@ WHILE p%<w% ...@@ -1222,6 +1226,8 @@ WHILE p%<w%
j$=a$(p%+1) j$=a$(p%+1)
p%+=1 p%+=1
ENDIF ENDIF
WHEN "-NOSAVEPATH"
savepath%=FALSE
ENDCASE ENDCASE
p%+=1 p%+=1
ENDWHILE ENDWHILE
......
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