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