# # Makefile for http-analyze # # $Id: Makefile,v 2.0.1.12 1998/03/31 13:22:56 stefan Exp $ # # Shell to use for executing commands by make. SHELL = /bin/sh # # Local conventions # ----------------- # # LOCALLIB is the directory where the required files are installed. # LOCALBIN is the directory where the executables are installed. # LOCALMAN defines the directory for the manpage in source or # pre-formatted format. If COMPRESS is set to contain the name # of a compression command, the manpage will be compressed. # EXTENSION is either '1' or 'man' to define whether the pre-formatted # manpage or the source is to be installed. The name of the # installed manpage always ends in '.1' (hard-coded). # # Here are some examples for LOCALMAN, COMPRESS and EXTENSION: # # OS LOCALMAN COMPRESS EXTENSION # --------------------------------------------------------- # IRIX /usr/local/man/cat1 pack -f 1 # SVR4 /usr/share/man/cat1 - 1 # Linux /usr/local/man/man1 - man # LOCALLIB = $(PREFIX)/lib LOCALBIN = $(PREFIX)/bin LOCALMAN = $(PREFIX)/man/man1 # Program to use for compressing the manpage. # If set to 'true', no compression is applied. #COMPRESS = pack -f #COMPRESS = compress -f COMPRESS = true # Extension of the source to be installed as manpage. # if it is set to '1', the pre-formatted format is used, # if it is set to 'man', the source format is used. EXTENSION = man #EXTENSION = 1 # Location of the GD library and include files. GDLIB = ${LOCALBASE}/lib/libgd.a GDINC = ${LOCALBASE}/include # # Platform selection # ------------------ # # Select the platform in the Makefile, then see config.h for the actual macro # definitions to be used on this platform. If you add/modify any compiler # settings, please send them back to us together with a short description # of the machine, the OS, and the C environment. Thank you very much! # # DEFINES defines the compiler options which are also passed to lint. # # PLATFORM are platform-specific compiler options not passed to lint. # # EXTRA_LIBS are any extra libraries needed on a certain platform. # # Suggested settings for DEFINES, PLATFORM and EXTRA_LIBS currently exist # for IRIX, Unix System V, SunOS/Solaris, HP/UX, Linux, Windows NT, and # Netware (not fully supported yet). # # COMDEFS are definitions common to all platforms. # # OPTIM is now -g by default to include debugging information in the binary # to be able to reproduce stack backtraces in case of core dumps. # If you prefer optimization of the generated code, uncomment the # next line and comment out the -g definition. # CC ?= cc #OPTIM = -O2 #OPTIM = -g # Remove NDEBUG to include various assertion checks in the program. #COMDEFS = -DTIME_STATS -DNDEBUG COMDEFS = -DTIME_STATS # # Uncomment and/or modify the defines for the appropriate platform. # All suggested configuration settings here have been tested except # for the NETWARE platform. # # FreeBSD DEFINES = -DBSD -DHA_LIBDIR="$(LOCALLIB)/http-analyze" PLATFORM = # IRIX # #DEFINES = -DIRIX $(COMDEFS) #PLATFORM = -xansi -DIRIX -wlint -woff 826,827,813,85 #PLATFORM = -xansi # SunOS/Solaris # # The gcc environment on SunOS sometimes lacks strerror() and # other ANSI C functions for whatever reason. If you get errors # from the linker about the missing function strerror, add # -DNOT_REALLY_ANSI_C to the DEFINES below. Alternatively, # download our binary for Solaris 2.5. We had absolutely no # problems to compile it using gcc given the options below and # the standard (unchanged) configuration setting in config.h. # #DEFINES = -DSUN $(COMDEFS) #PLATFORM = -ansi -Dunix #CC = gcc # HP/UX # # Lacks definition of the 'unix' macro in it's compiler, so we # define it here. # #DEFINES = -DHPUX $(COMDEFS) #PLATFORM = -Ae -Dunix # Unix System V.4 # #DEFINES = -DSVR4 $(COMDEFS) #PLATFORM = -Xa #EXTRA_LIBS = -lucb # Unix System V.3 # #DEFINES = -DSVR3 $(COMDEFS) #PLATFORM = # Linux systems # #DEFINES = -Dlinux $(COMDEFS) #PLATFORM = #CC = gcc # Windows NT/Netware # #DEFINES = -DWIN32 $(COMDEFS) #DEFINES = -DNETWARE $(COMDEFS) #PLATFORM = CFLAGS += $(OPTIM) $(PLATFORM) $(DEFINES) LDFLAGS = LINT = lint -Dunix -Xa -u LIBS = -lm -L$(LOCALLIB) -lpng NROFF = nroff NRFLAGS = -u1 -man GTI_DEFS= -DVERSION=\"2.0a\" HA_OBJ = http-analyze.o images.o cntrycode.o utils.o vrml.o HA_SRC = http-analyze.c images.c cntrycode.c utils.c vrml.c GTI_OBJ = gti-analyze.o gti-images.o cntrycode.o utils.o GTI_SRC = gti-analyze.c gti-images.c cntrycode.c utils.c RA_OBJ = ra-analyze.o images.o cntrycode.o utils.o vrml.o RA_SRC = ra-analyze.c images.c cntrycode.c utils.c vrml.c 3D_OBJ = 3Dstats.o utils.o vrml.o 3D_SRC = 3Dstats.c utils.c vrml.c TARGETS = http-analyze http-analyze.1 all: $(TARGETS) http-analyze: $(HA_OBJ) $(CC) $(LDFLAGS) -o $@ $(HA_OBJ) $(GDLIB) $(LIBS) http-analyze.o: http-analyze.c $(CC) $(CFLAGS) -c http-analyze.c gti-analyze: $(GTI_OBJ) $(CC) $(LDFLAGS) -o $@ $(GTI_OBJ) $(GDLIB) $(LIBS) gti-analyze.o: gti-analyze.c $(CC) $(CFLAGS) $(GTI_DEFS) -c gti-analyze.c ra-analyze: $(RA_OBJ) $(CC) $(LDFLAGS) -o $@ $(RA_OBJ) $(GDLIB) $(LIBS) ra-analyze.o: ra-analyze.c $(CC) $(CFLAGS) $(RA_DEFS) -c ra-analyze.c 3Dstats: $(3D_OBJ) $(CC) $(LDFLAGS) -o $@ $(3D_OBJ) 3Dstats.o: 3Dstats.c $(CC) $(CFLAGS) $(3D_DEFS) -c 3Dstats.c vrml.o: vrml.c $(CC) $(CFLAGS) -c vrml.c images.o: images.c $(CC) $(CFLAGS) -c -I$(GDINC) images.c gti-images.o: gti-images.c $(CC) $(CFLAGS) -c -I$(GDINC) gti-images.c lint.out: $(HA_SRC) config.h defs.h cntrycode.h $(LINT) $(DEFINES) -I$(GDINC) $(HA_SRC) >$@ http-analyze.1: http-analyze.man $(NROFF) $(NRFLAGS) http-analyze.man | col >$@ http-analyze.o: config.h defs.h cntrycode.h 3Dstats.o: config.h defs.h images.o: config.h defs.h cntrycode.o: config.h defs.h cntrycode.h utils.o: config.h defs.h vrml.o: config.h defs.h install: $(TARGETS) cp http-analyze ha-setup $(LOCALBIN) cp http-analyze.$(EXTENSION) $(LOCALMAN)/http-analyze.1 chmod 755 $(LOCALBIN)/http-analyze $(LOCALBIN)/ha-setup chmod 444 $(LOCALMAN)/http-analyze.1 chown bin:bin $(LOCALBIN)/http-analyze $(LOCALBIN)/ha-setup -mkdir -p $(PREFIX)/share/doc/http-analyze cp http-analyze.pdf http-analyze.ps $(PREFIX)/share/doc/http-analyze -mkdir -p $(LOCALLIB)/http-analyze/btn cp files/3D* files/TLD files/bugreport.html rotate-httpd sample.conf \ $(LOCALLIB)/http-analyze/ cp files/btn/* $(LOCALLIB)/http-analyze/btn/ @echo "\nNow run 'ha-setup' to configure http-analyze for your server (Unix only).\n" clean: -rm -f $(HA_OBJ) $(3D_OBJ) lint.out realclean: clean -rm -f core http-analyze 3Dstats 3Dstats.1 clobber:: realclean -rm -f index.html stats*.html stats*.hist sites*.html files*.html agents*.html *.gif