# -*- Mode: Makefile -*-
# 
# $Header: /home/gene/library/website/docsrc/httpxtran/RCS/Makefile,v 395.1 2008/04/20 17:25:51 gene Exp $
#
# Copyright (c) 2005 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
#

# Include path for the C/C++ compiler
# incdir=/I "C:\Program Files\Microsoft SDK\include" /I "C:\Program Files\Microsoft Visual Studio\VC98\Include" /I "C:\Program Files\Microsoft Visual Studio\VC98\ATL\Include"
incdir=

CPP=cl.exe
RSC=rc.exe

CFLAGS=/DIS_WINDERS=1 /nologo /ML /W3 /GX /O2 /D "WIN32" /D "_CONSOLE" /Fo"tmp\\" /Fd"tmp\\" $(incdir)
# It had /D "_MBCS" after _CONSOLE.
# It had "/FD"immediately before /c.
COMPILE_c=$(CPP) $(CFLAGS) /c

LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:console /incremental:no

LINK_c=$(LINK32) $(LINK32_FLAGS)

LIBS=user32.lib Wininet.lib

###
### Common headers for C programs
###
HEADERS=src/debug.h src/log.h src/this.h src/xhttp.h src/winet.h src/xmalloc.h
OBJS=tmp/debug.obj tmp/getopt.obj tmp/log.obj tmp/winet.obj tmp/xhttp.obj tmp/xmalloc.obj

all :	bin/httpxtran.exe \
	bin/test0000.exe \
	bin/test0001.exe \
	bin/test0010.exe \
	bin/test0011.exe \
	bin/test0012.exe

check : all
	bin\test0000
	bin\test0001
	bin\test0010
	bin\test0011
	bin\test0012

clean : 
	-erase tmp\*.obj

bin/httpxtran.exe : tmp/httpxtran.obj lib/this.lib
	$(LINK_c) /out:bin\httpxtran.exe tmp\httpxtran.obj lib\this.lib $(LIBS)

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

lib/this.lib : $(OBJS) src/this.def
	lib @src\this.def

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

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

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

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

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

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

bin/test0000.exe : tmp/test0000.obj lib/this.lib
	$(LINK_c) /out:bin\test0000.exe tmp\test0000.obj lib\this.lib

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

bin/test0001.exe : tmp/test0001.obj lib/this.lib
	$(LINK_c) /out:bin\test0001.exe tmp\test0001.obj lib\this.lib

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

bin/test0010.exe : tmp/test0010.obj lib/this.lib
	$(LINK_c) /out:bin\test0010.exe tmp\test0010.obj lib\this.lib $(LIBS)

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

bin/test0011.exe : tmp/test0011.obj lib/this.lib
	$(LINK_c) /out:bin\test0011.exe tmp\test0011.obj lib\this.lib $(LIBS)

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

bin/test0012.exe : tmp/test0012.obj lib/this.lib
	$(LINK_c) /out:bin\test0012.exe tmp\test0012.obj lib\this.lib $(LIBS)

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

# --- end of file ---
