| # (C) 2009-10 - Luca Deri <deri@ntop.org> |
| ifneq (, $(shell which svnversion)) |
| SVNDEF := -DSVN_REV="\"$(shell svnversion -n .)\"" |
| BUILD_KERNEL=$(shell uname -r) |
| EXTRA_CFLAGS += -I$(PWD) $(SVNDEF) |
| INSTDIR := $(DESTDIR)/lib/modules/$(BUILD_KERNEL)/kernel/net/pf_ring |
| TARGETDIR := $(DESTDIR)/usr/src/$(BUILD_KERNEL)/include/linux/ |
| all: Makefile pf_ring.c linux/pf_ring.h |
| @if test "$(USER)" = "root"; then \ |
| echo "********** WARNING WARNING WARNING **********"; \ |
| echo "* Compiling PF_RING as root might lead you to compile errors"; \ |
| echo "* Please compile PF_RING as unpriviliged user"; \ |
| echo "*********************************************"; \ |
| make -C /lib/modules/$(BUILD_KERNEL)/build SUBDIRS=$(HERE) EXTRA_CFLAGS='$(EXTRA_CFLAGS)' modules |
| make -C /lib/modules/$(BUILD_KERNEL)/build SUBDIRS=$(HERE) clean |
| \rm -f *~ Module.symvers Module.markers modules.order *# |
| cp linux/pf_ring.h $(DESTDIR)/usr/include/linux |
| @if test -d ${TARGETDIR}; then \ |
| cp linux/pf_ring.h ${TARGETDIR}; \ |
| /sbin/depmod $(BUILD_KERNEL) |