#
.SUFFIXES: .ko

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

# Add your debugging flag (or not) to CFLAGS
ifeq ($(DEBUG),y)
  DEBFLAGS = -g -DDEBUG
else
  DEBFLAGS = -O2
endif

CFLAGS += $(DEBFLAGS)

MODS = pool.ko
OBJS = pool.o
APLS = sched
TARGET = ${MODS} ${APLS}

all: ${TARGET}

.c.ko:
	make -C /lib/modules/`uname -r`/build M=`pwd` V=1 modules

clean:
	make -C /lib/modules/`uname -r`/build M=`pwd` V=1 clean

obj-m:= ${OBJS}

clean-files := *.o *.ko *.mod.[co] ${APLS}

sched: sched.c
	cc -Wall -O2 -o sched sched.c

