# $Id: Makefile.vc,v 1.13 2005/08/18 20:21:06 fwarmerdam Exp $
#
# Copyright (C) 2004, Andrey Kiselev <dron@remotesensing.org>
#
# Permission to use, copy, modify, distribute, and sell this software and 
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
# 
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
# 
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
# OF THIS SOFTWARE.
#
# Makefile for MS Visual C and Watcom C compilers.
#
# To build:
# C:\libtiff\libtiff> nmake /f makefile.vc all
#

#!INCLUDE ..\nmake.opt
AR = ar
CC = gcc
INCL	= -I. $(JPEG_INCLUDE) $(ZLIB_INCLUDE)

#!IFDEF USE_WIN_CRT_LIB
OBJ_SYSDEP_MODULE = tif_unix.o
#!ELSE
#OBJ_SYSDEP_MODULE = tif_win32.o
#!ENDIF
# missing files:    tif_stream.o

OBJ	= \
    tif_aux.o \
    tif_close.o \
    tif_codec.o \
    tif_color.o \
    tif_compress.o \
    tif_dir.o \
    tif_dirinfo.o \
    tif_dirread.o \
    tif_dirwrite.o \
    tif_dumpmode.o \
    tif_error.o \
    tif_extension.o \
    tif_fax3.o \
    tif_fax3sm.o \
    tif_getimage.o \
    tif_jpeg.o \
    tif_ojpeg.o \
    tif_flush.o \
    tif_luv.o \
    tif_lzw.o \
    tif_next.o \
    tif_open.o \
    tif_packbits.o \
    tif_pixarlog.o \
    tif_predict.o \
    tif_print.o \
    tif_read.o \
    tif_swab.o \
    tif_strip.o \
    tif_thunder.o \
    tif_tile.o \
    tif_version.o \
    tif_warning.o \
    tif_write.o \
    tif_zip.o \
	$(OBJ_SYSDEP_MODULE)

all:	libtiff.lib $(DLLNAME)

tif_config.h:
	copy tif_config.h.vc tif_config.h

tiffconf.h:
	copy tiffconf.h.vc tiffconf.h

libtiff.lib:	tif_config.h tiffconf.h $(OBJ)
	$(AR) rs libtiff.a $(OBJ) $(LIBS)

$(DLLNAME):	tif_config.h $(OBJ)
	$(LD) /debug /dll /def:libtiff.def /out:$(DLLNAME) \
	/implib:libtiff_i.lib $(OBJ) $(LIBS)
	
clean:
	-del *.obj *.lib *.dll *.exe


