Changeset 09c16269 in rtems
- Timestamp:
- 05/26/00 17:17:40 (23 years ago)
- Children:
- 05ff78a
- Parents:
- 3050704
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
make/README
r3050704 r09c16269 5 5 make/README 6 6 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 9 12 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: 14 19 15 20 . simple *and* customizable individual makefiles … … 18 23 automatic generation of Makefiles. 19 24 20 . Same makefiles work on *many* host os's due to portability21 of GNU make and the host osconfig files.25 . Same makefiles work on *many* host OS's due to portability 26 of GNU make and the host OS config files. 22 27 23 28 . Support for different compilers and operating systems … … 36 41 when you 'make' as everyone else on the project. 37 42 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 38 50 This description attempts to cover all aspects of the Makefile tree. Most 39 51 of what is described here is maintained automatically by the configuration … … 89 101 recurse into) in one source directory. Ie., a directory in the source 90 102 tree may contain EITHER source files OR recursive sub directories, but NOT 91 both. 103 both. This assumption is generally shared with GNU automake. 92 104 93 105 Variants (where objects go) … … 97 109 example): 98 110 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. 114 127 115 128 The debug and profile targets are equivalent to 'all' except that … … 117 130 debug and profile support. 118 131 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: 123 135 124 136 $ cd src/lib … … 132 144 profile version of "libmine.a" as appropriate: 133 145 134 LD LIBS += $(LIBMINE)146 LD_LIBS += $(LIBMINE) 135 147 LIBMINE = ../libmine/${ARCH}/libmine.a 136 148 137 149 ${ARCH}/pgm: $(LIBMINE) ${OBJS} 138 $( LINK.c) -o $@ ${OBJS} $(LDLIBS)150 $(make-exe) 139 151 140 152 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) 142 154 might not exist (or might be out of date) at this point, we could add 143 155 … … 166 178 167 179 clean -- delete all targets 168 clobber -- 'clean' plus delete sccs'd files169 lint -- run lint or lint-like tool170 get -- "sccs get" all sources171 180 depend -- build a make dependency file 172 181 "variant targets" -- special variants, see below … … 187 196 All Makefiles include a customization file which is used to select 188 197 compiler and host operating system. The environment variable 189 RTEMS_ CUSTOM must point tothis file; eg:190 191 /.../make/custom/pc386.cfg198 RTEMS_MAKEFILE_PATH must point to the directory containing this file; eg: 199 200 export RTEMS_MAKEFILE_PATH=/.../pc386/ 192 201 193 202 All leaf Makefile's also include either 'make/leaf.cfg' (or … … 210 219 211 220 212 private customization files213 ---------------------------214 215 [ $(RTEMS_CUSTOM) ]216 217 Your own private configuration file. Specifies which of the above218 files you want to include.219 220 221 generic rules file 221 222 ------------------ … … 258 259 259 260 Variables you have to set in the environment or in your Makefile. 260 Note: the rtemsmodule files set RTEMS_ROOT and RTEMS_CUSTOM261 Note: the RTEMS module files set RTEMS_ROOT and RTEMS_CUSTOM 261 262 for you. 262 263 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 267 272 268 273 RTEMS_ROOT -- The root of your source tree. 269 274 All other file names are derived from this. 270 [ eg: % setenv RTEMS_ROOT $HOME/work/ rtems]275 [ eg: % setenv RTEMS_ROOT $HOME/work/RTEMS ] 271 276 272 277 RTEMS_CUSTOM -- name of your config files in make/custom … … 274 279 $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg 275 280 276 RTEMS_GNUTOOLS -- root of the gcc tools for the target277 278 281 The value RTEMS_ROOT is used in the custom 279 282 files to generate the make(1) variables: 280 283 281 PROJECT_ROOT282 284 PROJECT_RELEASE 285 PROJECT_BIN 286 PROJECT_INCLUDE 283 287 PROJECT_TOOLS 284 288 … … 290 294 ---------------- 291 295 292 Aside from command names set by the osand compiler config files,296 Aside from command names set by the OS and compiler config files, 293 297 a number of MAKE variables are automatically set and maintained by 294 298 the config files. … … 306 310 [ eg: $(PROJECT_ROOT)/build-tools ] 307 311 308 TARCH -- ${TARGET_ARCH}309 [ eg: o-forc386 ]310 obsolete and should not be referenced311 312 312 ARCH -- target sub-directory for object code 313 [ eg: o- pc386 or o-pc386-debug ]313 [ eg: o-optimize or o-debug ] 314 314 315 315 VARIANTS -- full list of all possible values for $(ARCH); 316 316 used mainly for 'make clean' 317 [ eg: "o- pc386 o-pc386-debug o-pc386-profile" ]317 [ eg: "o-optimize o-debug o-profile" ] 318 318 319 319 VARIANT_VA -- Variant name. … … 356 356 -Bdynamic or -dn (svr4) 357 357 358 LIB_SOCKET359 -- ld(1) -l option(s) to provide360 socket support.361 362 LIB_MATH -- ld(1) -l option(s) to provide363 math library.364 365 366 358 Makefile Variables 367 359 ------------------ … … 389 381 leaf Makefiles. 390 382 [ eg: CPPFLAGS += -I../include ] 391 392 YFLAGS -- Yacc flags.393 leaf Makefiles.394 [ eg: YFLAGS += -v ]395 383 396 384 LD_PATHS -- arguments to -L for ld. … … 435 423 you don't need to duplicate items in both. 436 424 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 is441 different from output of `arch`.442 443 425 Command names 444 426 ------------- … … 449 431 MAKE,INSTALL,SHELL 450 432 451 ECHO,CAT, RM,CP,MV,LN,MKDIR,CHMOD452 453 ED,SED433 ECHO,CAT,CP,MV,LN,MKDIR,CHMOD 434 435 SED 454 436 455 437 CC,CPP,AS,AR,LD,NM,SIZE,RANLIB,MKLIB,
Note: See TracChangeset
for help on using the changeset viewer.