makefileblackberry-10momentics

How can I change my BB10 project to use a makefile?


I recently created a new Blackberry project Momentics, and it runs fine from the IDE, but I need to be able to build it from the command line using a Makefile. I ran make in Terminal, but received an error because the makefile does not exist.

I checked the sample apps that I've been looking at, and they all have makefiles. I found some sources that say you can pick whether you use a managed build or a makefile when you create the project, but I found no such option in the latest version of Momentics (2.1). I tried changing this setting in the project properties, but the Builder Settings under C/C++ Build are all greyed out.

How can I change my BB10 project to use a makefile? If that isn't possible, how can I require a new project to use a makefile instead of a managed build?


Solution

  • It turns out that the option to use a makefile is unintentionally hidden in OSX. When you create a Blackberry Core Native project, the Build Settings screen will look like this:

    Build Settings

    I viewed the same screen on Windows, and the option that I wanted was right below language. I then tried again in OSX, and found out that you can scroll this screen to show the "Build" option.

    Build Settings scrolled

    I also discovered that creating the project as a Blackberry Cascades project doesn't give you this option at all, but will always use a makefile to build.

    I also tried converting my original project from using managed build to using makefile. This appeared to be possible from the File > Import option. I tried importing my project as BlackBerry > Existing Code as BlackBerry C/C++ Makefile Project and as C/C++ > Existing Code as Makefile Project, but neither option actually converted my project to a makefile project. Unfortunately, because of this, the best solution to convert the project seems to be starting a new project with the desired setting and copying the files and settings from the old project.