Automating GNUStep from Notepad++

房东的猫 提交于 2019-12-07 11:20:52

问题


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:


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.




回答2:


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!




回答3:


Just a small correction to kim3er's answer.

cd $1 make

should be

cd $1 
make


来源:https://stackoverflow.com/questions/2442819/automating-gnustep-from-notepad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!