# -*- Mode: Makefile -*-
#
# $Header: /home/gene/library/website/docsrc/cloop/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 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 General Public License for more details.
#
# You should have received a copy of the GNU 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".
#

CC=cl
CFLAGS=/nologo /DCLOOP_WINDOWS=1
COMPILE_c=$(CC) $(CFLAGS) /c
LINK_c=$(CC) $(CFLAGS)

CXXFLAGS=/nologo /DCLOOP_WINDOWS=1 /EHsc
COMPILE_cxx=$(CC) $(CXXFLAGS) /TP /c
LINK_cxx=$(CC) $(CXXFLAGS)

LIBS=lib\cloop.lib Gdi32.lib Ws2_32.lib user32.lib

all :	\
	bin/demow000.exe \
	bin/test0000.exe \
	bin/test0001.exe \
	bin/testw002.exe \
	bin/testw003.exe \
	bin/testw004.exe \
	bin/testw005.exe

check : all
	bin\test0000
	bin\test0001
	bin\testw002
	bin\testw003
	bin\testw004
	bin\testw005

HEADERS=src/cloop.h src/getopt.h src/teq.h src/this.h src/timeevent.h src/types.h src/xmalloc.h

OBJS=	tmp\bzero.obj tmp\cloop-windows.obj tmp\getopt.obj tmp\teq.obj \
	tmp\timeevent.obj tmp\xmalloc.obj

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

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

tmp/cloop-windows.obj : src/cloop-windows.cxx $(HEADERS)
	$(COMPILE_cxx) /Fotmp\cloop-windows.obj src\cloop-windows.cxx

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

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

tmp/timeevent.obj : src/timeevent.cxx
	$(COMPILE_cxx) /Fotmp\timeevent.obj src\timeevent.cxx

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

bin/demow000.exe : src/demow000.cpp $(HEADERS) lib/cloop.lib
	$(LINK_cxx) /Febin\demow000.exe src\demow000.cpp $(LIBS)

bin/test0000.exe : src/test0000.c
	$(LINK_c) /Febin\test0000.exe src\test0000.c

bin/test0001.exe : src/test0001.c $(HEADERS)
	$(LINK_c) /Febin\test0001.exe src\test0001.c

bin/testw002.exe : src/testw002.c $(HEADERS) lib/cloop.lib
	$(LINK_c) /Febin\testw002.exe src\testw002.c $(LIBS)

bin/testw003.exe : src/testw003.cxx $(HEADERS) lib/cloop.lib
	$(LINK_cxx) /Febin\testw003.exe src\testw003.cxx $(LIBS)

bin/testw004.exe : src/testw004.cxx $(HEADERS) lib/cloop.lib
	$(LINK_cxx) /Febin\testw004.exe src\testw004.cxx $(LIBS)

bin/testw005.exe : src/testw005.cxx $(HEADERS) lib/cloop.lib
	$(LINK_cxx) /Febin\testw005.exe src\testw005.cxx $(LIBS)

# --- end of file ---
