summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorsven-ola <sven-ola@3484d885-4da6-438d-b19d-107d078dd756>2010-10-01 08:54:47 +0200
committersven-ola <sven-ola@3484d885-4da6-438d-b19d-107d078dd756>2010-10-01 08:54:47 +0200
commitd22cd0195d4d27efc01deba705351a46d9893628 (patch)
tree65f08f6261f79859bbdd53ac24c2364f877f5d12 /Makefile
downloadNPTv6-d22cd0195d4d27efc01deba705351a46d9893628.tar
NPTv6-d22cd0195d4d27efc01deba705351a46d9893628.zip
Transfer from freifunk-firmware to new SF project
git-svn-id: https://map66.svn.sourceforge.net/svnroot/map66@1 3484d885-4da6-438d-b19d-107d078dd756
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a3f5a2c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+obj-m := ip6t_MAP66.o
+KVERSION := $(shell uname -r)
+KPATH := /lib/modules/$(KVERSION)/build
+IPTABLES_VERSION := $(shell 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/') )))
+
+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 $< $@