1 # Makefile for BIND>=4.9 top level
2 # vixie@decwrl December, 1992 [original]
4 # $Id: Makefile,v 8.39 1996/08/05 08:31:20 vixie Exp $
9 ## The Regents of the University of California. All rights reserved.
11 ## Redistribution and use in source and binary forms, with or without
12 ## modification, are permitted provided that the following conditions
14 ## 1. Redistributions of source code must retain the above copyright
15 ## notice, this list of conditions and the following disclaimer.
16 ## 2. Redistributions in binary form must reproduce the above copyright
17 ## notice, this list of conditions and the following disclaimer in the
18 ## documentation and/or other materials provided with the distribution.
19 ## 3. All advertising materials mentioning features or use of this software
20 ## must display the following acknowledgement:
21 ## This product includes software developed by the University of
22 ## California, Berkeley and its contributors.
23 ## 4. Neither the name of the University nor the names of its contributors
24 ## may be used to endorse or promote products derived from this software
25 ## without specific prior written permission.
27 ## THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 ## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 ## ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 ## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 ## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 ## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 ## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 ## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 ## Portions Copyright (c) 1993 by Digital Equipment Corporation.
41 ## Permission to use, copy, modify, and distribute this software for any
42 ## purpose with or without fee is hereby granted, provided that the above
43 ## copyright notice and this permission notice appear in all copies, and that
44 ## the name of Digital Equipment Corporation not be used in advertising or
45 ## publicity pertaining to distribution of the document or software without
46 ## specific, written prior permission.
48 ## THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
49 ## WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
50 ## OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
51 ## CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
52 ## DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
53 ## PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
54 ## ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
66 COMPLIB = compat/lib/lib44bsd.a
68 # The default build parameters are given for 4.4 BSD. They should
69 # be overridden for other operating systems as indicated below.
71 #(BSD4.4, BSD/OS, FreeBSD, NetBSD, other net2-alikes)
73 # DO NOT COMMENT THESE OUT. OVERRIDE THEM BELOW.
86 DESTEXEC = /usr/libexec
87 DESTMAN = /usr/share/man
88 DESTHELP = /usr/share/misc
90 DESTINC = /usr/include
91 COMPINCL = compat/include
94 INSTALL_COMPAT = install
98 MANROFF = ( tbl | nroff -man )
105 # (NetBSD - for details on shared library building, see shres/netbsd/INSTALL)
106 #uncomment next three lines to build a shared library version of libresolv
107 #SHRES = shres/netbsd
111 #(Linux - on modern systems, all you need to do is rename or remove
112 # compat/include/sys/cdefs.h. See doc/info/Linux for more information.)
113 #CC = gcc $(CPPFLAGS)
117 #DESTEXEC = /usr/sbin
129 #(DEC AXP OSF/1 Version 2.1 and earlier)
131 #CDEBUG = -g3 -O2 -Olimit 2000
135 #DESTEXEC = /usr/sbin
136 #COMPINCL = compat/include
137 #INSTALL_COMPAT = install-compat
138 #INSTALL = installbsd
145 #(DEC AXP OSF/1 Version 3.0 and after)
146 #CC = cc $(CPPFLAGS) -std
147 #CDEBUG = -g3 -O2 -Olimit 2000
151 #DESTEXEC = /usr/sbin
152 #COMPINCL = compat/include
153 #INSTALL_COMPAT = install-compat
154 #INSTALL = installbsd
162 #CC = cc $(CPPFLAGS) -xansi -signed
164 #CPPFLAGS = -D__STDC__ -D_BSD_SIGNALS -DSIG_FN=int
169 #DESTMAN = /usr/catman/local
171 #INSTALL = bsdinstall.sh
174 #(bsdinstall.sh is in conf/)
178 #CC = cc $(CPPFLAGS) -xansi -signed
180 #CPPFLAGS = -D__STDC__ -D_BSD_SIGNALS -DSIG_FN=void -D__BIT_TYPES_DEFINED__
185 #DESTMAN = /usr/share/catman/local
187 #INSTALL = bsdinstall.sh
190 #(bsdinstall.sh is in conf/)
196 #CPPFLAGS = -DSUNOS4 -DSPRINTF_CHAR
201 #(add "-ldl" to LIBS if your links fail with "dlopen" problems. this indicates
202 # that your libc.so file is screwed up, but it's easier to fix this than that.)
207 #COMPINCL = compat/include
211 #INSTALL_COMPAT = install-compat
214 # (for details on shared library building, see shres/sunos/INSTALL;
215 # note that shres/solaris/INSTALL has some good testing notes for sunos)
216 #uncomment next line to build a shared library version of libresolv
218 # uncomment only one of the pairs of lines below
219 # -- if you use gcc (recommended)
220 # (if -fpic doesn't work, see shres/sunos/PROBLEMS)
221 #SHCC = gcc -DSUNSECURITY $(CPPFLAGS)
222 #PIC= -fpic -D_res=_res_shlib
223 # -- if you use Sun's cc
224 #SHCC = /usr/bin/cc -DSUNSECURITY $(CPPFLAGS)
225 #PIC = -pic -D_res=_res_shlib
227 #(ULTRIX/RISC - also see below)
228 #CC = cc $(CPPFLAGS) -Olimit 2000 -YPOSIX
230 #(ULTRIX, other 4.[23]bsd-alikes)
239 #COMPINCL = compat/include
241 #INSTALL_COMPAT = install-compat
248 #(solaris2.x/sunos5.x)
249 #be careful with installation - note in particular that the system ships
250 #with /usr/sbin/in.named (with in.) and /usr/sbin/named-xfer (without in.)
251 #to emulate this naming, INDOT should be set to 'in.' while XFER_INDOT
252 #should be empty. also, under solaris2.x, use 'make install' at your own risk.
253 #don't include sys/stream.h via netinet/in.h by defining _SYS_STREAM_H.
254 #->and note that sun moved their nslookup to /usr/sbin for some odd reason;
255 # when you install this one in /usr/bin you should delete sun's or else you
256 # will get confusing results since you never know which nslookup you're using.
259 #uncomment next line for Sun C compiler
260 #CC = /opt/SUNWspro/bin/cc $(CPPFLAGS) -R$(DESTLIB)
261 #uncomment next line for GNU C compiler
262 #CC = gcc $(CPPFLAGS) -Xlinker -R$(DESTLIB)
263 #otherwise uncomment the next line and hope for the best
266 #CPPFLAGS = -DSVR4 -D_SYS_STREAM_H $(SOLCOMPAT)
269 #LIBS = -ll -lnsl -lsocket
270 #DESTEXEC = /usr/sbin
273 #INSTALL = /usr/ucb/install
282 #uncomment next line for link-compatibility with Solaris resolver library
283 #SOLCOMPAT = -Dgethostbyname=res_gethostbyname \
284 # -Dgethostbyaddr=res_gethostbyaddr -Dgetnetbyname=res_getnetbyname \
285 # -Dgetnetbyaddr=res_getnetbyaddr -Dsethostent=res_sethostent \
286 # -Dendhostent=res_endhostent -Dgethostent=res_gethostent \
287 # -Dsetnetent=res_setnetent -Dendnetent=res_endnetent \
288 # -Dgetnetent=res_getnetent
289 # for details on shared library building, see shres/solaris/INSTALL
290 #uncomment next line to build a shared library version of libresolv
291 #SHRES = shres/solaris
292 #uncomment next line to build tools and named with shared libresolv
293 #if you do so, you *must* define SOLCOMPAT as well (and it must be in CPPFLAGS)
294 #RES = $(SHRES)/libresolv.so
295 # uncomment only one of the triplets of lines below
296 # -- if you use gcc (recommended)
297 # (if -fpic doesn't work, see shres/solaris/ISSUES)
298 #SHCC = gcc -DSVR4 -D_SYS_STREAM_H
300 #SHLD = /usr/ccs/bin/ld -G
301 # -- if you use Sun's cc
302 #SHCC = /opt/SUNWspro/bin/cc -DSVR4 -D_SYS_STREAM_H
304 #SHLD = /opt/SUNWspro/bin/cc -G
306 #(hpux7.0,hpux8.0,hpux9.0,)
317 #INSTALL = bsdinstall.sh
321 #(bsdinstall.sh is in conf/)
326 #CPPFLAGS = -U_APOLLO_SOURCE -D_BSD_SOURCE -DSPRINTF_CHAR -D_CLASSIC_BSD_SPRINTF
338 #CC = bsdcc $(CPPFLAGS)
342 #DESTEXEC = /usr/sbin
343 #INSTALL = /usr/ucb/install
350 #CC = gcc $(CPPFLAGS) -g -O2 -fpcc-struct-return -fno-builtin -funsigned-char
356 #PIDDIR = /usr/local/etc
357 #DESTBIN = /usr/local/bin
358 #DESTSBIN = /usr/local/bin
359 #DESTEXEC = /usr/local/etc
360 #DESTMAN = /usr/local/man
361 #DESTHELP = /usr/local/etc
362 #DESTLIB = /usr/local/lib
363 #DESTINC = /usr/local/include
364 #COMPINCL = compat/include
366 #INSTALL_COMPAT = install
371 #(NEC EWS4800 EWS-UX/V Rel4.0/Rel4.2,UX/4800)
372 #be careful with installation - note in particular that the system ships
373 #with /usr/sbin/in.named (with in.) and /usr/sbin/named-xfer (without in.)
374 #to emulate this naming, INDOT should be set to in. and XFER_INDOT should be
375 #set to empty. also, under EWS4800, use 'make install' at your own risk.
376 #CC = /usr/necccs/bin/cc $(CPPFLAGS)
377 #CC = /usr/abiccs/bin/cc $(CPPFLAGS)
379 #CPPFLAGS = -DSVR4 -DUSE_POSIX
383 #LIBS = -ll -lnsl -lsocket
384 #DESTBIN = /usr/local/bin
387 #DESTHELP = /usr/local/lib
388 #DESTLIB = /usr/local/lib
389 #DESTINC = /usr/local/include
390 #DESTMAN = /usr/local/man
394 #COMPINCL = compat/include
396 #INSTALL_COMPAT = install-compat
397 #INSTALL = /usr/ucb/install
401 # SCO Unix 3.4.2 / ODT 3.0 using gcc (the only choice for now)
402 #CC = gcc $(CPPFLAGS)
403 #CPPFLAGS = -DSYSV -DSYSV3
408 #LIBS=-ll -lnsl_s -lsocket -lc_s
413 #DESTMAN=/usr/local/man
417 #COMPINCL=compat/include
419 #INSTALL_COMPAT = install-compat
421 #MANROFF= (tbl | groff -man -Tascii)
427 #CPPFLAGS = -DSVR4 -DBSD_COMP -DUSE_POSIX -D_SYS_STREAM_H
432 #INSTALL = /usr/ucb/install
434 #LIBS = -ll -lsocket -lnsl
436 #LIBS = -ll -lsocket -lnsl -lgen
437 #DESTSBIN = /usr/sbin
438 #DESTEXEC = /usr/sbin
444 #INSTALL_COMPAT = install-compat
450 #(NeXTstep 2.0ff, single architecture make)
451 #CC = cc $(CPPFLAGS) #you can use -O2 for 3.2ff
452 #CPPFLAGS = -Dpid_t=int
464 #INSTALL_COMPAT = install-compat
467 #(NeXTstep 3.3 Multi Architecture Binaries)
468 #CC = cc $(CPPFLAGS) -arch i386 -arch m68k -arch hppa -arch sparc
470 #CPPFLAGS = -Dpid_t=int
484 #INSTALL_COMPAT = install-compat
490 #CPPFLAGS = -DSVR4 -DPOSIX_SIGNALS
492 #LIBS = -ll -lnsl -lsocket
498 #CC = cc $(CPPFLAGS) -Wc,-pw
500 #CPPFLAGS = -Du_int=\"unsigned int\" -DSYSV
502 #LIBS = -ll -lsocket -linet -lnsl -lseq
504 #DESTSBIN = /usr/local/etc
505 #DESTEXEC = /usr/local/etc
506 #DESTHELP = /usr/local/lib
514 #CC = gcc $(CPPFLAGS)
516 #CPPFLAGS = -D__STDC__ -DDGUX
521 #DESTMAN = /usr/local/man
524 #DESTINC = /usr/include
529 #(epix) Has to be compiled and loaded with -systype bsd43
530 # Epix 2.x.x requires /bsd43/bin in front of the PATH variable
531 #CC = cc $(CPPFLAGS) -signed -systype bsd43
533 #CPPFLAGS = -DSTDIN_FILENO=0
536 #DESTSBIN = /etc/local
537 #DESTEXEC = /etc/local
538 #DESTMAN = /usr/local/man
540 #INSTALL = install.sh
546 #CC = cc $(CPPFLAGS) -systype bsd43
547 #CPPFLAGS = -Dpid_t=int
548 #CDEBUG = -O -g3 -Olimit 1000
552 #DESTBIN = /usr/local/bin
555 #DESTMAN = /usr/local/man
556 #DESTHELP = /usr/local/lib
557 #DESTLIB = /usr/local/lib
558 #DESTINC = /usr/local/include
562 #Esix SVR4.0.4 with gcc
563 # also works for Dell 2.2 and other i386 SVR4.0. Probably Unixware 1.1 as well.
564 #Be careful with installation - note in particular that the system ships
565 #with /usr/sbin/in.named (with in.) and /usr/sbin/named-xfer (without in.)
566 #to emulate this naming, INDOT should be set to in. and XFER_INDOT should be
567 #set to empty. also, use 'make install' at your own risk.
568 #don't include sys/stream.h via netinet/in.h by defining _SYS_STREAM_H.
569 #CC = gcc $(CPPFLAGS)
570 #CPPFLAGS = -DSVR4 -DBSD_COMP -DUSE_POSIX -D_SYS_STREAM_H
576 #INSTALL = /usr/ucb/install
577 #LIBS = -ll -lsocket -lnsl
578 #DESTSBIN = /usr/sbin
579 #DESTEXEC = /usr/sbin
589 #CC = gcc -DISC -posix
599 #DESTMAN = /usr/catman/l_man
608 # AUX 3.x (I used 3.1.1)
609 #CC = gcc $(CPPFLAGS)
611 #CPPFLAGS = -D_POSIX_SOURCE -DSYSV
613 #LIBS = -ll -lposix -lmalloc -s
618 #DESTMAN = /usr/local/man
620 #COMPINCL = compat/include
622 #INSTALL_COMPAT = install-compat
629 #use same definitions as for sunos4.x except for the following
630 #be careful with installation - note in particular that the system ships
631 #with /usr/sbin/in.named (with in.) and /usr/sbin/named-xfer (without in.)
632 #to emulate this naming, INDOT should be set to 'in.' while XFER_INDOT
633 #should be empty. also, under solaris2.x, use 'make install' at your own risk.
634 #don't include sys/stream.h via netinet/in.h by defining _SYS_STREAM_H.
635 #PIDDIR = /usr/local/lib
639 #CPPFLAGS = -DSVR4 -D_SYS_STREAM_H -Hnocopyr -DPOSIX_SIGNALS -DNCR -w
642 #LIBS = -ll -lnsl -lsocket
643 #DESTEXEC = /usr/local/bin
652 ####################################################################
653 ############ no user servicable parts beyond this point ############
654 ####################################################################
657 "SHELL=${SHELL}" "INDOT=${INDOT}" "XFER_INDOT=${XFER_INDOT}" \
658 "DESTDIR=${DESTDIR}" "DESTMAN=${DESTMAN}" "INSTALL=${INSTALL}" \
659 CATEXT='${CATEXT}' MANDIR='${MANDIR}' MANROFF='${MANROFF}'
661 MARGS = "VER=${VER}" "CC=${CC}" "CDEBUG=${CDEBUG}" "LIBS=${LIBS}" \
662 "INCL=../${INCL}" "RES=../${RES}" "LEX=${LEX}" "LDFLAGS=${LDFLAGS}" \
663 "PIDDIR=${PIDDIR}" "DESTBIN=${DESTBIN}" "DESTSBIN=${DESTSBIN}" \
664 "DESTEXEC=${DESTEXEC}" "COMPINCL=../${COMPINCL}" \
665 "COMPLIB=../${COMPLIB}" "DESTLIB=${DESTLIB}" "DESTINC=${DESTINC}" \
666 "DESTHELP=${DESTHELP}" "PIC=${PIC}" "SHCC=${SHCC}" "SHLD=${SHLD}" \
667 "AR=${AR}" "RANLIB=${RANLIB}" "LDS=${LDS}" 'ARPREF=${ARPREF}' \
668 'ARSUFF=${ARSUFF}' $(MANARGS) PS="${PS}" "IOT=${IOT}" \
669 "CPPFLAGS=${CPPFLAGS}"
675 SUBDIRS = res $(SHRES) include compat named tools man
679 all clean depend:: FRC
680 @for x in $(SUBDIRS); do \
681 (cd $$x; pwd; $(MAKE) $(MARGS) $@); \
686 (cd $$x; pwd; $(MAKE) $(MARGS) all); \
690 -test -d doc/bog && (cd doc/bog; pwd; $(MAKE) $(MARGS) $@)
691 (cd conf; rm -f *~ *.CKP *.BAK *.orig)
692 rm -f *~ *.CKP *.BAK *.orig
697 -set +e; for x in $(DESTBIN) $(DESTSBIN) $(DESTEXEC) \
698 $(DESTMAN) $(DESTHELP) $(DESTLIB) $(DESTINC); do \
699 test -d $$x || mkdir -p $$x; \
703 @for x in $(SUBDIRS); do \
704 y=`if [ "X$$x" = "Xcompat" ]; \
705 then echo ${INSTALL_COMPAT}; \
708 (cd $$x; pwd; $(MAKE) $(MARGS) $$y); \
711 D = OPTIONS master bin doc named CHANGES README compat include res \
712 Makefile TODO conf man tools
715 bin/copyright <conf/copyright `find ${D} -type f ! -name '*,v' -print`
718 ( cd doc/bog; make file.psf file.lst )
719 find * '(' -name RCS -o -name obj -o -name .depend ')' \
721 gnutar -c -z -f ../bind-${VER}.tar.gz -X /tmp/bindXf .
727 @set -ex; mkdir $(DST); cd $(DST); \
729 cp SRC/Makefile .; chmod +w Makefile; \
730 ( mkdir include; cd include; ln -s ../SRC/include SRC; \
731 cp SRC/Makefile .; chmod +w Makefile; \
732 ln -s SRC/*.h SRC/arpa .; \
734 ( mkdir conf; cd conf; ln -s ../SRC/conf SRC; \
737 ( mkdir tools; cd tools; ln -s ../SRC/tools SRC; \
738 ln -s SRC/*.[ch] .; \
739 cp SRC/Makefile .; chmod +w Makefile; \
740 ( mkdir nslookup; cd nslookup; ln -s ../SRC/nslookup SRC; \
741 cp SRC/Makefile .; chmod +w Makefile; \
742 ln -s SRC/[a-z]* .; \
745 ( mkdir res; cd res; ln -s ../SRC/res SRC; \
746 cp SRC/Makefile .; chmod +w Makefile; \
747 ln -s SRC/*.[ch] .; \
749 ( mkdir compat; cd compat; ln -s ../SRC/compat SRC; \
750 cp SRC/Makefile .; chmod +w Makefile; \
751 ln -s SRC/include .; \
752 ( mkdir lib; cd lib; ln -s ../SRC/lib SRC; \
753 cp SRC/Makefile .; chmod +w Makefile; \
757 ( mkdir named; cd named; ln -s ../SRC/named SRC; \
758 cp SRC/Makefile .; chmod +w Makefile; \
759 ln -s SRC/*.[ch] SRC/*.sh .; \
761 ( mkdir shres; cd shres; ln -s ../SRC/shres SRC; \
762 ( mkdir sunos; cd sunos; ln -s ../../SRC/shres/sunos SRC; \
763 cp SRC/Makefile .; chmod +w Makefile; \
764 ln -s SRC/makeshlib SRC/*.patch* .; \
766 ( mkdir netbsd; cd netbsd; ln -s ../../SRC/shres/netbsd SRC; \
767 cp SRC/Makefile .; chmod +w Makefile; \
768 ln -s SRC/makeshlib SRC/lorder-sparc.sed SRC/shlibname.awk .; \
770 ( mkdir solaris; cd solaris; ln -s ../../SRC/shres/solaris SRC; \
771 cp SRC/Makefile .; chmod +w Makefile; \
774 ( mkdir man; cd man; ln -s ../SRC/man SRC; \
775 cp SRC/Makefile .; chmod +w Makefile; \
776 ln -s SRC/*.[0-9] .; \
780 @-make CC="gcc2 -Wall -Wno-comment -Wno-parentheses -Dlint" all \
781 2>&1 | grep '\.[ch]:[0-9]'