The eCos Component Writer's Guide
Prev |  | Next

# make

## Name

Property make -- Define an additional custom build step associated with an option, resulting in a target that should not go directly into a library.

## Synopsis

    cdl_option <name> {
        make [-priority=<pri>]  {
            <custom build step>
        }
        …
    }

## Description

When building an eCos configuration the primary target is a single library, `libtarget.a`. In some cases it is necessary to build some additional targets. For example architectural HAL packages typically build a linker script and some start-up code. Such additional targets can be specified by a make property. Any option can have one or more make properties, although typically such properties only occur in the body of a `cdl_package` command.

The make property takes a single argument, which resembles a makefile rule: it consists of a target, a list of dependencies, and one or more commands that should be executed. However the argument is not a makefile fragment, and custom build steps may get executed in build environments that do not involve make. For full details of custom build steps see the Section called Custom Build Steps in Chapter 4.

Warning
The exact syntax and limitations of custom build steps have not yet been finalized, and are subject to change in future versions of the configuration tools.

The make property takes an optional priority argument indicating the order in which build steps take place. This priority complements the dependency list, and avoids problems with packages needing to know details of custom build steps in other packages (which may change between releases). The defined order is:

Priority 0

  The header files exported by the current set of packages are copied to the appropriate places in the `include` subdirectory of the install tree. Any unnecessary copies are avoided, to prevent rebuilds of package and application source modules caused by header file dependencies.

  > Note: A possible future enhancement of the build system may result in the build and install trees being updated automatically if there has been a change to the `ecos.ecc` configuration savefile.

Priority 100

  All files specified in compile properties will get built, producing the corresponding object files. In addition any custom build steps defined by make_object properties get executed, unless there is a `-priority=` option.

Priority 200

  The libraries now get built using the appropriate object files.

Priority 300

  Any custom build steps specified by make properties now get executed, unless the priority for a particular build step is changed from its default.

For example, if a custom build step needs to take place before any of the normal source files get compiled then it should be given a priority somewhere between 0 and 100. If a custom build step involves post-processing an object file prior to its incorporation into a library then a priority between 100 and 200 should be used.

## Example

    cdl_package CYGPKG_HAL_MN10300_AM33 {
        display       "MN10300 AM33 variant"
        parent        CYGPKG_HAL_MN10300
        implements    CYGINT_HAL_MN10300_VARIANT
        hardware
        include_dir   cyg/hal
        define_header hal_mn10300_am33.h
        description   "
               The MN10300 AM33 variant HAL package provides generic
               support for this processor architecture. It is also
               necessary to select a specific target platform HAL
               package."

        make {
            <PREFIX>/lib/target.ld: <PACKAGE>/src/mn10300_am33.ld
            $(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(CFLAGS) -o $@ $<
            @echo $@ ": \\" > $(notdir $@).deps
            @tail +2 target.tmp >> $(notdir $@).deps
            @echo >> $(notdir $@).deps
            @rm target.tmp
        }
    }

## See Also

Properties compile, make_object and library.

Prev | Home | Next
library | Up | make_object