Changeset 09c16269 in rtems


Ignore:
Timestamp:
05/26/00 17:17:40 (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
05ff78a
Parents:
3050704
Message:

Significant updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • make/README

    r3050704 r09c16269  
    55    make/README
    66
    7     This file describes the layout and conventions of the make tree used in
    8     the RTEMS software project and others.
     7    This file describes the layout and conventions of the application
     8    makefile support for RTEMS applications.  Internally, RTEMS uses
     9    GNU-style autoconf/automake Makefiles as much as possible to
     10    ease integration with other GNU tools.
     11
    912    All of these "make" trees are substantially similar; however this
    10     file documents the current state of the rtems Makefile tree.
    11 
    12     This make tree was developed originally to simplify porting projects
    13     between various os's.  The primary goals are:
     13    file documents the current state of the RTEMS Application Makefile
     14    support.
     15
     16    This make tree is based on a build system originally developed
     17    to simplify porting projects between various OS's.  The primary
     18    goals were:
    1419
    1520        .  simple *and* customizable individual makefiles
     
    1823            automatic generation of Makefiles.
    1924
    20         .  Same makefiles work on *many* host os's due to portability
    21             of GNU make and the host os config files.
     25        .  Same makefiles work on *many* host OS's due to portability
     26            of GNU make and the host OS config files.
    2227
    2328        .  Support for different compilers and operating systems
     
    3641            when you 'make' as everyone else on the project.
    3742
     43    This Makefile system has evolved into its present form and as it
     44    exists in RTEMS today, its sole goal is to build RTEMS applications.
     45    The use of these Makefiles hides the complexity of producing
     46    executables for a wide variety of embedded CPU families and target
     47    BSPs.  Switching between RTEMS BSPs is accomplished via setting
     48    the environment variable "RTEMS_MAKEFILE_PATH."
     49
    3850    This description attempts to cover all aspects of the Makefile tree.  Most
    3951    of what is described here is maintained automatically by the configuration
     
    89101    recurse into) in one source directory.  Ie., a directory in the source
    90102    tree may contain EITHER source files OR recursive sub directories, but NOT
    91     both.
     103    both.  This assumption is generally shared with GNU automake.
    92104
    93105    Variants (where objects go)
     
    97109        example):
    98110
    99             o-pc386/                -- binaries (no debug, no profile)
    100             o-pc386-debug/          -- debug binaries
    101             o-pc386-profile/        -- profiling binaries
    102 
    103         Using the template Makefiles, this will all happen automatically.
    104 
    105         Within a Makefile, the ${ARCH} variable is set to o-pc386,
    106         o-pc386-debug, etc., as appropriate.
    107 
    108         Typing 'make' will place objects in o-pc386.
    109         'make debug' will place objects in o-pc386-debug.
    110         'make profile' will place objects in o-pc386-profile.
    111 
    112         NOTE:  For RTEMS work, the word 'pc386' is the specified
    113                RTEMS_BSP (specified in the modules file)
     111            o-optimize/       -- optimized binaries
     112            o-debug/          -- debug binaries
     113            o-profile/        -- profiling binaries
     114
     115        Using the template Makefiles, this will all happen automatically.
     116        The contents of these directories are specific to a BSP.
     117
     118        Within a Makefile, the ${ARCH} variable is set to o-optimize,
     119        o-debug, etc., as appropriate.
     120
     121        HISTORICAL NOTE: Prior to version 4.5, the name of the sub-directory
     122          in which objects were placed included the BSP name.
     123           
     124        Typing 'make' will place objects in o-optimize.
     125        'make debug' will place objects in o-debug.
     126        'make profile' will place objects in o-profile.
    114127
    115128        The debug and profile targets are equivalent to 'all' except that
     
    117130        debug and profile support.
    118131
    119         The targets debug, profile, etc., can be
    120         invoked recursively at the directory make level.  So from the top of a
    121         tree, one could install a debug version of everything under that point
    122         by:
     132        The targets debug, profile, etc., can be invoked recursively at
     133        the directory make level.  So from the top of a tree, one could
     134        install a debug version of everything under that point by:
    123135
    124136            $ cd src/lib
     
    132144        profile version of "libmine.a" as appropriate:
    133145
    134             LDLIBS   += $(LIBMINE)
     146            LD_LIBS   += $(LIBMINE)
    135147            LIBMINE = ../libmine/${ARCH}/libmine.a
    136148
    137149            ${ARCH}/pgm: $(LIBMINE) ${OBJS}
    138                 $(LINK.c) -o $@ ${OBJS} $(LDLIBS)
     150                $(make-exe)
    139151
    140152        If we do 'gmake debug', then the library in
    141         ../libmine/sparc-debug/libmine.a will be linked in.  If $(LIBMINE)
     153        ../libmine/o-debug/libmine.a will be linked in.  If $(LIBMINE)
    142154        might not exist (or might be out of date) at this point, we could add
    143155
     
    166178
    167179            clean                   -- delete all targets
    168             clobber                 -- 'clean' plus delete sccs'd files
    169             lint                    -- run lint or lint-like tool
    170             get                     -- "sccs get" all sources
    171180            depend                  -- build a make dependency file
    172181            "variant targets"       -- special variants, see below
     
    187196        All Makefiles include a customization file which is used to select
    188197        compiler and host operating system.  The environment variable
    189         RTEMS_CUSTOM must point to this file; eg:
    190 
    191                 /.../make/custom/pc386.cfg
     198        RTEMS_MAKEFILE_PATH must point to the directory containing this file; eg:
     199
     200                export RTEMS_MAKEFILE_PATH=/.../pc386/
    192201
    193202        All leaf Makefile's also include either 'make/leaf.cfg' (or
     
    210219
    211220
    212         private customization files
    213         ---------------------------
    214 
    215             [ $(RTEMS_CUSTOM) ]
    216 
    217             Your own private configuration file.  Specifies which of the above
    218             files you want to include.
    219 
    220221        generic rules file
    221222        ------------------
     
    258259
    259260        Variables you have to set in the environment or in your Makefile.
    260         Note: the rtems module files set RTEMS_ROOT and RTEMS_CUSTOM
     261        Note: the RTEMS module files set RTEMS_ROOT and RTEMS_CUSTOM
    261262        for you.
    262263
    263         Environment Variables
    264         ---------------------
    265 
    266             RTEMS_BSP      -- name of your 'bsp' eg: pc386
     264        Makefile Variables
     265        ------------------
     266
     267            RTEMS_BSP        -- name of your 'bsp' eg: pc386, mvme136
     268
     269            RTEMS_CPU        -- CPU architecture e.g.: i386, m68k
     270
     271            RTEMS_CPU_FAMILY -- CPU model e.g.: i486dx, m68020
    267272
    268273            RTEMS_ROOT     -- The root of your source tree.
    269274                              All other file names are derived from this.
    270                               [ eg: % setenv RTEMS_ROOT $HOME/work/rtems ]
     275                              [ eg: % setenv RTEMS_ROOT $HOME/work/RTEMS ]
    271276
    272277            RTEMS_CUSTOM   -- name of your config files in make/custom
     
    274279                                 $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
    275280
    276             RTEMS_GNUTOOLS -- root of the gcc tools for the target
    277 
    278281            The value RTEMS_ROOT is used in the custom
    279282            files to generate the make(1) variables:
    280283
    281                 PROJECT_ROOT
    282284                PROJECT_RELEASE
     285                PROJECT_BIN
     286                PROJECT_INCLUDE
    283287                PROJECT_TOOLS
    284288
     
    290294        ----------------
    291295
    292             Aside from command names set by the os and compiler config files,
     296            Aside from command names set by the OS and compiler config files,
    293297            a number of MAKE variables are automatically set and maintained by
    294298            the config files.
     
    306310                           [ eg: $(PROJECT_ROOT)/build-tools ]
    307311
    308             TARCH       -- ${TARGET_ARCH}
    309                            [ eg: o-forc386 ]
    310                            obsolete and should not be referenced
    311 
    312312            ARCH        -- target sub-directory for object code
    313                            [ eg: o-pc386 or o-pc386-debug ]
     313                           [ eg: o-optimize or o-debug ]
    314314
    315315            VARIANTS    -- full list of all possible values for $(ARCH);
    316316                           used mainly for 'make clean'
    317                            [ eg: "o-pc386 o-pc386-debug o-pc386-profile" ]
     317                           [ eg: "o-optimize o-debug o-profile" ]
    318318
    319319            VARIANT_VA  -- Variant name.
     
    356356                                    -Bdynamic or -dn (svr4)
    357357
    358             LIB_SOCKET
    359                                 -- ld(1) -l option(s) to provide
    360                                     socket support.
    361 
    362             LIB_MATH            -- ld(1) -l option(s) to provide
    363                                     math library.
    364 
    365 
    366358            Makefile Variables
    367359            ------------------
     
    389381                               leaf Makefiles.
    390382                               [ eg: CPPFLAGS += -I../include ]
    391 
    392                 YFLAGS      -- Yacc flags.
    393                                leaf Makefiles.
    394                                [ eg: YFLAGS += -v ]
    395383
    396384                LD_PATHS    -- arguments to -L for ld.
     
    435423                               you don't need to duplicate items in both.
    436424
    437                 TARGET_ARCH -- target architecture (eg: o-pc386)
    438                                leaf makefiles only.
    439                                Should be specified before 'include leaf.cfg'.
    440                                Only needs to be specified if your target is
    441                                different from output of `arch`.
    442 
    443425            Command names
    444426            -------------
     
    449431                    MAKE,INSTALL,SHELL
    450432
    451                     ECHO,CAT,RM,CP,MV,LN,MKDIR,CHMOD
    452 
    453                     ED,SED
     433                    ECHO,CAT,CP,MV,LN,MKDIR,CHMOD
     434
     435                    SED
    454436
    455437                    CC,CPP,AS,AR,LD,NM,SIZE,RANLIB,MKLIB,
Note: See TracChangeset for help on using the changeset viewer.