Update copyright dates
[adns] / regress / Makefile.in
CommitLineData
ae8cc977 1# regress/Makefile[.in] - regression test Makefile
1c957fda 2#
ae8cc977 3# This file is part of adns, which is
baa953c9 4# Copyright (C) 1997-2000,2003,2006,2014-2016 Ian Jackson
17cd4f48 5# Copyright (C) 2014 Mark Wooding
ae8cc977 6# Copyright (C) 1999-2000,2003,2006 Tony Finch
7# Copyright (C) 1991 Massachusetts Institute of Technology
8# (See the file INSTALL for full details.)
1c957fda 9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
7f8bbe29 12# the Free Software Foundation; either version 3, or (at your option)
1c957fda 13# any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
8c09a4c6 21# along with this program; if not, write to the Free Software Foundation.
1c957fda 22
9579019a 23srcdir= @srcdir@
24VPATH= @srcdir@
25
a069d77f 26PROGS_SYSDEP= @PROGS_HAVE_TSEARCH@
27
28CLIENTS= adnstest adnshost adnslogres $(PROGS_SYSDEP)
0ebff22d 29AUTOCHDRS= harness.h hsyscalls.h hredirect.h
30AUTOCSRCS= hrecord.c hplayback.c hcommon.c
2dee2b7a 31include ../settings.make
9579019a 32include $(srcdir)/../src/adns.make
33
2dee2b7a 34DIRCFLAGS= -I../src -I$(srcdir) -I$(srcdir)/../src
1c957fda 35
0ebff22d 36HCPPFLAGS= -DADNS_REGRESS_TEST -I.
1c957fda 37
0ebff22d 38REDIRLIBOBJS= $(addsuffix _d.o, $(basename $(LIBOBJS)))
39HARNLOBJS= hcommon.o $(REDIRLIBOBJS)
40TARGETS= $(addsuffix _record, $(CLIENTS)) $(addsuffix _playback, $(CLIENTS))
41ADH_OBJS= adh-main_c.o adh-opts_c.o adh-query_c.o
42ALL_OBJS= $(HARNLOBJS) dtest.o hrecord.o hplayback.o
1c957fda 43
0ebff22d 44.PRECIOUS: $(AUTOCSRCS) $(AUTOCHDRS)
45
46all install uninstall: $(TARGETS)
1c957fda 47
e726e5c1
IJ
48ALL_TESTS:=$(patsubst $(srcdir)/case-%.sys,%,$(wildcard $(srcdir)/case-*.sys))
49
50check: $(TARGETS) $(addprefix check-,$(ALL_TESTS))
51 @echo
52 @echo 'all tests passed or maybe skipped.'
53
54check-%: case-%.sys
55 @srcdir=$(srcdir) $(srcdir)/r1test $* || test $? = 5
1c957fda 56
0ebff22d 57LINK_CMD= $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
58
59%_record: %_c.o hrecord.o $(HARNLOBJS)
60 $(LINK_CMD)
61
62%_playback: %_c.o hplayback.o $(HARNLOBJS)
63 $(LINK_CMD)
81937f1c 64
0bc2d60e 65.SECONDARY: $(addsuffix _c.o, $(filter-out adnshost, $(CLIENTS)))
2260f64f
IJ
66# Without this, make will remove <client>_c.o after building <client>.
67# This wastes effort. (Debian bug #4073.)
68#
69# Also, it exposes us to a bug (in make 3.81, at least) which can
70# cause make to run the rule for building <client> without building
71# <client>_c.o! (Debian #756123.)
72#
73# See also Savannah #29620, http://savannah.gnu.org/bugs/index.php?29620
74
0ebff22d 75adnshost_%: $(ADH_OBJS) h%.o $(HARNLOBJS)
76 $(LINK_CMD)
1c957fda 77
0ebff22d 78%_d.o: $(srcdir)/../src/%.c hredirect.h
cada00d4 79 $(CC) $(CFLAGS) $(HCPPFLAGS) -c -g -o $@ $<
1c957fda 80
0ebff22d 81%_c.o: $(srcdir)/../client/%.c hredirect.h
cada00d4 82 $(CC) $(CFLAGS) $(HCPPFLAGS) -I $(srcdir)/../src -c -g -o $@ $<
73dba56e 83
0ebff22d 84$(ALL_OBJS): $(srcdir)/../src/adns.h $(srcdir)/../src/internal.h
85$(ALL_OBJS): harness.h hsyscalls.h
86$(ADH_OBJS): $(srcdir)/../client/adnshost.h
1c957fda 87
88%:: %.m4 hmacros.i4 hsyscalls.i4
2dee2b7a 89 $(M4) -P -I$(srcdir) $< >$@-a.new
1c957fda 90 sed -e 's/hm_comma/,/g; s/hm_squote/'\''/g; /^[ ]*$$/d' <$@-a.new >$@-b.new
2dee2b7a 91 @mv -f $@-b.new $(srcdir)/$@; rm -f $@-a.new