# Generated automatically from Makefile.in by configure.
############################################################################
#                                                                          #
# The contents of this file are subject to the WebStone Public License     #
# Version 1.0 (the "License"); you may not use this file except in         #
# compliance with the License. You may obtain a copy of the License        #
# at http://www.mindcraft.com/webstone/license10.html                      #
#                                                                          #
# 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.                                                       #
#                                                                          #
# The Original Code is WebStone 2.5.                                       #
#                                                                          #
# The Initial Developer of the Original Code is Silicon Graphics, Inc.     #
# and Mindcraft, Inc.. Portions created by Silicon Graphics. and           #
# Mindcraft. are Copyright (C) 1995#1998 Silicon Graphics, Inc. and        #
# Mindcraft, Inc. All Rights Reserved.                                     #
#                                                                          #
# Contributor(s): ______________________________________.                  #
#                                                                          #
############################################################################

#
# @(#) Makefile.in 2.7@(#)
#

PRODUCT = webstone
VERSION = 2.5b3

CC		= gcc
LIBS		= -lnsl -lm  -lssl -lcrypto	#-lm 
#SSL_DIR		= /home/nagendra/src/client/openssl-0.9.5
SSL_DIR		= /usr/local/openssl-0.9.5a
LDFLAGS         = -L$(SSL_DIR)/lib
INCLUDES	= -I$(SSL_DIR)/include
CFLAGS		= -g -O2 -DSTONE_SSL
DEFS		= -DHAVE_CONFIG_H

BINDIR		= ../bin
CP		= cp
RM		= rm -f

EXECUTABLE1	= webmaster
MAIN1		= webmaster.c  
EXECUTABLE2	= webclient
MAIN2		= webclient.c
EXECUTABLE3	= genrand
MAIN3		= genrand.c

MASTERSRCS	= timefunc.c bench.c parse_file_list.c statistics.c \
		  errexit.c sysdep.c random.c

STONESRCS	= timefunc.c get.c \
		  parse_file_list.c bench.c statistics.c errexit.c \
		  sysdep.c random.c

COMPILE         = $(CC) $(CFLAGS) $(DEFS) $(INCLUDES)

MASTEROBJS = webmaster.o $(MASTERSRCS:.c=.o) 
STONEOBJS = webclient.o $(STONESRCS:.c=.o) 
GENRANDOBJS = genrand.o

TARGETS = $(EXECUTABLE1) $(EXECUTABLE2) $(EXECUTABLE3)

.SUFFIXES:
.SUFFIXES: .c .o

all:	$(TARGETS) 

install: all
	$(CP) $(TARGETS) $(BINDIR)

pure: all
	purify -mail-to-user=root webclient
	$(CP) webclient.pure $(BINDIR)/webclient
	$(RM) webclient.pure
	purify -mail-to-user=root webmaster
	$(CP) webmaster.pure $(BINDIR)/webmaster
	$(RM) webmaster.pure

clean:	
	$(RM) $(MASTEROBJS) $(STONEOBJS) $(GENRANDOBJS)
	$(RM) webmaster.pure webclient.pure
	(cd CGI-test; make clean)
	(cd API-test; make clean)

clobber: clean
	$(RM) config.cache config.log config.status config.h Makefile
	$(RM) $(TARGETS)
	(cd CGI-test; make clobber)
	(cd API-test; make clobber)

webmaster.o: webmaster.c bench.h parse_file_list.h statistics.h \
		sysdep.h timefunc.h debug.h config.h

webclient.o: webclient.c bench.h debug.h get.h \
		parse_file_list.h statistics.h sysdep.h timefunc.h config.h

timefunc.o: timefunc.c timefunc.h bench.h debug.h statistics.h \
		sysdep.h config.h

bench.o: bench.c bench.h debug.h statistics.h sysdep.h timefunc.h \
		config.h

errexit.o: errexit.c sysdep.h config.h

statistics.o: statistics.c statistics.h sysdep.h config.h

webmaster: $(MASTEROBJS)
	$(COMPILE) $(LDFLAGS) $(MASTEROBJS) $(LIBPATH) $(LIBS) -o $(EXECUTABLE1)

webclient: $(STONEOBJS)
	$(COMPILE) $(LDFLAGS) $(STONEOBJS) $(LIBPATH) $(LIBS) -o $(EXECUTABLE2)

genrand: $(GENRANDOBJS)
	$(COMPILE) $(LDFLAGS) $(GENRANDOBJS) $(LIBPATH) $(LIBS) -o $(EXECUTABLE3)

cgi:
	(cd CGI-test; make CC="$(CC)" CFLAGS="$(CFLAGS)" INCLUDES="$(INCLUDES)" DEFS="$(DEFS)" LDFLAGS="$(LDFLAGS)")

api:
	(cd API-test; make CC="$(CC)" CFLAGS="$(CFLAGS)" INCLUDES="$(INCLUDES)" DEFS="$(DEFS)" LDFLAGS="$(LDFLAGS)")

install-cgi:
	(cd CGI-test; make CC="$(CC)" CFLAGS="$(CFLAGS)" INCLUDES="$(INCLUDES)" DEFS="$(DEFS)" LDFLAGS="$(LDFLAGS)" install)

install-api:
	(cd API-test; make CC="$(CC)" CFLAGS="$(CFLAGS)" INCLUDES="$(INCLUDES)" DEFS="$(DEFS)" LDFLAGS="$(LDFLAGS)" install)

.c.o: Makefile
	@echo "COMPILING FILE " $<
	$(COMPILE) -c $< -o $@
