I have this Makefile, which part should I need to insert
---
ifneq ($(KERNELRELEASE),)
obj-m := ipt_ipp2p.o
else
KERNEL_SRC ?= $(firstword $(wildcard /lib/modules/$(shell uname -r)/build
/usr/src/linux))
ifeq ($(KERNEL_SRC),)
$(error You need to define KERNEL_SRC)
endif
ifneq ($wildcard $(KERNEL_SRC)/include/linux/modversions.h),)
MODVERSIONS = -DMODVERSIONS
endif
_KVER = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^VERSION' |
cut -d"=" -f2))
_KPL = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^PATCHLEVEL'
| cut -d"=" -f2))
_KSUB = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^SUBLEVEL' |
cut -d"=" -f2))
KERNEL_SERIES=$(_KVER).$(_KPL)
ifeq ($(KERNEL_SERIES), 2.6)
TARGET=ipt_ipp2p.ko
else
TARGET=ipt_ipp2p.o
endif
SED = sed
IPTABLES_BIN = iptables
ifndef $(IPTABLES_SRC)
IPTVER = \
$(shell $(IPTABLES_BIN) --version | $(SED) -e 's/^iptables v//')
IPTABLES_SRC = $(wildcard /usr/src/iptables-$(IPTVER))
endif
ifeq ($(IPTABLES_SRC),)
$(warning You need to install iptables sources and maybe set IPTABLES_SRC)
endif
IPTABLES_INCLUDE = -I$(IPTABLES_SRC)/include
ifneq ($(IPTVER),)
IPTABLES_VERSION = $(IPTVER)
else
IPTABLES_VERSION = $(shell cat $(IPTABLES_SRC)/Makefile | grep -e
'^IPTABLES_VERSION:=' | cut -d"=" -f2)
endif
IPTABLES_OPTION = -DIPTABLES_VERSION=\"$(IPTABLES_VERSION)\"
CC = gcc
CFLAGS = -O3 -Wall
all: modules libipt_ipp2p.so
modules: $(TARGET)
ipt_ipp2p.o: ipt_ipp2p.h ipt_ipp2p.c
$(CC) $(CFLAGS) -I$(KERNEL_SRC)/include -c ipt_ipp2p.c
-D__KERNEL__ -DMODULE $(MODVERSIONS)
ipt_ipp2p.ko: ipt_ipp2p.h ipt_ipp2p.c
$(MAKE) -C $(KERNEL_SRC) SUBDIRS=$(PWD) modules
libipt_ipp2p.so: libipt_ipp2p.c ipt_ipp2p.h
$(CC) $(CFLAGS) $(IPTABLES_OPTION) $(IPTABLES_INCLUDE) -fPIC -c
libipt_ipp2p.c
$(CC) -shared -o libipt_ipp2p.so libipt_ipp2p.o
clean:
-rm -f *.o *.so *.ko .*.cmd *.mod.c
endif
--
On Wed, 2 Apr 2008, John Homer H Alvero wrote:
> Try adding this line in Makefile
>
> INCLUDE+=-I</path/to/kernel/source>
>
> On Wed, Apr 2, 2008 at 11:10 AM, Allan T. Parreno
> <[EMAIL PROTECTED]> wrote:
>>
>> Hello,
>>
>> Im having problem compiling the ipp2p, any idea to resolve this error?
>>
>> [EMAIL PROTECTED] ipp2p-0.8.2]# make
>> make -C /lib/modules/2.6.24/build SUBDIRS=/home/allan/ipp2p-0.8.2 modules
>> make[1]: Entering directory `/usr/src/linux-2.6.24'
>> CC [M] /home/allan/ipp2p-0.8.2/ipt_ipp2p.o
>> Building modules, stage 2.
>> MODPOST 1 modules
>> CC /home/allan/ipp2p-0.8.2/ipt_ipp2p.mod.o
>> LD [M] /home/allan/ipp2p-0.8.2/ipt_ipp2p.ko
>> make[1]: Leaving directory `/usr/src/linux-2.6.24'
>> gcc -O3 -Wall -DIPTABLES_VERSION=\"1.4.0\"
>> -I/usr/src/iptables-1.4.0/include -fPIC -c libipt_ipp2p.c
>> In file included from /usr/src/iptables-1.4.0/include/libiptc/libiptc.h:7,
>> from /usr/src/iptables-1.4.0/include/iptables.h:5,
>> from libipt_ipp2p.c:9:
>> /usr/src/iptables-1.4.0/include/linux/netfilter_ipv4/ip_tables.h:18:28:
>> error: linux/compiler.h: No such file or directory
>> In file included from /usr/src/iptables-1.4.0/include/libiptc/libiptc.h:7,
>> from /usr/src/iptables-1.4.0/include/iptables.h:5,
>> from libipt_ipp2p.c:9:
>> /usr/src/iptables-1.4.0/include/linux/netfilter_ipv4/ip_tables.h:190:
>> error: expected :, ,, ;, } or __attribute__ before * token
>> make: *** [libipt_ipp2p.so] Error 1
>> [EMAIL PROTECTED] ipp2p-0.8.2]#
>>
>> Thanks in advance.
>>
>>
>> _________________________________________________
>> Philippine Linux Users' Group (PLUG) Mailing List
>> [email protected] (#PLUG @ irc.free.net.ph)
>> Read the Guidelines: http://linux.org.ph/lists
>> Searchable Archives: http://archives.free.net.ph
>>
> _________________________________________________
> Philippine Linux Users' Group (PLUG) Mailing List
> [email protected] (#PLUG @ irc.free.net.ph)
> Read the Guidelines: http://linux.org.ph/lists
> Searchable Archives: http://archives.free.net.ph
>
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph