# $Id: Makefile,v 1.2 2003/12/05 02:22:49 jasta Exp $
###############################################################################

SOURCES = \
	libipt_p2p.c

OBJECTS = \
	$(SOURCES:%.c=%.o)

TARGET = \
	libipt_p2p.so

###############################################################################

# We don't really require gcc, I'm just being lazy
CC = gcc

# I can't believe we have to do this...a better way, please!
SED = sed
IPTABLES = /sbin/iptables
IPTABLES_VERSION = \
	$(shell $(IPTABLES) --version | $(SED) -e 's/^iptables v//')

CFLAGS = -O2 -Wall
CPPFLAGS = \
	-DIPTABLES_VERSION=\"$(IPTABLES_VERSION)\" -I../common

###############################################################################

all: $(TARGET)

$(TARGET): $(OBJECTS)
	$(LD) -shared -o $@ $(OBJECTS)

clean:
	$(RM) $(OBJECTS)
	$(RM) $(TARGET)
