CC =$(shell if which kgcc > /dev/null 2>&1; then echo kgcc; else echo gcc; fi)


CFLAGS =-D__KERNEL__ -DMODULE -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer $(shell if $(CC) -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo -fno-strict-aliasing; fi)

# Uncomment next line for 2.4.1 kernel
#CFLAGS +=$(shell if uname -r | grep '2.4.1' > /dev/null 2>&1; then echo -DEXPORT_SYMTAB; fi)

# Uncomment next line for 2.4.2 kernel
#CFLAGS +=$(shell if uname -r | grep '2.4.2' > /dev/null 2>&1; then echo -DEXPORT_SYMTAB; fi)

SRCPATH =/usr/src/linux


OBJS = iteraid.o
iteraid.o:iteraid.c iteraid.h
	$(CC) $(CFLAGS) $(shell if uname -r | grep '2.2.' > /dev/null 2>&1; then echo "-DMODVERSIONS"; fi) -I. -I$(SRCPATH)/drivers/scsi -I$(SRCPATH)/include -include $(SRCPATH)/include/linux/modversions.h -c -o iteraid.o iteraid.c

SMPOBJS = iteraid.smp
iteraid.smp:iteraid.c iteraid.h
	$(CC) $(CFLAGS) -D__SMP__ $(shell if uname -r | grep '2.2.' > /dev/null 2>&1; then echo "-DMODVERSIONS"; fi) -I. -I$(SRCPATH)/drivers/scsi -I$(SRCPATH)/include -include $(SRCPATH)/include/linux/modversions.h -c -o iteraid.smp iteraid.c


up: $(OBJS)

smp: $(SMPOBJS)

clean:
	rm -f iteraid.o iteraid.smp *~