# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

!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 $<