# Comment/uncomment the following line to disable/enable debugging
DEBUG = y

# Change it here or specify it on the "make" commandline
#INCLUDEDIR = /usr/include
INCLUDEDIR = /lib/modules/2.4.4-4GB/build/include

ifeq ($(DEBUG),y)
  DEBFLAGS = -O -g -DGALIL_DEBUG # "-O" is needed to expand inlines
else
  DEBFLAGS = -O2
endif

CFLAGS = -D__KERNEL__ -DMODULE -Wall $(DEBFLAGS)
CFLAGS += -I$(INCLUDEDIR)

# Extract version number from headers.
# following fails replace with hardcode
#VER = $(shell awk -F\" '/REL/ {print $$2}' $(INCLUDEDIR)/linux/version.h)
VER = 2.2.14-5.0
TARGET = galilpci
OBJS = $(TARGET).o
SRC = $(TARGET).c

all: .depend $(TARGET).o

install:
#	mkdir -p /lib/modules/Galil /lib/modules/$(VER)/Galil
#	install -c $(TARGET).o /lib/modules/$(VER)/misc
#	install -c $(TARGET).o /lib/modules/Galil
	install -c $(TARGET).o /lib/modules/galil

clean:
	rm -f *.o *~ core .depend

depend .depend dep:
	$(CC) $(CFLAGS) -M *.c > $@

ifeq (.depend,$(wildcard .depend))
include .depend
endif
