ifeq ($(shell uname -r),$(shell uname -r | grep 2.[5,6].)) # If KERNELRELEASE is defined, we've been invoked from the # kernel build system and can use its language. ifneq ($(KERNELRELEASE),) obj-m := wb528ms.o wb528ms-objs := wbmsreader528.o # Otherwise we were called directly from the command # line; invoke the kernel build system. else KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) 2.6: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules endif else KERNELDIR ?= /lib/modules/$(shell uname -r)/build CC = gcc CFLAGS = -D__KERNEL__ -I/usr/src/linux-2.4/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -pipe -mpreferred-stack-boundary=2 -march=i586 -DMODULE -c include $(KERNELDIR)/.config ifdef CONFIG_SMP CFLAGS += -D__SMP__ -DSMP endif DEP = wbscsi.h \ wbscsi.c \ wbvirtualdev.h \ wbmscard.h \ wbmscard.c \ wbmsreader.h \ wbmsreader528.h \ wbdebug.h wb528ms.o : wbmsreader528.c $(DEP) $(CC) $(CFLAGS) wbmsreader528.c -o wb528ms.o wbformat : wbformat.c $(CC) -O2 -Wall wbformat.c -o wbformat endif clean: rm -rf *.o *.ko *.mod.c .*.cmd .tmp_versions