views:

379

answers:

2

I use GNUStep to compile Objective-C on Windows 7 using GCC and MinGW. I'd like to be able to automate the "make" instruction (with make files) from Notepad++ and have any complier errors reported to Notepad++s console window.

Edit: What I am trying to do is script GNUStep/Bash to login to the right directory, build the directory, then exit. Currently I have to type in the following:

sh -login -i
$ cd d:\directory
$ make

Does anyone have any experience with this?

Rich

+1  A: 

The npp-plugins gives you most of what you are looking for. Install the plugin and:

  • Press F6 to open the NppExec Execute window
  • Type 'make' (you may also want to cd to the proper directory first) and click OK
  • Output from make is shown in the notepad++ console

Another cool feature is that it will save the command if you restart notepad++, so you only need to type 'make' a single time.

You may need to make some tweaks to only show compiler errors, however.

Justin Ethier
Thanks for the response. It's not NppExec I'm having problems with, it's scripting Bash. I can start an interactive shell by typing in "sh -login -i" into NppExec, but I have to manually change directory and type in make each time. I would like to hit a button and have N++ login to bash and build the working folder, then either exit or report errors. I wish I hadn't wound up my Linux friends quite so much now.
kim3er
+1  A: 

I have done it, with considerable help from my friends.

  1. Create a Bash script called 'nppmake'. I saved it in c:\GNUStep. The file should contain the following:

    #! /bin/bash

    cd $1 make

  2. Create a DOS batch file called 'nppmake.bat', which again I saved in c:\GNUStep. This file contains the following:

    sh --login -i C:\GNUstep\nppmake %1

  3. In N++, go to 'Plugins > NppExec > Execute' and type in the following:

    C:\GNUstep\nppmake.bat $(CURRENT_DIRECTORY)

  4. Hit 'Save' and call the script 'make'.

  5. In 'Plugins > NppExec > Advanced Options...', create a menu item, which I called 'Build' and associate it to the script called 'make' (I'm a Visual Studio developer, so 'build' feels more natural to me). Make sure 'Place to the Macros submenu' is checked.
  6. You may need to restart N++ at this point, but then all that is left to do is add the keyboard shortcut. Go to 'Settings > Shortcut Mapper > Plugin Commands' and find 'Build'. I assigned 'Ctrl-Shift-B', is it is the same as VS.

You're done. Now open up a file in a Objective-C project, that has a GNUmakefile, and hit 'Ctrl-Shift-B'. The NppExec window reports any errors, or hopefully a successful build!

kim3er