Generating a makefile

The Worksets window allows you to create or update a makefile. It includes lists of all the source files from your workset into the makefile. The lists are grouped into sublists, belonging to the individual groups. Depending on your build setup, you may use the $(SRCS) variable to build all your sources or the individual sublists if you are building separate library or archive files from the different source tree subdirectories. Note that in our resulting makefile there is also a list for $(RSRCS) - resource files.

If you have the makefile open in an Eddie window, the resulting text will be pasted directly into the window.

Eddie generates the following lists if the corresponding file types are included:

$(SRCS) list of .cpp and .c files
$(RSRCS) list of resource files (created by FileTypes, etc.)
$(REZSOURCES) list of .r files for the resource compiler
$(ASMSOURCES) list of .a, .s assembly files
$(MISCSOURCES) Other (.l, .y, etc.)

Once the makefile is generated, you may make changes to it and later, after you have added more files to your workset, use Export makefile again. All your changes will be preserved - Eddie only edits the text in between the # @src->@ and # @<-src@ lines.

Which makefile gets selected

When you invoke the Export makefile command, Eddie looks into the parent directory of your workset to find a file named makefile or Makefile. If it finds one, it inserts the generated portion of the makefile inside the # @src->@ and # @<-src@ lines or appends it to the end. If there is no makefile yet, it will use a makefile template - ~/config/settings/Eddie/MakefileTemplate. This file is generated the first time you use the Export makefile command. Once you have a template file in your settings folder, you may edit it any way you like. The default MakefileTemplate is compatible with version 2.0 of the generic makefile included with sample source code from the Be DTS. The MakefileTemplate gets copied into your workspace parent directory and the generated makefile commands get inserted into it.

Export Makefile As... lets you specify which makefile to export into.

Deciding which groups are included in makefile generation

You may want to not include some files in the resulting makefile - you may have them in the workset just for reference. To do that, place them in a group that has the Include in make checkbox turned off. Anything in a group like that will be ignored when generating a makefile. In fact the only group that has the Include in make checkbox turned on by default is one created by dragging a folder into the workset window. You may turn this checkbox on and off in the Edit group name dialog.

Importing into a workset

You may use the Import From... to populate a workset. Currently you may import from a makefile generated by using the Export makefile.... You may also import from other makefiles that were not generated by Eddie. This only works though if the makefile contains a list of source files assigned to the variable SRCS and a list of resources assigned to RSRCS.

Importing from a BeIDE project

You may also use the Import From... menu item to import from a BeIDE project file. The Workset window opens the selected project in BeIDE and uses scripting commands to import the files from the project.