[M3devel] m3cc build broken

Jay K jay.krell at cornell.edu
Thu Jul 30 00:16:56 CEST 2009


making install.cmd
++ chmod 755 install.sh
++ echo 'REM ---BEGIN---'
++ echo '@echo off'
++ printf 'for %%%%p in ('
++ for p in '${PKGS}'
+++ echo m3-demo/cube
+++ sed -e 's;/;\;g'
sed: -e expression #1, char 7: unterminated `s' command

 
 
I'll rewrite this later.
But wait, I'll give you a preview.
 
 
install.cmd or setup.cmd shall be a constant file, checked in.
Next to it shall be deposited file with a name and format largely of your own chosing.
Maybe even with Unix newlines. Certainly forward slashes are fine.
Obviously the file would just be a list of relative paths to cd to.
 
 
I have a slight preference for setup.cmd over install.cmd because setup.exe is common on Windows and install.cmd is slightly ambiguous with Unix /usr/bin/install.
 
 
Or call it m3ship.cmd or m3setup.cmd or whatever. The name doesn't matter.
It will be a constant file, checked in.
Pick a name, stake a claim -- checkin an empty file somewhere (scripts?), have your .sh copy it to where you want (the root of the relevant tree), put your text file next to it, I'll fill in the code later.
 
 
The text file likely is in the same directory as the .cmd.
The name can be constant and/or it can be based on the cmd name.
foo.cmd => foo.cmd.txt or foo.txt.
 
 
If you really don't want two files, then do this:
 Grab the stub .cmd.
 Append your data to it.
  But prepend each line with something special.
  And have "something special" start with "@rem".
 
What the .cmd can do is run findstr on itself.
 
e.g:
 
set self=%~f0   like argv[]
for /f %%a in ('findstr /b /c:"@rem special marker" %self%"') do call :F1 %%a
goto :eof
 
:F1
more code
goto :eof
 
: append your data here.
 
 
Odds are high that this will actually be JScript code but that's ok, you can embed it in a .cmd file and the technique of finding a file next to self or data appended to self still apply (like people do with Perl with pl2bat).
 
 
Oh sorry one more suggestion -- this setup could also be written in Modula-3.
Not a bad idea.
If it is, I recommend NOT static linking, but instead putting m3core.dll/libm3.dll next to it, as a special case, and not having them also be in the derived directory.
That optimizes the size overall.
 
 
It could also likely be quake. Also not a bad idea.
I can never glean from the huge usage statement if there is a way to ask cm3 to just run some quake code, or if only prepend/append contents to whatever its normally will search for.. 
 
 
  - Jay




----------------------------------------
> Date: Wed, 29 Jul 2009 22:31:25 +0200
> From: wagner at elegosoft.com
> To: jay.krell at cornell.edu
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] m3cc build broken
>
> Quoting Jay K :
>
>> Whatever that was, can you run it again? Maybe with set -x?
>
> I hope that works. Watch
>
> http://hudson.modula3.com:8080/view/AMD64_LINUX/job/cm3-lastok-build-AMD64_LINUX/
>
> Olaf
> --
> Olaf Wagner -- elego Software Solutions GmbH
> Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
> phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 45 86 95
> http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
> Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
>


More information about the M3devel mailing list