summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: e5cc2f023eb2ab9ebb85d87975cb22bb597890fe (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
34
obj-m := ip6t_MAP66.o
KVERSION := $(shell uname -r)
KPATH := /lib/modules/$(KVERSION)/build
IPTABLES_VERSION := $(shell (/sbin/ip6tables --version 2>&- || ip6tables --version)|sed 's/^.*\([[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\).*/\1/')
IPTABLES_VERSION_CODE := $(shell echo $$(( $$(echo $(IPTABLES_VERSION)|sed 's/^.*\([[:digit:]]\+\)\.\([[:digit:]]\+\)\.\([[:digit:]]\+\).*/\1 * 65536 + \2 * 256 + \3/') )))
ifeq ($(DEBUG),1)
EXTRA_CFLAGS := -DDEBUG
endif

all:	libip6t_MAP66.so
	$(MAKE) -C $(KPATH) M=$(PWD) modules

libip6t_MAP66.so: libip6t_MAP66.o
	gcc -shared -o $@ $<

libip6t_MAP66.o: libip6t_MAP66.c ip6t_MAP66.h Makefile
	gcc $(CFLAGS) -DIPTABLES_VERSION=\"$(IPTABLES_VERSION)\" -DIPTABLES_VERSION_CODE=$(IPTABLES_VERSION_CODE) -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Werror -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wshadow -Winline -pipe -DXTABLES_LIBDIR=\"/usr/local/libexec/xtables\" -D_INIT=libip6t_MAP66_init -DPIC -fPIC -g -O2 -o $@ -c $<

clean:
	$(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
	rm -f *.so
	rm -f *~

install: /lib/xtables/libip6t_MAP66.so

/lib/xtables/libip6t_MAP66.so: libip6t_MAP66.so
	cp $< $@

README.txt: README.dbk
	xmlto text README.dbk

README.html: README.dbk
	xmlto xhtml-nochunks README.dbk