1 # client/Makefile - client program(s) Makefile
3 # This file is part of adns, which is Copyright Ian Jackson
4 # and contributors (see the file INSTALL for full details).
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation.
22 PROGS_SYSDEP= @PROGS_HAVE_TSEARCH@
23 ENABLE_DYNAMIC= @ENABLE_DYNAMIC@
25 PROGRAMS= adnslogres adnsheloex adnshost $(PROGS_SYSDEP)
26 PROGRAMS_LOCAL= fanftest adnstest addrtext
27 PROGRAMS_ALL= $(PROGRAMS) $(PROGRAMS_LOCAL)
29 STATIC_LIB= ../src/libadns.a
31 ifeq ($(ENABLE_DYNAMIC),elf)
32 DYNAMIC_DEP= ../dynamic/$(SHLIBFILE)
33 DYNAMIC_LINK= -L../dynamic -ladns
36 DYNAMIC_DEP= $(STATIC_LIB)
37 DYNAMIC_LINK= $(STATIC_LIB)
41 TARG_INSTALL= $(PROGRAMS)
42 TARG_LOCAL= $(addsuffix $(DYNAMIC_SUFFIX), $(PROGRAMS_ALL))
43 TARGETS= $(TARG_LOCAL) $(TARG_INSTALL)
44 include ../settings.make
46 ADNSDIR= $(srcdir)/../src
47 DIRCFLAGS= -I. -I../src -I$(ADNSDIR)
49 TARG_OBJS= $(addsuffix .o, $(PROGRAMS_ALL))
50 ADH_OBJS= adh-main.o adh-opts.o adh-query.o
51 ALL_OBJS= $(ADH_OBJS) $(TARG_OBJS)
56 install: $(TARG_INSTALL)
57 $(INSTALL_DIR) $(DESTDIR)$(bindir)
58 set -xe; for f in $(TARG_INSTALL); \
59 do $(INSTALL_PROGRAM) $$f $(DESTDIR)$(bindir)/$$f; done
62 for f in $(TARGETS); do rm -f $(bindir)/$$f; done
64 adnshost: $(ADH_OBJS) $(DYNAMIC_DEP)
65 $(CC) $(LDFLAGS) $(ADH_OBJS) $(DYNAMIC_LINK) -o $@ $(LDLIBS)
67 adnshost_s: $(ADH_OBJS) $(STATIC_LIB)
68 $(CC) $(LDFLAGS) $(ADH_OBJS) $(STATIC_LIB) -o $@ $(LDLIBS)
70 $(ADH_OBJS): adnshost.h
71 $(ALL_OBJS): $(ADNSDIR)/adns.h ../src/config.h
72 adnsresfilter.o: $(ADNSDIR)/tvarith.h
75 $(CC) $(LDFLAGS) $< $(DYNAMIC_LINK) -o $@ $(LDLIBS)
77 %_s: %.o $(STATIC_LIB)
78 $(CC) $(LDFLAGS) $< $(STATIC_LIB) -o $@ $(LDLIBS)