ifeq ($(OPT_CFLAGS),)
OPT_CFLAGS = -O2 -fomit-frame-pointer
endif
CFLAGS = $(OPT_CFLAGS) -DMODULE -D__KERNEL__ -pipe -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2


CC=gcc
KERNEL_VERSION=$(shell uname -r)
KERNEL:=$(shell echo "$(KERNEL_VERSION)" | cut -f1 -d-)
AUTOCONF=/lib/modules/$(KERNEL_VERSION)/build/include/linux/autoconf.h
INCLUDE=-I ../../include -I /lib/modules/$(KERNEL_VERSION)/build/include

HAVE_SMP := $(shell \
	if grep -q '^\#define.*CONFIG_SMP*.1' $(AUTOCONF); \
	then echo 1; else echo 0; fi)

ifeq ($(HAVE_SMP),1)
#CFLAGS += -D__SMP__
endif

ftcard.o:ftcard1.o gcc/ftcard2.o
	ld -m elf_i386 -r -o ftcard.o ftcard1.o gcc/ftcard2.o
ftcard1.o:ftcard1.c
	$(CC) $(CFLAGS) $(INCLUDE) -c -o $@ ftcard1.c
clean:
	rm -f ftcard.o ftcard1.o

