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

# Change it here or specify it on the "make" commandline if your
# kernel headers are elsewhere
INCLUDEDIR = /usr/include

ifeq ($(DEBUG),y)
  DEBFLAGS = -Wall -O -g -DRSHAPER_DEBUG
else
  DEBFLAGS = -O2
endif

CFLAGS = -Wall $(DEBFLAGS)

CFLAGS += -I$(INCLUDEDIR)

OBJS = rshaper.o
CLIENTS = rshaperctl

all: $(OBJS) $(CLIENTS)

install:
	install -d /lib/modules/$(VER)/misc /lib/modules/misc
	install -c $(OBJS) /lib/modules/$(VER)/misc
	install -c $(OBJS) /lib/modules/misc
	install -c $(CLIENTS) /usr/local/bin

clean:
	rm -f *.o $(CLIENTS) *~ core

tar:
	n=`basename \`pwd\``; cd ..; tar cvf - $$n | gzip > $$n.tar.gz

distrib: clean tar
