• Layers
  • Android Platform Developer's Guide




    Download 1.28 Mb.
    bet5/95
    Sana22.12.2019
    Hajmi1.28 Mb.
    #4580
    1   2   3   4   5   6   7   8   9   ...   95

    Understanding the makefile


    A makefile defines how to build a particular application. Makefiles typically include all of the following elements:

    1. Name: Give your build a name (LOCAL_MODULE := ).

    2. Local Variables: Clear local variables with CLEAR_VARS (include $(CLEAR_VARS)).

    3. Files: Determine which files your application depends upon (LOCAL_SRC_FILES := main.c).

    4. Tags: Define tags, as necessary (LOCAL_MODULE_TAGS := eng development).

    5. Libraries: Define whether your application links with other libraries (LOCAL_SHARED_LIBRARIES := cutils).

    6. Template file: Include a template file to define underlining make tools for a particular target (include $(BUILD_EXECUTABLE)).

    The following snippet illustrates a typical makefile.

    LOCAL_PATH := $(my-dir)

    include $(CLEAR_VARS)

    LOCAL_MODULE :=

    LOCAL_SRC_FILES := main.c

    LOCAL_MODULE_TAGS := eng development

    LOCAL_SHARED_LIBRARIES := cutils

    include $(BUILD_EXECUTABLE)

    (HOST_)EXECUTABLE, (HOST_)JAVA_LIBRARY, (HOST_)PREBUILT, (HOST_)SHARED_LIBRARY,

    (HOST_)STATIC_LIBRARY, PACKAGE, JAVADOC, RAW_EXECUTABLE, RAW_STATIC_LIBRARY,

    COPY_HEADERS, KEY_CHAR_MAP

    The snippet above includes artificial line breaks to maintain a print-friendly document.


    Layers


    The build hierarchy includes the abstraction layers described in the table below.

    Each layer relates to the one above it in a one-to-many relationship. For example, an arch can have more than one board and each board can have more than one device. You may define an element in a given layer as a specialization of an element in the same layer, thus eliminating copying and simplifying maintenance.




    Download 1.28 Mb.
    1   2   3   4   5   6   7   8   9   ...   95




    Download 1.28 Mb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Android Platform Developer's Guide

    Download 1.28 Mb.