cmdnotepad++nppexec

running an exe from NppExec


I'm making a script to compile and run an entire project on Notepad++ using NppExec.

I keep each project on a folder and each folder has a makefile to compile the entire project, the compiler will produce a single .exe file so in each folder there is just one executable that has the same name of the folder (with the .exe extension).

I made the first part of the script (compiling with the makefile) but I don't know how to make the second part (running the executable). I know how to run an executable in NppExec but I'm trying to do something different: I want to compile the exe without specifying its name in the commands so that I can use the script to compile and run every project organized as I explained above (each folder with only one .exe that has the same name of the folder).

How can I do it? If you don't know how to do that in NppExec, how can I do the same thing in cmd? (I can then write that in NppExec by adding cmd \c at the and of the command)


Solution

  • There are some special targets make knows about:

    So what you need are two npp_exec scripts which you can bind to different keyboard shortcuts (save the scripts under some names, in the menu use Plugins, Nppexec, Advanced options: add the scripts to the menu using the controls on the left; give the menu items different menu_names; restart notepad++; goto Settings, Shortcut mapper, Plugins commands: you will find the menu_names somewhere in this list, you can assign keyboard shortcuts to them).

    The second ingredient are the targets in the makefile:

    This way you have one setup in Notepad++ that works for all your folders, the interface is

    The makefiles in each folder know the name of the folder specific binary, you only need to add the run section to each makefile.