How to create a makefile

Topics for the Eclipse Environment
Post Reply
SeeCwriter
Posts: 608
Joined: Mon May 12, 2008 10:55 am

How to create a makefile

Post by SeeCwriter »

Some posts I've seen infer that project makefiles can be automatically created by the NNDK. If true, I have yet to locate that feature. Does it exist, or do I need to hand craft a makefile for my project?

Steve
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: How to create a makefile

Post by dciliske »

Uh... I'm not sure if you can create one after the fact automagically. If you want to make one from the get go, there's an option to create a "makefile project". Also, if you want to not use Eclipse at all (if that's the route you're trying to take), there's a utility called NBAppwizard that will setup the basic application and makefile in a directory.

If you have any other questions, feel free to ask, and I'll try to answer. If you haven't noticed, I really like our make system as it means I get to use my nice friendly editor Vim :)

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
SeeCwriter
Posts: 608
Joined: Mon May 12, 2008 10:55 am

Re: How to create a makefile

Post by SeeCwriter »

I want to use SlickEdit instead of Eclipse to write my programs, and I know SlickEdit can run make on projects. Otherwise I have to open Elclipse every time I want to compile.

Steve
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: How to create a makefile

Post by dciliske »

Ahh... You and Paul can have fun (That's Paul's editor as well). I'd say start with the NBAppWizard to create the template makefile (or just copy one from an example you started with) into a new directory and populate the file from there. If you have any questions about what certain parts of it do, or how to get something to work that is not clear, go ahead and post them.

Also, to build/run the project from the command line you'll want to use the following commands:
make - builds the project
make load - builds the project and loads it onto the module using Autoupdate
make debug - builds the debug version of the project
make loaddebug - builds the debug version and loads it onto the module
-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: How to create a makefile

Post by tod »

I don't know much about SlickEdit but I do know they have an Eclipse plug-in. Might get you the automated build system and your editor of choice.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: How to create a makefile

Post by rnixon »

There is a section in the programmers guide:

21 Command Line Mode
You have two options for code development using the NetBurner Tools. The first is the IDE discussed earlier. The second is using the make utility from a command prompt. Typical reasons for choosing the command prompt mode are that some developers simple prefer this method, or you may have a favorite editor/IDE that you prefer over the NetBurner IDE. Most editors can invoke an external compiler to build the project.

This section will detail how to write, compile, and download a program using the command line tools. The details of the make utility “makefile” will also be covered. Traditionally called the “Hello World” program, our “Template Program” will specify a minimal code base from which you can write your future applications. The objective of this template program is to print the characters “Hello World” out the debug port of your NetBurner device. In addition, this template program will enable network services so that it can be downloaded over a network connection instead of through a serial port or a BDM (Background Debug Mode) port.

"make" builds the app
"make load" builds the app and downloads all in one step
User avatar
pbreed
Posts: 1081
Joined: Thu Apr 24, 2008 3:58 pm

Re: How to create a makefile

Post by pbreed »

Most of the examples have a working makefile....
Pretty simple...

If you want to make it work with one specific platform

add

PLATFORM=PK70

or whatever.. instead of PK70 as the first line in the makefile...


Paul
Post Reply