# -*- Mode: Makefile -*-
#
# $Header: /home/gene/library/website/docsrc/exrtoppm/RCS/Makefile.w32,v 395.1 2008/04/20 17:25:50 gene Exp $
#
# Copyright (c) 2006 Gene Michael Stover.  All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
# USA
#

#
# Makefile for Microsloth Winders.
# Instead of running "nmake -fMakefile.w32", it's probably better
# to run ".\build".
#

OPENEXR=c:\src\openexr-1.4.0-vsnet2003\lib

LIBS=lib\this.lib $(OPENEXR)\IlmImf_dll.lib $(OPENEXR)\Half_dll.lib $(OPENEXR)\Imath_dll.lib 

CC=cl
CFLAGS=/nologo "/Ic:\src\openexr-1.4.0-vsnet2003\include\OpenEXR" "/Ic:\Program Files\GnuWin32\include" /DOPENEXR_DLL=1
COMPILE_c=$(CC) $(CFLAGS) /c
LINK_c=$(CC) /nologo

CXX=$(CC)
CXXFLAGS=$(CFLAGS) /EHsc
COMPILE_cxx=$(CXX) $(CXXFLAGS) /c
LINK_cxx=$(LINK_c) $(CXXFLAGS)

# LIBS=lib\this.lib "c:\src\openexr-1.4.0-vsnet2003\lib\IlmImf.lib" "c:\src\openexr-1.4.0-vsnet2003\lib\zlib.lib" "c:\src\openexr-1.4.0-vsnet2003\lib\Imath.lib"
HEADERS=src/ppmpixel.h src/this.h

all :	\
	bin/exrtoppm.exe \
	bin/test0000.exe \
	bin/test0001.exe \
	bin/test0002.exe

check : all
	bin\test0000
	bin\test0001
	bin\test0002

bin/exrtoppm.exe : tmp/exrtoppm.obj lib/this.lib
	$(LINK_cxx) /Febin\exrtoppm.exe tmp\exrtoppm.obj $(LIBS)

tmp/exrtoppm.obj : src/exrtoppm.cpp $(HEADERS)
	$(COMPILE_cxx) src\exrtoppm.cpp /Fotmp\exrtoppm.obj

OBJS=tmp\getopt.obj tmp\pixel.obj

lib/this.lib : $(OBJS)
	lib /OUT:lib\this.lib $(OBJS)

tmp/getopt.obj : src/getopt.c $(HEADERS)
	$(COMPILE_c) src\getopt.c /Fotmp\getopt.obj

tmp/pixel.obj : src/pixel.cpp $(HEADERS)
	$(COMPILE_cxx) src\pixel.cpp /Fotmp\pixel.obj

bin/test0000.exe : tmp/test0000.obj
	link /NOLOGO /OUT:bin\test0000.exe tmp\test0000.obj

tmp/test0000.obj : src/test0000.c
	$(COMPILE_c) src\test0000.c /Fotmp\test0000.obj

bin/test0001.exe : tmp/test0001.obj
	link /NOLOGO /OUT:bin\test0001.exe tmp\test0001.obj

tmp/test0001.obj : src/test0001.c $(HEADERS)
	$(COMPILE_c) src\test0001.c /Fotmp\test0001.obj

bin/test0002.exe : tmp/test0002.obj lib/this.lib
	link /NOLOGO /OUT:bin\test0002.exe tmp\test0002.obj $(LIBS)

tmp/test0002.obj : src/test0002.c $(HEADERS)
	$(COMPILE_c) src\test0002.c /Fotmp\test0002.obj

# --- end of file ---
