CC = gcc
CFLAGS = -O3 -I. -I../include

#
# more aggressive compilation with Intel C Compiler
#
# CC = icc
# CFLAGS = -ip -O3 -rcd  -I. -I../include
# -xK: P3
# -xW: P4
# -xN: P4, more effort than -xW
# -xB: Pentium M
# -xP: P4 w SSE3
# on EM64T, default is -xW
# -ip: Enables more interprocedural optimizations for single file compilation.
# -axP: generate both generic & EM64T-specific code

LIBOBJS = hibutil.o
TARGET = libhib.a hibtest lsgrape config600

all:	$(TARGET)

libhib.a:	$(LIBOBJS)
	ar rvu $@ $?
	ranlib $@

hibtest:	hibtest.c hibutil.c $(LIBOBJS)
	$(CC) $(CFLAGS) -o $@ hibtest.c hibutil.c -lm

lsgrape:	lsgrape.c hibutil.c $(LIBOBJS)
	$(CC) $(CFLAGS) -o $@ lsgrape.c hibutil.c -lm

config600:	config600.c hibutil.c $(LIBOBJS)
	$(CC) $(CFLAGS) -o $@ config600.c hibutil.c -lm

clean:
	rm -f *.o core *~ $(TARGET)

bak:
	-tar cvf hib.tar ./*.[hc] ./*.pl ./*.csh ./*.awk
	-gzip hib.tar
