summaryrefslogtreecommitdiffabout
path: root/src/Makefile.am
Side-by-side diff
Diffstat (limited to 'src/Makefile.am') (more/less context) (ignore whitespace changes)
-rw-r--r--src/Makefile.am37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index a20f9cb..7917730 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
# This file is part of vmod-binlog
-# Copyright (C) 2013 Sergey Poznyakoff
+# Copyright (C) 2013-2014 Sergey Poznyakoff
#
# Vmod-binlog is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,7 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with vmod-binlog. If not, see <http://www.gnu.org/licenses/>.
-AM_CPPFLAGS = -I$(VARNISHSRC)/include -I$(VARNISHSRC)
+AM_CPPFLAGS =\
+ -I$(VARNISHSRC)/include\
+ -I$(VARNISHSRC)/bin/varnishd\
+ -I$(VARNISHSRC)
noinst_LIBRARIES = libbinlog.a
libbinlog_a_SOURCES = pack.c err.c parse-datetime.y xalloc.c
@@ -38,17 +41,33 @@ libvmod_binlog_la_LIBADD=
libvmod_binlog_la_SOURCES = \
binlog.c\
pack.c\
- vmod-binlog.h\
- vcc_if.c vcc_if.h
-
+ vmod-binlog.h
+nodist_libvmod_binlog_la_SOURCES = vcc_if.c vcc_if.h
noinst_HEADERS = pack.h err.h parse-datetime.h xalloc.h
-BUILT_SOURCES = vcc_if.c vcc_if.h
+binlog.lo: vcc_if.c vcc_if.h
+
+CLEANFILES = vcc_if.c vcc_if.h *.rst
+
+if VARNISH4
+ vmodtool = $(VARNISHSRC)/lib/libvcc/vmodtool.py
+ vmodtoolargs = --strict
+ vccfile = $(top_srcdir)/src/vmod.vcc
+else
+ vmodtool = $(VARNISHSRC)/lib/libvmod_std/vmod.py
+ vmodtoolargs =
+ vccfile = vmod.vcc3
+
+vmod.vcc3: $(top_srcdir)/src/vmod.vcc
+ CLEANFILES += vmod.vcc3
+endif
+
+.vcc.vcc3:
+ sed -n '/^\$$/{s///;s/\(Module *[^ ][^ ]*\).*/\1/;p}' $< > $@
-vcc_if.c vcc_if.h: $(VARNISHSRC)/lib/libvmod_std/vmod.py $(top_srcdir)/src/vmod.vcc
- @PYTHON@ $(VARNISHSRC)/lib/libvmod_std/vmod.py $(top_srcdir)/src/vmod.vcc
+vcc_if.c vcc_if.h: $(vmodtool) $(vccfile)
+ @PYTHON@ $(vmodtool) $(vmodtoolargs) $(vccfile)
EXTRA_DIST = vmod.vcc
-CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h

Return to:

Send suggestions and report system problems to the System administrator.