summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am51
-rw-r--r--src/Makefile.in33
-rw-r--r--src/cli.c1
-rw-r--r--src/erec.c1
-rw-r--r--src/parser_bison.y1
-rw-r--r--src/scanner.l1
6 files changed, 54 insertions, 34 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 00000000..0a678102
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,51 @@
+sbin_PROGRAMS = nft
+
+CLEANFILES = scanner.c parser_bison.c
+
+AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\""
+ ${LIBMNL_CFLAGS} ${LIBNFTNL_CFLAGS}
+
+AM_CFLAGS = -Wall \
+ -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
+ -Wdeclaration-after-statement -Wsign-compare -Winit-self \
+ -Wformat-nonliteral -Wformat-security -Wmissing-format-attribute \
+ -Wcast-align -Wundef -Wbad-function-cast
+ -Waggregate-return -Wunused -Wwrite-strings
+
+
+AM_YFLAGS = -d
+
+# yacc and lex generate dirty code
+parser_bison.o scanner.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls
+
+BUILT_SOURCES = parser_bison.h
+
+nft_SOURCES = main.c \
+ rule.c \
+ statement.c \
+ datatype.c \
+ expression.c \
+ evaluate.c \
+ proto.c \
+ payload.c \
+ exthdr.c \
+ meta.c \
+ ct.c \
+ netlink.c \
+ netlink_linearize.c \
+ netlink_delinearize.c \
+ segtree.c \
+ rbtree.c \
+ gmputil.c \
+ utils.c \
+ erec.c \
+ mnl.c \
+ scanner.l \
+ parser_bison.y
+
+if BUILD_CLI
+nft_SOURCES += cli.c
+endif
+
+nft_LDADD = ${LIBMNL_LIBS} ${LIBNFTNL_LIBS}
diff --git a/src/Makefile.in b/src/Makefile.in
deleted file mode 100644
index 0c080f6b..00000000
--- a/src/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-PROGRAMS += nft
-
-nft-destdir := @sbindir@
-
-nft-obj += main.o
-ifeq (@with_cli@,yes)
-nft-obj += cli.o
-endif
-nft-obj += rule.o
-nft-obj += statement.o
-nft-obj += datatype.o
-nft-obj += expression.o
-nft-obj += evaluate.o
-nft-obj += proto.o
-nft-obj += payload.o
-nft-obj += exthdr.o
-nft-obj += meta.o
-nft-obj += ct.o
-nft-obj += netlink.o
-nft-obj += netlink_linearize.o
-nft-obj += netlink_delinearize.o
-nft-obj += segtree.o
-nft-obj += rbtree.o
-nft-obj += gmputil.o
-nft-obj += utils.o
-nft-obj += erec.o
-nft-obj += mnl.o
-
-nft-obj += parser_bison.o
-nft-extra-clean-files += parser_bison.c parser_bison.h
-
-nft-obj += scanner.o
-nft-extra-clean-files += scanner.c scanner.h
diff --git a/src/cli.c b/src/cli.c
index 6f2847b8..f3827b81 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -12,6 +12,7 @@
* Development of this code funded by Astaro AG (http://www.astaro.com/)
*/
+#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
diff --git a/src/erec.c b/src/erec.c
index 4930085f..82543e6d 100644
--- a/src/erec.c
+++ b/src/erec.c
@@ -8,6 +8,7 @@
* Development of this code funded by Astaro AG (http://www.astaro.com/)
*/
+#include <config.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 85a1fb46..6eb0475e 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -33,7 +33,6 @@
#include <erec.h>
#include "parser_bison.h"
-#include "scanner.h"
void parser_init(struct parser_state *state, struct list_head *msgs)
{
diff --git a/src/scanner.l b/src/scanner.l
index 157c1e98..f0ed8d4e 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -169,6 +169,7 @@ ip6addr ({v680}|{v67}|{v66}|{v65}|{v64}|{v63}|{v62}|{v61}|{v60})
addrstring ({macaddr}|{ip4addr}|{ip6addr})
%option prefix="nft_"
+%option outfile="lex.yy.c"
%option reentrant
%option noyywrap
%option nounput