summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 9cb52f65214b9bca9a284a3b6bee70ae9f66a9eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Path of libipulog (from iptables)
LIBIPULOG=../libipulog

# Names of the plugins to be compiled
ULOGD_SL:=BASE OPRINT


#  Normally You should not need to change anything below
#
CC = gcc
CFLAGS = -I. -I$(LIBIPULOG)/include -g -Wall
SH_CFLAGS:=$(CFLAGS) -fPIC

SHARED_LIBS+=$(foreach T,$(ULOGD_SL),extensions/ulogd_$(T).so)

all: $(SHARED_LIBS) ulogd

$(SHARED_LIBS): %.so: %_sh.o
	ld -shared -o $@ $<

%_sh.o: %.c
	gcc $(SH_CFLAGS) -o $@ -c $<

ulogd: ulogd.c ../libipulog/libipulog.a ulogd.h
	$(CC) $(CFLAGS) -rdynamic -ldl -i ulogd.c $(LIBIPULOG)/libipulog.a -o ulogd

clean:
	rm -f ulogd extensions/*.o extensions/*.so

install: all
	mkdir -p /usr/local/lib/ulogd && cp extensions/*.so /usr/local/lib/ulogd
	cp ulogd /usr/local/sbin