head	1.4;
access;
symbols;
locks
	root:1.4; strict;
comment	@# @;


1.4
date	2000.03.31.05.07.30;	author root;	state Exp;
branches;
next	1.3;

1.3
date	99.06.11.07.17.29;	author root;	state Exp;
branches;
next	1.2;

1.2
date	99.06.11.06.26.21;	author root;	state Exp;
branches;
next	1.1;

1.1
date	99.06.11.06.01.09;	author root;	state Exp;
branches;
next	;


desc
@Makefile for Squirm
@


1.4
log
@set up easy config for squid user & group, plus root group
@
text
@# Makefile for Squirm
#
# $Id: Makefile,v 1.3 1999/06/11 07:17:29 root Exp root $



# The path to install squirm under
PREFIX=/usr/local/squirm

# The username that squid runs as (see cache_effective_user in squid.conf)
USER=squid    

# The group that squid runs as (see cache_effective_group in squid.conf)
GROUP=squid

# The group that the root user belongs to
ROOT_GROUP = bin

# The regex library (-lgnuregex is common on FreeBSD, none for some Linux'es)
EXTRALIBS=-lgnuregex



# ---
# you should need to edit anything below here

TOP = .

OFILES = squirm.o main.o config.o log.o lists.o ip.o util.o
HFILES = squirm.h paths.h lists.h log.h ip.h util.h

CC=gcc


OPTIMISATION=-O3
BINARIES = squirm

CFLAGS = -O3 -Wall -funroll-loops -DPREFIX=\"$(PREFIX)\"
#CFLAGS = -Wall -g -DPREFIX=\"$(PREFIX)\"
#CFLAGS = -Wall -g -DDEBUG

all:	$(BINARIES)

install:	all
			install -m 755 -o root -g $(ROOT_GROUP) -d $(PREFIX) \
			$(PREFIX)/bin
			install -m 770 -o root -g $(GROUP) -d $(PREFIX)/etc
			install -m 750 -o $(USER) -g $(GROUP) -d $(PREFIX)/logs
			install -m 660 -c -o root -g $(GROUP) squirm.conf.dist squirm.patterns.dist \
			$(PREFIX)/etc
			install -m 755 -o root -g $(ROOT_GROUP) --strip squirm $(PREFIX)/bin

squirm.o:	squirm.c $(HFILES)
			$(CC) -c squirm.c 	$(CFLAGS)

main.o:		main.c $(HFILES)
			$(CC) -c main.c		$(CFLAGS)

config.o:	config.c $(HFILES)
			$(CC) -c config.c	$(CFLAGS)

log.o:		log.c $(HFILES)
			$(CC) -c log.c		$(CFLAGS)

lists.o:	lists.c $(HFILES)
			$(CC) -c lists.c	$(CFLAGS)

ip.o:		ip.c $(HFILES)
		    $(CC) -c ip.c            $(CFLAGS)

util.o:		util.c $(HFILES)
		    $(CC) -c util.c	     $(CFLAGS)

squirm:		$(OFILES) $(HFILES)
		$(CC) $(OPTIMISATION) -o squirm $(OFILES) $(EXTRALIBS) $(LDOPTS)


pure:		clean
			rm -f *~

clean:		
			rm -f squirm.o main.o config.o log.o lists.o \
			 ip.o util.o core squirm

distclean:		pure clean

dummy:


@


1.3
log
@added ROOT_GROUP so it's easy to change from wheel to bin going back and
forth from Linux to FreeBSD
@
text
@d3 1
a3 2
# $Id: Makefile,v 1.2 1999/06/11 06:26:21 root Exp root $
#
d5 12
a16 1
prefix=/usr/local/squirm
d18 3
a20 1
#ROOT_GROUP = wheel
d23 4
d29 1
a29 1
OFILES = squirm.o main.o config.o log.o lists.o regex.o ip.o util.o
a32 1
#CC=checkergcc
d34 1
a34 4
#EXTRALIBS=-lregex
#EXTRALIBS=
#LDOPTS=-pg
#OPTIMISATION=-g
d38 2
a39 2
CFLAGS = -O3 -Wall -funroll-loops -DPREFIX=\"$(prefix)\"
#CFLAGS = -Wall -g -DPREFIX=\"$(prefix)\"
d45 7
a51 7
			install -m 755 -o root -g $(ROOT_GROUP) -d $(prefix) \
			$(prefix)/bin
			install -m 770 -o root -g squid -d $(prefix)/etc
			install -m 750 -o squid -g squid -d $(prefix)/logs
			install -m 660 -c -o root -g squid squirm.conf.dist squirm.patterns.dist \
			$(prefix)/etc
			install -m 755 -o root -g $(ROOT_GROUP) --strip squirm $(prefix)/bin
d54 1
a54 1
			$(CC) -c squirm.c 		$(CFLAGS)
d60 1
a60 1
			$(CC) -c config.c		$(CFLAGS)
d66 1
a66 1
			$(CC) -c lists.c		$(CFLAGS)
a73 16
regex.o:
	@@echo "Making GNU Regex in $(TOP)/regex"
	@@cd $(TOP)/regex; ./configure; $(MAKE); cp -p regex.h regex.o ..

#regex.h:	dummy
#		@@echo "You need to precompile GNU regex. Please read
#INSTALL."
#		@@exit 1
#regex.o:	dummy
#		@@echo "You need to precompile GNU regex. Please read
#INSTALL."
#		@@exit 1

#squirm:		$(OFILES) $(HFILES)
#			$(CC) -o squirm $(OFILES)	$(EXTRALIBS)

d75 1
a75 1
			$(CC) $(OPTIMISATION) -o squirm $(OFILES) $(EXTRALIBS) $(LDOPTS)
d83 1
a83 2
			 ip.o util.o regex.o regex.h core squirm
			@@cd $(TOP)/regex; make clean
a85 1
			@@cd $(TOP)/regex; rm -f Makefile config.status
@


1.2
log
@setup automatic GNU regex configuration and compilation
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.1 1999/06/11 06:01:09 root Exp root $
d7 4
d33 1
a33 1
			install -m 755 -o root -g wheel -d $(prefix) \
d39 1
a39 1
			install -m 755 -o root -g wheel --strip squirm $(prefix)/bin
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
# $Id$
d7 1
d10 1
a10 2

HFILES = squirm.h paths.h lists.h log.h regex.h ip.h util.h
d58 4
d83 2
a84 1
			 ip.o util.o core squirm
d86 2
a89 3



@
