diff options
author | vbendeb <vbendeb@chromium.org> | 2010-06-24 16:19:53 -0700 |
---|---|---|
committer | vbendeb <vbendeb@chromium.org> | 2010-06-24 16:19:53 -0700 |
commit | 3ecaf776d82d29573be083b2e5c6ddc5b9f49c70 (patch) | |
tree | 3887c0749d73e45562a250c275f56eb4f5356613 /msc | |
parent | d6aad3a0888ad57383036dacdfc4c01f0c3b56e3 (diff) | |
download | vboot-3ecaf776d82d29573be083b2e5c6ddc5b9f49c70.tar.gz |
Make vboot_reference build in MSVC command line environment.
This is a mostly NOOP change which modifies the source code
to compile cleanly in the MSVC command line build
environment.
A new makefile is introduced (msc/nmakefile) along with a
README.txt in the same directory explaining how to build
the code in the DOS window. As of this submission the build
is running in a 32 bit environment, the intention is to use
the same makefile for 64 bit builds in the future.
Enabling high compilation warnings level allowed to
identify a couple of bugs in the code which are being fixed.
Not all sources are being compiled in the MSVC environment,
only those in firmware/ and most of those in test/
subdirectories. The benchmark calculations require porting
of the timer facilities and are being postponed.
TEST
Built in DOS and linux environments. Ran unit tests in
linux environment.
Review URL: http://codereview.chromium.org/2809037
Diffstat (limited to 'msc')
-rw-r--r-- | msc/README.txt | 25 | ||||
-rw-r--r-- | msc/nmakefile | 55 |
2 files changed, 80 insertions, 0 deletions
diff --git a/msc/README.txt b/msc/README.txt new file mode 100644 index 00000000..f22bac03 --- /dev/null +++ b/msc/README.txt @@ -0,0 +1,25 @@ +This directory contains the Microsoft Visual C makefile for building vboot +reference code (and testing, eventually) in a 32 bit DOS window. + +Microsoft Visual C 2008 (or later) is the prerequisite for this to work. + +To build vboot_reference tree in the DOS window do the following: + +- untar or git clone the vboot_reference source tree + +- open a DOS window + +- run the MSVC provided script vcvars32.bat to create the command line build + environment. Script location is MSVC installation specific. For instance: + + c:\> \bios\devtls\MSVC9\Vc\bin\vcvars32.bat + +- define a directory where the nmake output should go into + + c:\> set MOD=z:\shared\tmp + +- start the make job as follows: + + c:\> nmake /f %path_to_vboot_reference_tree%\msc\nmakefile + +- observe the output generated in %MOD% diff --git a/msc/nmakefile b/msc/nmakefile new file mode 100644 index 00000000..0fa98d0f --- /dev/null +++ b/msc/nmakefile @@ -0,0 +1,55 @@ + +!IF "$(MOD)" == "" +!ERROR MOD (Make output dir) is not defined +!ENDIF + +O = $(MOD) +R = z:\shared\vboot_reference + +ALL_OBJS = $O\main.obj $O\stateful_util.obj $O\cgptlib_internal.obj \ + $O\cgptlib.obj $O\crc32.obj $O\vboot_common.obj $O\vboot_kernel.obj \ + $O\vboot_firmware.obj $O\rollback_index.obj $O\sha_utility.obj $O\rsa.obj \ + $O\rsa_utility.obj $O\padding.obj $O\sha2.obj $O\sha1.obj \ + $O\load_firmware_stub.obj $O\tlcl.obj $O\utility_stub.obj \ + $O\boot_device_stub.obj $O\crc32_test.obj $O\rollback_index_mock.obj \ + $O\test_common.obj $O\cgptlib_test.obj $O\rsa_padding_test.obj \ + $O\sha_tests.obj $O\vboot_common_tests.obj $O\vboot_common2_tests.obj \ + $O\vboot_common3_tests.obj + +CFLAGS = $(CFLAGS) /I $R\firmware\lib\include +CFLAGS = $(CFLAGS) /I $R\firmware\lib\cgptlib\include +CFLAGS = $(CFLAGS) /I $R\firmware\include +CFLAGS = $(CFLAGS) /I $R\firmware\stub\include +CFLAGS = $(CFLAGS) /I $R\firmware\lib\cryptolib\include +CFLAGS = $(CFLAGS) /I $R\host\include + +CFLAGS = $(CFLAGS) /W4 /WX /D TARGET_TEST_MODE + +COMPILE = $(CC) $(CFLAGS) /Fo$@ -c $< + +all: $(ALL_OBJS) + +{$R\firmware\linktest}.c{$O}.obj: + $(COMPILE) + +{$R\firmware\lib}.c{$O}.obj: + $(COMPILE) + +{$R\firmware\lib\cgptlib}.c{$O}.obj: + $(COMPILE) + +{$R\firmware\lib\cryptolib}.c{$O}.obj: + $(COMPILE) + +{$R\firmware\stub}.c{$O}.obj: + $(COMPILE) + +{$R\tests}.c{$O}.obj: + $(COMPILE) + +#{$R\cgpt}.c{$O}.obj: +#$R/firmware/lib/cgptlibc.$O.obj: +#$R/firmware/lib/cryptolibc.$O.obj: +#$R/firmware/stubc.$O.obj: +#$R/utilityc.$O.obj: +# $(CC) $(CFLAGS) -Fd$O\ -c $< |