Sublime Forum

Compile c using .bat file from sublime

#1

Hello!

My name is Toni and I have been using Sublime for a while now.

I have a question

To compile my game in Amstrad CPC made in C, I have to use a .bat file called ses.bat that is in a folder call c.

I would like to know if it is possible in Sublime to compile directly from the editor, without having to go to the folder where the bat is, to make it more automatic.

Thanks!

0 Likes

#2

Yes, ST’s build system actually is just an executor for shell commands, which defaults to run a naive g++ on open c/c++ files for illustration purposes.

To add a custom build entry, either create a Build My Game.sublime-build file in ST’s User package or add a corresponding entry to your project settings - assuming your game is organized in a *.sublime-project file:

{
	"folders": [
		{
			"path": "D:\\Projects\\My Game",
		},
	],

	"build_systems": [
		{
			"name": "Build My Game",
			"shell_cmd": "$folder\\c\\compilebat",
		}
	],
}

Relevant documentation about how to achieve it, can be found at:

https://www.sublimetext.com/docs/projects.html

https://www.sublimetext.com/docs/build_systems.html

0 Likes

#3

Thanks, deathaxe!

0 Likes