Sublime Forum

C++ project make panel

#1

Hi
In eclipse, i have a “make” panel, so i can double click on my makefile goal directly, such as “make clean” or “make install”. Is it possible to do the same in sublime?
Thanks
Peter

0 Likes

#2

Install github.com/titoBouzout/SideBarEnhancements (preferably via PackageControl)

Rightclick on Makefile then Open With->Edit Applications

Change content with something similar to that:

[code]

{"id": "side-bar-files-open-with",
	"children":
	
		{
			"caption": "Make (all)",
			"id": "side-bar-files-open-with-make-all",
			"command": "side_bar_files_open_with",
			"args": {
								"paths": ".*Makefile"],
								"application": "makewrapper.sh", 
								"extensions":".*",  
								"args":"all"]
							},
			"open_automatically" : false // will close the view/tab and launch the application
		},
		{"caption":"-"}
	]
}

][/code]

makewrapper.sh is wrapper because I could not make this rather complicated set of functions in one line. Current working directory should be set up by this plugin but just in case I use readlink. Put this wrapper inside PATH and you will be done :smile:

#!/bin/bash
run_target="$1"
abs_path_to_makefile="`readlink -f $2`"
gnome-terminal -e "bash -c \"make $run_target --makefile=$abs_path_to_makefile;exec bash\""

It will spawn gnome-terminal with target and then spawn new bash to persist window.

0 Likes

PostScript language support?