DJGPP & other compilers, such as EMX require that you set needed variables with a UNIX style slash convention. Also it is a pain to hard code the entire path into a command shell. I know this works on Windows 10, although I’m not sure about earlier versions.
The %cd% variable contains the current directory, so it makes it easy to do something like this:
Which is great, but of course all the paths are MS-DOS style. There now is the ability to replace strings!
So in this example I set a temporary variable to the MS-DOS style path, and then using the pattern :(match)=(replace) it will then replace \ with /, giving me the UNIX style path. I then just set _tmpdir to nothing, unsetting the variable. So this way I don’t have to hard code any paths, and I can flip the slashes as needed.
Another fun thing is you can do logic blocks.. A simple one if a file doesn’t exist then compile it:
IF NOT EXIST dhyrst. (
echo Executable missing attempting to compile….
@make -f makefile
I’m sure most people knew about this, but for an old guy used to doing things the hard way, it was nice to see that there finally was some way to do this kind of thing.