root/src/udns/Makefile.in

Revision 4c7aa255f411de003f93889920a5446f00a34c50, 5.9 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 4 years ago)

cleaner clean from Marti Raudsepp

  • 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: 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         echo "const struct dns_nameval *dns_class_index(int i) {"; \
100         echo "  return &dns_classtab[i];"; \
101         echo "}"; \
102         echo "const struct dns_nameval *dns_type_index(int i) {"; \
103         echo "  return &dns_typetab[i];"; \
104         echo "}"; \
105         echo "const struct dns_nameval *dns_rcode_index(int i) {"; \
106         echo "  return &dns_rcodetab[i];"; \
107         echo "}"; \
108         while [ "$$1" ]; do \
109          echo; \
110          echo "const struct dns_nameval dns_$${2}tab[] = {"; \
111          $(AWK) "/^  DNS_$${1}_[A-Z0-9_]+[      ]*=/ \
112           { printf \" {%s,\\\"%s\\\"},\\n\", \$$1, substr(\$$1,7) }" \
113           udns.h ; \
114          echo " {0,0}};"; \
115          echo "const char *dns_$${2}name(enum dns_$${2} code) {"; \
116          echo " static char nm[20];"; \
117          echo " switch(code) {"; \
118          $(AWK) "BEGIN{i=0} \
119            /^  DNS_$${1}_[A-Z0-9_]+[    ]*=/ \
120            {printf \" case %s: return dns_$${2}tab[%d].name;\\n\",\$$1,i++}\
121            " udns.h ; \
122          echo " }"; \
123          echo " return _dns_format_code(nm,\"$$2\",code);"; \
124          echo "}"; \
125          shift 2; \
126         done
127         @mv $@.tmp $@
128
129 udns.3.html: udns.3
130         groff -man -Thtml udns.3 > $@.tmp
131         mv $@.tmp $@
132
133 clean:
134         rm -f libudns.o udns_codes.c
135         rm -f $(OBJS)
136         rm -f $(SOBJS)
137         rm -f $(UOBJS)
138         rm -f build-stamp config.log
139
140 distclean: clean
141         rm -f $(LIBS) $(SOLIB) udns.3.html
142         rm -f $(UTILS) $(SOUTILS)
143         rm -f config.status Makefile
144
145 .PHONY: all static staticlib shared sharedlib dist clean distclean subdist \
146   depend dep deps
147
148 depend dep deps: $(SRCS) $(USRC)
149         @echo Generating deps for:
150         @echo \ $(SRCS)
151         @echo \ $(USRCS)
152         @sed '/^# depend/q' Makefile.in > Makefile.tmp
153         @set -e; \
154         for f in $(SRCS) $(USRCS); do \
155          echo $${f%.c}.o $${f%.c}.lo: $$f \
156           `sed -n 's/^#[        ]*include[      ]*"\(.*\)".*/\1/p' $$f`; \
157         done >> Makefile.tmp; \
158         for f in $(USRCS:.c=.o); do \
159          echo "$${f%.?}: $$f \$$(LIB)"; \
160          echo " \$$(CC) \$$(CFLAGS) -o \$$@ $$f \$$(LIBFL)"; \
161          echo "$${f%.?}_s: $$f \$$(SOLIB)"; \
162          echo " \$$(CC) \$$(CFLAGS) -o \$$@ $$f \$$(SOLIBFL)"; \
163         done >> Makefile.tmp ; \
164         if cmp Makefile.tmp Makefile.in >/dev/null 2>&1 ; then \
165          echo Makefile.in unchanged; rm -f Makefile.tmp; \
166         else \
167          echo Updating Makfile.in; mv -f Makefile.tmp Makefile.in ; \
168         fi
169
170 # depend
171 udns_dn.o udns_dn.lo: udns_dn.c udns.h
172 udns_dntosp.o udns_dntosp.lo: udns_dntosp.c udns.h
173 udns_parse.o udns_parse.lo: udns_parse.c udns.h
174 udns_resolver.o udns_resolver.lo: udns_resolver.c udns_config.h udns.h
175 udns_init.o udns_init.lo: udns_init.c udns_config.h udns.h
176 udns_misc.o udns_misc.lo: udns_misc.c udns.h
177 udns_XtoX.o udns_XtoX.lo: udns_XtoX.c udns_config.h udns.h inet_XtoX.c
178 udns_rr_a.o udns_rr_a.lo: udns_rr_a.c udns.h
179 udns_rr_ptr.o udns_rr_ptr.lo: udns_rr_ptr.c udns.h
180 udns_rr_mx.o udns_rr_mx.lo: udns_rr_mx.c udns.h
181 udns_rr_txt.o udns_rr_txt.lo: udns_rr_txt.c udns.h
182 udns_bl.o udns_bl.lo: udns_bl.c udns.h
183 udns_rr_srv.o udns_rr_srv.lo: udns_rr_srv.c udns.h
184 udns_rr_naptr.o udns_rr_naptr.lo: udns_rr_naptr.c udns.h
185 udns_codes.o udns_codes.lo: udns_codes.c udns.h
186 dnsget.o dnsget.lo: dnsget.c udns_config.h udns.h getopt.c
187 rblcheck.o rblcheck.lo: rblcheck.c udns.h getopt.c
188 ex-rdns.o ex-rdns.lo: ex-rdns.c udns.h
189 dnsget: dnsget.o $(LIB)
190         $(CC) $(CFLAGS) -o $@ dnsget.o $(LIBFL)
191 dnsget_s: dnsget.o $(SOLIB)
192         $(CC) $(CFLAGS) -o $@ dnsget.o $(SOLIBFL)
193 rblcheck: rblcheck.o $(LIB)
194         $(CC) $(CFLAGS) -o $@ rblcheck.o $(LIBFL)
195 rblcheck_s: rblcheck.o $(SOLIB)
196         $(CC) $(CFLAGS) -o $@ rblcheck.o $(SOLIBFL)
197 ex-rdns: ex-rdns.o $(LIB)
198         $(CC) $(CFLAGS) -o $@ ex-rdns.o $(LIBFL)
199 ex-rdns_s: ex-rdns.o $(SOLIB)
200         $(CC) $(CFLAGS) -o $@ ex-rdns.o $(SOLIBFL)
Note: See TracBrowser for help on using the browser.