#
# %CopyrightBegin%
# 
# Copyright Ericsson AB 1999-2009. All Rights Reserved.
# 
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
# 
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
# 
# %CopyrightEnd%
#
#

CC = cl.exe
LIBRARIAN = lib.exe /nologo

IC_INCLUDE = ..\include
EI_INCLUDE = \erts\lib\erl_interface\src

CFLAGS = /MT /nologo /Ox /I$(IC_INCLUDE) /I$(EI_INCLUDE)
TARGET = win32
OBJDIR = ..\priv\obj\$(TARGET)
LIBDIR = ..\priv\lib\$(TARGET)


C_FILES = \
	ic.c \
	oe_ei_encode_version.c      \
	oe_ei_encode_long.c         \
	oe_ei_encode_ulong.c        \
	oe_ei_encode_double.c       \
	oe_ei_encode_char.c         \
	oe_ei_encode_string.c       \
	oe_ei_encode_atom.c         \
	oe_ei_encode_pid.c          \
	oe_ei_encode_port.c         \
	oe_ei_encode_ref.c          \
	oe_ei_encode_term.c         \
	oe_ei_encode_tuple_header.c \
	oe_ei_encode_list_header.c  \
	oe_ei_encode_longlong.c     \
	oe_ei_encode_ulonglong.c    \
	oe_ei_encode_wchar.c        \
	oe_ei_encode_wstring.c      \
	oe_ei_decode_longlong.c     \
	oe_ei_decode_ulonglong.c    \
	oe_ei_decode_wchar.c        \
	oe_ei_decode_wstring.c

OBJ_FILES = \
	$(OBJDIR)\ic.obj \
	$(OBJDIR)\oe_ei_encode_version.obj      \
	$(OBJDIR)\oe_ei_encode_long.obj         \
	$(OBJDIR)\oe_ei_encode_ulong.obj        \
	$(OBJDIR)\oe_ei_encode_double.obj       \
	$(OBJDIR)\oe_ei_encode_char.obj         \
	$(OBJDIR)\oe_ei_encode_string.obj       \
	$(OBJDIR)\oe_ei_encode_atom.obj         \
	$(OBJDIR)\oe_ei_encode_pid.obj          \
	$(OBJDIR)\oe_ei_encode_port.obj         \
	$(OBJDIR)\oe_ei_encode_ref.obj          \
	$(OBJDIR)\oe_ei_encode_term.obj         \
	$(OBJDIR)\oe_ei_encode_tuple_header.obj \
	$(OBJDIR)\oe_ei_encode_list_header.obj  \
	$(OBJDIR)\oe_ei_encode_longlong.obj     \
	$(OBJDIR)\oe_ei_encode_ulonglong.obj    \
	$(OBJDIR)\oe_ei_encode_wchar.obj        \
	$(OBJDIR)\oe_ei_encode_wstring.obj      \
	$(OBJDIR)\oe_ei_decode_longlong.obj     \
	$(OBJDIR)\oe_ei_decode_ulonglong.obj    \
	$(OBJDIR)\oe_ei_decode_wchar.obj        \
	$(OBJDIR)\oe_ei_decode_wstring.obj


LIBRARY = $(LIBDIR)\ic.lib


all: $(OBJDIR) $(LIBDIR) $(LIBRARY)

release:
	echo "Nothing to do"

clean:
	-del $(OBJ_FILES) $(LIBRARY)

$(LIBRARY): $(OBJ_FILES)
	$(LIBRARIAN) /OUT:$@ $**
	
{}.c{$(OBJDIR)}.obj:
	$(CC) $(CFLAGS) /c /Fo$@ $<

$(OBJDIR):
	-mkdir $(OBJDIR)

$(LIBDIR):
	-mkdir $(LIBDIR)

$(LIBRARY): 


{}.c: $(EI_INCLUDE)\ei.h $(IC_INCLUDE)\ic.