#
# Makefile for http-analyze
#
# $Id: Makefile,v 1.5 1999/11/02 16:12:15 stefan Exp $

# Shell to use for executing commands by make.
SHELL	= /bin/sh

# Local conventions
# -----------------
#
# HA_BINDIR	is the directory where the executable is installed.
# HA_LIBDIR	is the directory where the required files are installed.
# HA_MANDIR	defines the directory for the manpage in source or
#		pre-formatted format.
#
HA_BINDIR = /usr/local/bin
HA_LIBDIR = /usr/local/lib/http-analyze
HA_MANDIR = /usr/local/man/cat1

# Required libraries
# ------------------
#
# REQINCS	default location of the GD include files.
# REQLIBS	default location of the GD library.
#
REQINCS	= -I/usr/local/include
REQLIBS	= -L/usr/local/lib -lgd -lpng -lz

# EXTENSION	is either '1' or 'man' to define whether the pre-formatted
#		manpage (ASCII format) or the source (nroff format) is to
#		be installed. The name of the installed manpage always has
#		the suffix '.1'. This are the two most common combinations:
#
#		Manpage in	EXTENSION	HA_MANDIR
#		pre-fmt. text	.1		/usr/local/man/cat1
#		source format	.man		/usr/local/man/man1
#
# COMPRESS	defines the program to use for compressing the manpage.
#		If set to 'true', no compression is applied.
#EXTENSION = man
#COMPRESS = pack -f
#COMPRESS = compress -f
EXTENSION = 1
COMPRESS = true

# Platform selection
# ------------------
#
# Select the platform below to include the actual macro definitions for
# this platform in the file config.h. The default settings in config.h
# should work fine if your platform is selected below.
#
# OPTIM		contains optimization flags for the compiler only.
# DEFINES	contains compiler options which are also passed to lint.
# PLATFORM	contains platform-specific options not passed to lint,
#		but to the loader.
# EXTRA_LIBS	are extra libraries needed on certain platforms.
#

# SGI IRIX 5.x/6.x
# Congratulations! You're using one of the best platforms for porting SW.
#
#DEFINES  = -DIRIX
#
# for the mips-3 ABI:
#OPTIM    = -O2 -OPT:Olimit=2580
#PLATFORM = -n32 -xansi
#
# or for the mips-2 ABI:
#OPTIM    = -O2 -Olimit 1270
#PLATFORM = -o32 -xansi

# SunOS 4.x/Solaris 2.x.
# Note: On SunOS 4.x you will need to define -DNOT_REALLY_ANSI_C
# to include an own strerror() functions which is missing from the
# standard C library on SunOS.
#
#DEFINES  = -DSUN -Dunix
#OPTIM    = -O2
#PLATFORM = -ansi
#CC       = gcc

# AIX 4.2
#
#DEFINES  = -DAIX -Dunix
#OPTIM    = -O
#PLATFORM =

# DIGITAL UNIX V4.0
#
#DEFINES  = -DDEC -Dunix
#OPTIM    = -O
#PLATFORM = -newc

# HP/UX 10.20
#
#DEFINES  = -DHPUX -Dunix
#OPTIM    = -O
#PLATFORM = -Ae

# Linux flavours
#
#DEFINES  = -Dlinux -Dunix
#OPTIM    = -O2
#PLATFORM = 
#CC       = gcc

# SCO 3.2
#
#DEFINES  = -DSCO
#OPTIM    = -O
#PLATFORM =

# BSD/OS 3.0 and FreeBSD 2.2.6-RELEASE
#
#DEFINES  = -DBSD -Dunix
#OPTIM    = -O2
#PLATFORM =
#CC       = gcc

# AT&T (vanilla) Unix System V.4
#
#DEFINES  = -DSVR4
#OPTIM    = -O2
#PLATFORM = -Xa
#EXTRA_LIBS = -lucb

# AT&T (vanilla) Unix System V.3
#
#DEFINES  = -DSVR3
#OPTIM    = -O
#PLATFORM = 

# BeOS
#
#DEFINES  = -DBEOS -Dunix
#OPTIM    = -O
#PLATFORM = -relax_pointers

# Windows NT/Netware
#
#DEFINES = -DWIN32
#DEFINES = -DNETWARE

http-analyze:
	(cd src; $(MAKE) $(MFLAGS) CC="$(CC)" OPTIM="$(OPTIM)" \
	    DEFINES="$(DEFINES)" PLATFORM="$(PLATFORM)" \
	    EXTRA_LIBS="$(EXTRA_LIBS)" HA_LIBDIR="$(HA_LIBDIR)" \
	    REQINCS="$(REQINCS)" REQLIBS="$(REQLIBS)")

install:	http-analyze
	(cd src; $(MAKE) $(MFLAGS) install \
	    HA_BINDIR="$(HA_BINDIR)" HA_LIBDIR="$(HA_LIBDIR)")
	(cd man; $(MAKE) $(MFLAGS) install \
	    HA_MANDIR="$(HA_MANDIR)" \
	    EXTENSION="$(EXTENSION)" COMPRESS="$(COMPRESS)")
	@echo "\nInstallation completed."
	@echo "Please see following new options in the documentation:\n"
	@echo "http-analyze -B [-v] [-o outdir]\t\tto create buttons in outdir"
	@echo "http-analyze -i new_cfg [-v] [-c cfgfile]\tto create a new config file"
	@echo "http-analyze -r company regID [free|comm]\tto register your copy"

clean:
	(cd src; $(MAKE) $(MFLAGS) clean)
	(cd msgcat; $(MAKE) $(MFLAGS) clean)

