| 1 | $Id: Build.txt 1356 2004-04-11 16:26:43Z bird $
 | 
|---|
| 2 | 
 | 
|---|
| 3 | 
 | 
|---|
| 4 | 1.0 Setting up the buildenvironment
 | 
|---|
| 5 | -----------------------------------
 | 
|---|
| 6 | 
 | 
|---|
| 7 | The build environment is selfcontained with the exception of EMX. However,
 | 
|---|
| 8 | some of the components changes rather often because of LIBC updates so these
 | 
|---|
| 9 | components are kept in .zips which have to be unzipped in the /tools
 | 
|---|
| 10 | directory. Go to tools/ and do unzip -o packages/*.zip.
 | 
|---|
| 11 | 
 | 
|---|
| 12 | The GCC is by default taken from tools/x86.os2/gcc/staged and you must put
 | 
|---|
| 13 | the latest build there for it to work. Installing the compiler to that
 | 
|---|
| 14 | directory is perhaps the best idea:
 | 
|---|
| 15 |     GCC-3.2.2-beta4.exe /unattended /directory=tools/x86.os2/gcc/staged
 | 
|---|
| 16 | 
 | 
|---|
| 17 | The build environment is loaded into the current shell (4os2 or cmd) by
 | 
|---|
| 18 | invoking tools\env.cmd. This rexx script takes two options:
 | 
|---|
| 19 |     -disable-staged-gcc / -enable-staged-gcc:
 | 
|---|
| 20 |         Use the staged gcc or the gcc322 BuildEnv. For the latter you'll
 | 
|---|
| 21 |         have to put configure gcc322 using tools\buildenv.cmd if you haven't
 | 
|---|
| 22 |         already done so globally for another project.
 | 
|---|
| 23 | 
 | 
|---|
| 24 |     -install / -uninstall:
 | 
|---|
| 25 |         Install or uninstall the GCC buildenvironment. Installing it is
 | 
|---|
| 26 |         naturally default. (Not sure how well -uninstall works actually.)
 | 
|---|
| 27 | 
 | 
|---|
| 28 | The rexx script takes one optional argument:
 | 
|---|
| 29 |     RELEASE / DEBUG:
 | 
|---|
| 30 |         Specifies the build mode/type which is to be default for the
 | 
|---|
| 31 |         environment. Default is (of course) DEBUG.
 | 
|---|
| 32 | 
 | 
|---|
| 33 | 
 | 
|---|
| 34 | 
 | 
|---|
| 35 | 2.0 Building
 | 
|---|
| 36 | ------------
 | 
|---|
| 37 | 
 | 
|---|
| 38 | The default for all is a simple build of all the components, no compiler
 | 
|---|
| 39 | bootstrapping. However we do a little LIBC bootstrapping underways, i.e.
 | 
|---|
| 40 | LIBC is build first and installed to a temporary location which figures
 | 
|---|
| 41 | before the GCC one in all the PATHs. Thus the LIBC we build will be used
 | 
|---|
| 42 | to build the rest. This will happen for the other libraries, tools,
 | 
|---|
| 43 | binutils and gcc as we go along.
 | 
|---|
| 44 | 
 | 
|---|
| 45 | This build type is called 'quick'.
 | 
|---|
| 46 | 
 | 
|---|
| 47 | 
 | 
|---|
| 48 | There is another build type, which is used for the release builds, which
 | 
|---|
| 49 | is called double-quick. It performs the 'quick' build twice thus ensuring
 | 
|---|
| 50 | that even everything is built with the same level of tools that we deliver.
 | 
|---|
| 51 | 
 | 
|---|
| 52 | Both 'quick' and 'double-quick' will log to obj/OS2/$(BUILD_MODE)/???.log,
 | 
|---|
| 53 | and will when all is built install it into bin/OS2/$(BUILD_MODE)/<reltag>.
 | 
|---|
| 54 | 
 | 
|---|
| 55 | 
 | 
|---|
| 56 | 2.1 Building parts
 | 
|---|
| 57 | ------------------
 | 
|---|
| 58 | 
 | 
|---|
| 59 | Individual components can be built, like for instance LIBC/EMX can be built
 | 
|---|
| 60 | from the src/emx directory. See help screen when invoking make there and the
 | 
|---|
| 61 | MoBuS documentation in src/emx/build.txt
 | 
|---|
| 62 | 
 | 
|---|
| 63 | Binutils and GCC are normal GNU build system stuff, which mean they require
 | 
|---|
| 64 | their Configure scripts to be run. This normally should be done by the root
 | 
|---|
| 65 | Makefile to get it right. There are special gcc-configure, binutils-configure
 | 
|---|
| 66 | rules for this. The object directories are in obj/OS2/$(BUILD_MODE)/gcc or
 | 
|---|
| 67 | binutils.
 | 
|---|
| 68 | TODO: Add emx-shell, gcc-shell and binutils-shell rules which will take you
 | 
|---|
| 69 | to the right place.
 | 
|---|
| 70 | 
 | 
|---|
| 71 | 
 | 
|---|
| 72 | 3.0 Packing
 | 
|---|
| 73 | -----------
 | 
|---|
| 74 | 
 | 
|---|
| 75 | There is a 'packing' rule. Just invoke this and packing will take place. To
 | 
|---|
| 76 | pack up the sources invoke the 'packing-src' rule. The 'installer' will only
 | 
|---|
| 77 | do the installer creation.
 | 
|---|
| 78 | 
 | 
|---|
| 79 | 
 | 
|---|