Changeset 051ab3b in rtems


Ignore:
Timestamp:
Oct 20, 1998, 7:27:13 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
71f575e5
Parents:
ee3dd9ae
Message:

Links between chapters up to Linker Script in place.

First draft of chapters up to and include Makefiles written.

Location:
doc/bsp_howto
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/bsp_howto/Makefile

    ree3dd9ae r051ab3b  
    7575        $(BMENU) -p "Target Dependent Files Board Support Package Structure" \
    7676            -u "Top" \
    77             -n "" ${*}.t
     77            -n "Linker Script" ${*}.t
    7878
    7979linkcmds.texi: linkcmds.t Makefile
    80         $(BMENU) -p "" \
     80        $(BMENU) -p "Makefiles Creating a New BSP Make Customization File" \
    8181            -u "Top" \
    8282            -n "" ${*}.t
  • doc/bsp_howto/makefiles.t

    ree3dd9ae r051ab3b  
    1111@section Makefiles Used During The BSP Building Process
    1212
    13 There's a makefile template in each directory of a BSP. They are called
    14 "makefile.in" and are processed when building RTEMS for a given BSP. One
    15 should specify the needed files and directories before the building
    16 process.
     13There is a file named @code{Makefile.in} in each directory of a BSP.
     14RTEMS uses the @b{GNU autoconf} automatic configuration package.
     15This tool specializes the @code{Makefile.in} files at the time that RTEMS
     16is configured for a specific development host and target.  Makefiles
     17are automatically generated from the @code{Makefile.in} files.  It is
     18necessary for the BSP developer to provide these files.  Most of the
     19time, it is possible to copy the @code{Makefile.in} from another
     20similar directory and edit it.
     21
     22The @code{Makefile} files generated are processed when building
     23RTEMS for a given BSP.
     24
     25The BSP developer is responsible for generating @code{Makefile.in}
     26files which properly build all the files associated with their BSP.
     27There are generally three types of Makefiles in a BSP source tree:
     28
    1729
    1830@itemize @bullet
    19 
    20 @item the makefile.in at the BSP root specifies which folders have to be
    21 included. For instance,
    22 
    23 @item We only build the networking device driver if HAS_NETWORKING was defined
     31@item Directory Makefiles
     32@item Source Directory Makefiles
     33@item Wrapup Makefile
     34@end itemize
     35
     36@subsection Directory Makefiles
     37
     38The Directory class of Makefiles directs the build process through
     39a set of subdirectories in a particular order.  This order is usually
     40chosen to insure that build dependencies are properly processed.
     41Most BSPs only have one Directory class Makefile.  The @code{Makefile.in}
     42in the BSP root directory (@code{c/src/lib/libbsp/CPU/BSP}) specifies
     43which directories are to be built for this BSP. For example, the
     44following Makefile fragment shows how a BSP would only build the
     45networking device driver if HAS_NETWORKING was defined:
    2446
    2547@example
     
    3355@end example
    3456
    35 states that all the directories have to be processed, except for the
    36 network directory which is included only if the user asked for it when
    37 building RTEMS.
    38 
    39 @item the makefile.in in each driver directory. It lists the files to be
    40 included in the driver, so don't forget to add the reference to a new file
    41 in the makefile.in of a given driver when it is created!
    42 
    43 @end itemize
    44 
    45 
    46 Rem : the makefile.in files are ONLY processed during the configure
     57This fragment states that all the directories have to be processed,
     58except for the @code{network} directory which is included only if the
     59user configured networking.
     60
     61@subsection Source Directory Makefiles
     62
     63There is a @code{Makefile.in} in most of the directories in a BSP. This
     64class of Makefile lists the files to be built as part of the driver.
     65Do not forget to add the reference to a new file in the @code{Makefile.in}
     66it is created!
     67
     68@b{NOTE:} The @code{Makefile.in} files are ONLY processed during the configure
    4769process of a RTEMS build. It means that, when you're working on the design
    4870of your BSP, and that you're adding a file to a folder and to the
    49 corresponding makefile.in, it will not be take n into account! You have to
    50 run configure again or modify the makefile (result of the makefile.in
    51 process, usually in your <the RTEMS build
    52 directory>/c/src/lib/libbsp/<your BSP family>/<your BSP>/<your driver>
    53 directory) by hand.
     71corresponding makefile.in, it will not be taken into account! You have to
     72run configure again or modify the @code{Makefile} (the result of the
     73configure process) by hand.  This file will be in a directory such as
     74the following:
     75
     76@example
     77MY_BUILD_DIR/c/src/lib/libbsp/CPU/BSP/DRIVER
     78@end example
     79
     80@subsection Wrapup Makefile
     81
     82This class of Makefiles produces a library.  The BSP wrapup Makefile
     83is responsible for producing the library @code{libbsp.a} which is later
     84merged into the @code{librtemsall.a} library.  This Makefile specifies
     85which BSP components are to be placed into the library as well as which
     86components from the CPU dependent support code library.  For example,
     87this component may choose to use a default exception handler from the
     88CPU dependent support code or provide its own.
     89
     90This Makefile makes use of a neat construct in @b{GNU make} to pick
     91up the required components:
     92
     93@example
     94BSP_PIECES=startup clock console timer
     95CPU_PIECES=
     96GENERIC_PIECES=
     97
     98# bummer; have to use $foreach since % pattern subst rules only replace 1x
     99OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
     100   $(foreach piece, $(CPU_PIECES), \
     101       ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \
     102   $(wildcard \
     103  ../../../../libcpu/$(RTEMS_CPU)/$(RTEMS_CPU_MODEL)/fpsp/$(ARCH)/fpsp.rel) \
     104   $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel)
     105@end example
     106
     107The variable @code{OBJS} is the list of "pieces" expanded to include
     108path information to the appropriate object files.  The @code{wildcard}
     109function is used on pieces of @code{libbsp.a} which are optional and
     110may not be present based upon the configuration options.
    54111
    55112@section Makefiles Used Both During The BSP Design and its Use
    56113
    57 A BSP must go with his configuration file. The configuration files can be
    58 found under $RTEMS_ROOT/c/make/custom. The configuration file is taken
    59 into account when building one's application using the template makefiles
    60 ($RTEMS_ROOT/c/make/templates), whic h is strongly advised. There are
    61 templates for calling recursively the makefiles in the directories beneath
    62 the current one, building a library or an executable.
    63 
    64 The following is a hevaily commented version of the make customization
    65 file for the gen68340 BSP.  It can be found in the $RTEMS_ROOT/make/custom
    66 directory.
     114When building a BSP or an application using that BSP, it is necessary
     115to tailor the compilation arguments to account for compiler flags, use
     116custom linker scripts, include the RTEMS libraries, etc..  The BSP
     117must be built using this information.  Later, once the BSP is installed
     118with the toolset, this same information must be used when building the
     119application.  So a BSP must include a build configuration file.  The
     120configuration file is @code{make/custom/BSP.cfg}.
     121
     122The configuration file is taken into account when building one's
     123application using the RTEMS template Makefiles (@code{make/templates}).
     124It is strongly advised to use these template Makefiles since they
     125encapsulate a number of build rules along with the compile and link
     126time options necessary to execute on the target board.
     127
     128There are template Makefiles provided for each of the classes of RTEMS
     129Makefiles.  This include Makefiles to:
     130
     131@itemize @bullet
     132@item call recursively the makefiles in the directories beneath
     133the current one,
     134
     135@item build a library, or
     136
     137@item build an executable.
     138
     139@end itemize
     140
     141The following is a shortened and heavily commented version of the
     142make customization file for the gen68340 BSP.  The original source
     143for this file can be found in the @code{make/custom} directory.
    67144
    68145@example
     
    111188@end example
    112189
    113 
    114 
    115 What you have to do:
     190@subsection Creating a New BSP Make Customization File
     191
     192The basic steps for creating a @code{make/custom} file for a new BSP
     193is as follows:
    116194
    117195@itemize @bullet
    118196
    119 @item copy any .cfg file to <your BSP>.cfg
    120 
    121 @item modify RTEMS_CPU, TARGET_ARCH, RTEMS_CPU_MODEL, RTEMS_BSP_FAMILY,
    122 RTEMS_BSP, CPU_CFLAGS, START_BASE accordingly.
     197@item copy any @code{.cfg} file to @code{BSP.cfg}
     198
     199@item modify RTEMS_CPU, RTEMS_CPU_MODEL, RTEMS_BSP_FAMILY,
     200RTEMS_BSP, CPU_CFLAGS, START_BASE, and make-exe rules.
    123201
    124202@end itemize
    125203
    126 
     204It is generally easier to copy a @code{make/custom} file which is for a
     205BSP close to your own.
     206
     207
  • doc/bsp_howto/target.t

    ree3dd9ae r051ab3b  
    2727routines for the executive proper such as as the context switch and
    2828the interrupt subroutine implementations.  Sources for the supported
    29 processor families can be found in @code{$RTEMS_ROOT/c/src/exec/score/cpu}.
     29processor families can be found in @code{c/src/exec/score/cpu}.
    3030A good starting point for a new family of processors is the
    3131@code{no_cpu} directory, which holds both prototypes and
     
    192192This structure is discussed in more detail in the @ref{Makefiles}
    193193chapter.
    194 RTEMS uses the @b{GNU autoconf} automatic configuration package.  This
    195 tool specializes the @code{Makefile.in} files at the time that RTEMS
    196 is configured for a specific development host and target.  Makefiles
    197 are automatically generated from the @code{Makefile.in} files.  It is
    198 necessary for the BSP developer to provide these files.  Most of the
    199 time, it is possible to copy the @code{Makefile.in} from another
    200 similar directory and edit it.
    201194
    202195@b{NOTE:} This manual refers to the gen68340 BSP for numerous concrete
Note: See TracChangeset for help on using the changeset viewer.