Copyright (c) 1997-2019 Alexei G. Malinin <Alexei.Malinin@mail.ru>

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without any warranty.


Building and installation instructions
======================================

In the very beginning iMBR was developed in MS-DOS v6.22 with Watcom C compiler
and assembler. Nowadays the primary development platform for iMBR is OpenBSD.
Also NetBSD and GNU/Linux are supported. iMBR for Windows can be prepared on
the above development platforms.


Required software
-----------------

= GCC
= [GNU] make
= mandoc
= standard UNIX utilities
- MinGW (for cross-building iMBR for Windows)
- [un]zip (for making the Windows distribution archive)


Building
--------

To build iMBR on OpenBSD, NetBSD, GNU/Linux:
1) unzip and untar the distribution iMBR-x.y.tgz source tarball:
	$ tar -zxvf iMBR-x.y.tgz
	$ cd iMBR-x.y
2) run the top level makefile:
	$ make

To cross-build iMBR for Windows:
3) install MinGW to /usr/local/mingw32;
4) install [un]zip [un]archiver;
5) run the top level makefile:
	$ make WINDOWS
6) make the iMBR Windows distribtion archive:
	$ make WINDOWS_PKG


Testing
-------

For testing (only for OpenBSD, NetBSD, GNU/Linux) purposes some programs
and scripts were developed:
- minimal PBR, which prints the CPU registers and flags values, and the
  partition number, the PBR has been booted from;
- MBR/PBR installer for real disks and disk images;
- several variants of MBR partition table;
- Bourne shell scripts for tests automation.

To get further instructions:
7) run the top level makefile:
	$ make tests


Installing
----------

To install iMBR on OpenBSD, NetBSD, GNU/Linux (root privileges may be
required):
8) run the top level makefile:
	# make DESTDIR=dir0/ prefix=dir install
   for example:
	# make DESTDIR=/ prefix=/usr/local install

To install iMBR on Windows:
1) unzip the Windows distribution archive iMBR-x.y.zip to, for example, "C:\";
2) check:
   - README.txt (and other *.txt files);
   - HTML manuals (pay attention to CAVEATS and BUGS sections).


