.bat file to help compile easier - dmd/build

Derek Parnell derek at psych.ward
Fri Jan 2 12:13:16 PST 2009


On Fri, 02 Jan 2009 14:17:17 -0500, Michael P. wrote:

> Okay, so right now, I'm making a small game(Mario) using DAllegro. I use build, and every time, I have to type this in to compile my progress:
> 
> build mario alleg.lib
> 
> Now, I know it's not a lot of typing. But considering I type mario wrong every so often, and I generally want to execute it after, assuming there is not compiler errors, it takes time.
> In a .bat file right now, I have this:
> 
> build mario alleg.lib
> mario
> 
> But, mario will execute even if there are errors found by dmd.
> Is there anything that I can use to see if errors were found, and if there isn't, execute it, and if there is, don't execute it?
> DMD1.036, Windows XP, Build/Bud 3.04

If 'mario' always needs the alleg.lib file to compile, you can include that
information in the mario.d source file.

eg.

  version(build) { pramga(link, alleg); }

Then you no longer have to keep typing into the Bud command line, instead
you just say ...

   build mario

Use the return code from Bud to see if you can run the compiled program ...

   if errorlevel 0 mario


-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell


More information about the Digitalmars-d-learn mailing list