Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1 from jib/makefile-lovin
make it work both manually, and with defaults based on
  • Loading branch information
jib committed Aug 30, 2012
2 parents 76ce800 + 6bf3260 commit d03a23b
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/Makefile.am
@@ -1,6 +1,21 @@
INCLUDES = -I$(VARNISHSRC)/include -I$(VARNISHSRC)
# if VARNISHSRC is defined on the command-line, use that. Otherwise, build
# this the same as the modules that come with varnish (i.e. we're building
# within the varnish src dir itself, and $(top_srcdir) is the varnish source).
#
ifdef $(VARNISHSRC):
SRC = $(VARNISHSRC)
DIR_PREFIX = /
else:
SRC = $(top_srcdir)
DIR_PREFIX = lib/libvmod-timers/

INCLUDES = -I$(SRC)/include -I$(SRC)

ifdef $(VMODDIR):
vmoddir = $(VMODDIR)
else:
vmoddir = $(pkglibdir)/vmods

vmoddir = $(VMODDIR)
vmod_LTLIBRARIES = libvmod_timers.la

libvmod_timers_la_LDFLAGS = -module -export-dynamic -avoid-version
Expand All @@ -10,14 +25,14 @@ libvmod_timers_la_SOURCES = \
vcc_if.h \
vmod_timers.c

vcc_if.c vcc_if.h: $(VARNISHSRC)/lib/libvmod_std/vmod.py $(top_srcdir)/src/vmod_timers.vcc
@PYTHON@ $(VARNISHSRC)/lib/libvmod_std/vmod.py $(top_srcdir)/src/vmod_timers.vcc
vcc_if.c vcc_if.h: $(SRC)/lib/libvmod_std/vmod.py $(top_srcdir)/$(DIR_PREFIX)src/vmod_timers.vcc
@PYTHON@ $(SRC)/lib/libvmod_std/vmod.py $(top_srcdir)/$(DIR_PREFIX)src/vmod_timers.vcc

VMOD_TESTS = tests/*.vtc
.PHONY: $(VMOD_TESTS)

tests/*.vtc:
$(VARNISHSRC)/bin/varnishtest/varnishtest -Dvarnishd=$(VARNISHSRC)/bin/varnishd/varnishd -Dvmod_topbuild=$(abs_top_builddir) $@
$(SRC)/bin/varnishtest/varnishtest -Dvarnishd=$(top_srcdir)/bin/varnishd/varnishd -Dvmod_topbuild=$(abs_top_builddir) $@

check: $(VMOD_TESTS)

Expand Down

0 comments on commit d03a23b

Please sign in to comment.