CC = gcc
CFLAGS = -O3 -fno-strength-reduce -Wall
MFLAGS = -D__KERNEL__ 

# Change this if this is not the place you want to keep the module
MODULEDIR = /lib/modules/current/misc/

# for older kernels, uncomment the next line 
# MFLAGS += -DKERNEL_VERSION=\"$(shell uname -r)\" 

# If your kernel does version numbering for all symbols, 
# uncomment the next line
MFLAGS += -DMODVERSIONS -include /usr/include/linux/modversions.h

# If you have a GS4500A uncomment the next line
# MFLAGS += -DGS4500A

# If your root area has a name other that root, say it in the next line
#ROOT = guru

# If your root group is other than root tell that in the next line
#RGROUP = root


ifndef ROOT
   ROOT = root
endif

ifndef RGROUP
   RGROUP = root
endif

all:	gs4500.o

gs4500.o:	gs4500.c
		$(CC) -c $(CFLAGS) $(MFLAGS) gs4500.c -o gs4500.o
		chmod a+x gs4500.o

install: gs4500.o
	install -m644 -o$(ROOT) -g$(RGROUP) gs4500.o $(MODULEDIR)

clean:
	-rm -f *.o *~ *%

