root/src/udns/Makefile.in

Revision 5a9b91bc0a14543e0995eba973fbeacc05aaee8b, 5.5 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

svn merge -r 327:330 https://labs.omniti.com/reconnoiter/branches/dev/udns .

closes #38

  • Property mode set to 100644
Line 
1 # libudns Makefile
2 #
3 # Copyright (C) 2005  Michael Tokarev <mjt@corpit.ru>
4 # This file is part of UDNS library, an async DNS stub resolver.
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This library 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 GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library, in file named COPYING.LGPL; if not,
18 # write to the Free Software Foundation, Inc., 59 Temple Place,
19 # Suite 330, Boston, MA  02111-1307  USA
20
21 NAME   = udns
22 VERS   = 0.0.9
23 SRCS   = udns_dn.c udns_dntosp.c udns_parse.c udns_resolver.c udns_init.c \
24         udns_misc.c udns_XtoX.c \
25         udns_rr_a.c udns_rr_ptr.c udns_rr_mx.c udns_rr_txt.c udns_bl.c \
26         udns_rr_srv.c udns_rr_naptr.c udns_codes.c
27 USRCS  = dnsget.c rblcheck.c ex-rdns.c
28 DEB    = debian/copyright debian/changelog debian/control debian/rules
29 DIST   = COPYING.LGPL udns.h udns.3 dnsget.1 rblcheck.1 $(SRCS) $(USRCS) \
30          NEWS TODO NOTES Makefile.in configure configure.lib \
31          inet_XtoX.c getopt.c
32
33 CC=@CC@
34 CPPFLAGS=@CPPFLAGS@
35 CFLAGS=@CFLAGS@
36 LDFLAGS=@LDFLAGS@
37 AR=@AR@
38 RANLIB=@RANLIB@
39 LIBS=@LIBS@
40 INSTALL=@INSTALL@
41
42 prefix=@prefix@
43 exec_prefix=@exec_prefix@
44 bindir=@bindir@
45 sbindir=@sbindir@
46 libdir=@libdir@
47 includedir=${prefix}/include
48 libexecdir=@libexecdir@
49 datarootdir = @datarootdir@
50 mandir=@mandir@
51 mansubdir=@mansubdir@
52 docdir=${prefix}/@docdir@
53 sysconfdir=@sysconfdir@
54 srcdir=@srcdir@
55 top_srcdir=@top_srcdir@
56
57
58 OBJS   = $(SRCS:.c=.o) $(GEN:.c=.o)
59 LIB    = lib$(NAME).a
60 LIBFL  = -L. -l$(NAME)
61
62 LIBS   = $(LIB)
63
64 UTILS   = $(USRCS:.c=)
65 UOBJS   = $(USRCS:.c=.o)
66 SOUTILS = $(USRCS:.c=_s)
67
68 NAMEPFX = $(NAME)-$(VERS)
69
70 CDEFS = -DHAVE_UDNS_CONFIG_H
71 AWK = awk
72
73 all: static libudns.o
74
75 .SUFFIXES: .c .o .lo
76
77 static: $(LIB) $(UTILS)
78 staticlib: $(LIB)
79 $(LIB): $(OBJS)
80         -rm -f $@
81         @echo "- linking $@"
82         @$(AR) rv $@ $(OBJS)
83
84 libudns.o:      $(OBJS)
85         @echo "- linking libudns.o"
86         @ld -r -o $@ $(OBJS)
87
88 .c.o:
89         @echo "- compiling $<"
90         @$(CC) $(CPPFLAGS) $(CFLAGS) $(CDEFS) -c $<
91
92 # udns_codes.c is generated from udns.h
93 udns_codes.c: udns.h
94         @echo Generating $@
95         @set -e; exec >$@.tmp; \
96         set T type C class R rcode; \
97         echo "/* Automatically generated. */"; \
98         echo "#include \"udns.h\""; \
99         while [ "$$1" ]; do \
100          echo; \
101          echo "const struct dns_nameval dns_$${2}tab[] = {"; \
102          $(AWK) "/^  DNS_$${1}_[A-Z0-9_]+[      ]*=/ \
103           { printf \" {%s,\\\"%s\\\"},\\n\", \$$1, substr(\$$1,7) }" \
104           udns.h ; \
105          echo " {0,0}};"; \
106          echo "const char *dns_$${2}name(enum dns_$${2} code) {"; \
107          echo " static char nm[20];"; \
108          echo " switch(code) {"; \
109          $(AWK) "BEGIN{i=0} \
110            /^  DNS_$${1}_[A-Z0-9_]+[    ]*=/ \
111            {printf \" case %s: return dns_$${2}tab[%d].name;\\n\",\$$1,i++}\
112            " udns.h ; \
113          echo " }"; \
114          echo " return _dns_format_code(nm,\"$$2\",code);"; \
115          echo "}"; \
116          shift 2; \
117         done
118         @mv $@.tmp $@
119
120 udns.3.html: udns.3
121         groff -man -Thtml udns.3 > $@.tmp
122         mv $@.tmp $@
123
124 clean:
125         rm -f $(OBJS)
126         rm -f $(SOBJS)
127         rm -f $(UOBJS)
128         rm -f build-stamp config.log
129
130 distclean: clean
131         rm -f $(LIBS) $(SOLIB) udns.3.html
132         rm -f $(UTILS) $(SOUTILS)
133         rm -f config.status Makefile
134
135 .PHONY: all static staticlib shared sharedlib dist clean distclean subdist \
136   depend dep deps
137
138 depend dep deps: $(SRCS) $(USRC)
139         @echo Generating deps for:
140         @echo \ $(SRCS)
141         @echo \ $(USRCS)
142         @sed '/^# depend/q' Makefile.in > Makefile.tmp
143         @set -e; \
144         for f in $(SRCS) $(USRCS); do \
145          echo $${f%.c}.o $${f%.c}.lo: $$f \
146           `sed -n 's/^#[        ]*include[      ]*"\(.*\)".*/\1/p' $$f`; \
147         done >> Makefile.tmp; \
148         for f in $(USRCS:.c=.o); do \
149          echo "$${f%.?}: $$f \$$(LIB)"; \
150          echo " \$$(CC) \$$(CFLAGS) -o \$$@ $$f \$$(LIBFL)"; \
151          echo "$${f%.?}_s: $$f \$$(SOLIB)"; \
152          echo " \$$(CC) \$$(CFLAGS) -o \$$@ $$f \$$(SOLIBFL)"; \
153         done >> Makefile.tmp ; \
154         if cmp Makefile.tmp Makefile.in >/dev/null 2>&1 ; then \
155          echo Makefile.in unchanged; rm -f Makefile.tmp; \
156         else \
157          echo Updating Makfile.in; mv -f Makefile.tmp Makefile.in ; \
158         fi
159
160 # depend
161 udns_dn.o udns_dn.lo: udns_dn.c udns.h
162 udns_dntosp.o udns_dntosp.lo: udns_dntosp.c udns.h
163 udns_parse.o udns_parse.lo: udns_parse.c udns.h
164 udns_resolver.o udns_resolver.lo: udns_resolver.c udns_config.h udns.h
165 udns_init.o udns_init.lo: udns_init.c udns_config.h udns.h
166 udns_misc.o udns_misc.lo: udns_misc.c udns.h
167 udns_XtoX.o udns_XtoX.lo: udns_XtoX.c udns_config.h udns.h inet_XtoX.c
168 udns_rr_a.o udns_rr_a.lo: udns_rr_a.c udns.h
169 udns_rr_ptr.o udns_rr_ptr.lo: udns_rr_ptr.c udns.h
170 udns_rr_mx.o udns_rr_mx.lo: udns_rr_mx.c udns.h
171 udns_rr_txt.o udns_rr_txt.lo: udns_rr_txt.c udns.h
172 udns_bl.o udns_bl.lo: udns_bl.c udns.h
173 udns_rr_srv.o udns_rr_srv.lo: udns_rr_srv.c udns.h
174 udns_rr_naptr.o udns_rr_naptr.lo: udns_rr_naptr.c udns.h
175 udns_codes.o udns_codes.lo: udns_codes.c udns.h
176 dnsget.o dnsget.lo: dnsget.c udns_config.h udns.h getopt.c
177 rblcheck.o rblcheck.lo: rblcheck.c udns.h getopt.c
178 ex-rdns.o ex-rdns.lo: ex-rdns.c udns.h
179 dnsget: dnsget.o $(LIB)
180         $(CC) $(CFLAGS) -o $@ dnsget.o $(LIBFL)
181 dnsget_s: dnsget.o $(SOLIB)
182         $(CC) $(CFLAGS) -o $@ dnsget.o $(SOLIBFL)
183 rblcheck: rblcheck.o $(LIB)
184         $(CC) $(CFLAGS) -o $@ rblcheck.o $(LIBFL)
185 rblcheck_s: rblcheck.o $(SOLIB)
186         $(CC) $(CFLAGS) -o $@ rblcheck.o $(SOLIBFL)
187 ex-rdns: ex-rdns.o $(LIB)
188         $(CC) $(CFLAGS) -o $@ ex-rdns.o $(LIBFL)
189 ex-rdns_s: ex-rdns.o $(SOLIB)
190         $(CC) $(CFLAGS) -o $@ ex-rdns.o $(SOLIBFL)
Note: See TracBrowser for help on using the browser.