3 # Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (c) 1996-2003 by Internet Software Consortium
6 # Permission to use, copy, modify, and distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
10 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
16 # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 # Internet Systems Consortium, Inc.
20 # Redwood City, CA 94063
25 CATMANPAGES = dhcpd.cat8 dhcpd.conf.cat5 dhcpd.leases.cat5
26 SEDMANPAGES = dhcpd.man8 dhcpd.conf.man5 dhcpd.leases.man5
27 SRCS = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
28 omapi.c mdb.c stables.c salloc.c ddns.c
29 OBJS = dhcpd.o dhcp.o bootp.o confpars.o db.o class.o failover.o \
30 omapi.o mdb.o stables.o salloc.o ddns.o
32 MAN = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
34 INCLUDES = -I$(TOP) $(BINDINC) -I$(TOP)/includes
35 DHCPLIB = ../common/libdhcp.a $(BINDLIB) ../omapip/libomapi.a ../dst/libdst.a
36 CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
38 all: $(PROG) $(CATMANPAGES)
41 for dir in $(BINDIR) $(ADMMANDIR) $(FFMANDIR) $(VARDB); do \
43 for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \
45 if [ ! -d $$foo ]; then \
51 $(INSTALL) dhcpd $(DESTDIR)$(BINDIR)
52 $(CHMOD) 755 $(DESTDIR)$(BINDIR)/dhcpd
53 $(MANINSTALL) $(MANFROM) dhcpd.$(MANCAT)8 $(MANTO) \
54 $(DESTDIR)$(ADMMANDIR)/dhcpd$(ADMMANEXT)
55 $(MANINSTALL) $(MANFROM) dhcpd.conf.$(MANCAT)5 $(MANTO) \
56 $(DESTDIR)$(FFMANDIR)/dhcpd.conf$(FFMANEXT)
57 $(MANINSTALL) $(MANFROM) dhcpd.leases.$(MANCAT)5 $(MANTO) \
58 $(DESTDIR)$(FFMANDIR)/dhcpd.leases$(FFMANEXT)
61 $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRCS)
67 -rm -f $(PROG) $(CATMANPAGES) $(SEDMANPAGES) *~ #*
73 @for foo in $(SRCS) $(MAN); do \
74 if [ ! -b $$foo ]; then \
77 ln -s $(TOP)/server/$$foo $$foo; \
80 # These should only be done on 4.4 BSD-based systems, since the mandoc
81 # macros aren't available on older unices. Catted man pages are
82 # provided in the distribution so that this doesn't become a problem.
84 dhcpd.cat8: dhcpd.man8
85 nroff -man dhcpd.man8 >dhcpd.cat8
88 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
89 -e "s#RUNDIR#$(VARRUN)#g" < dhcpd.8 >dhcpd.man8
91 dhcpd.conf.cat5: dhcpd.conf.man5
92 nroff -man dhcpd.conf.man5 >dhcpd.conf.cat5
94 dhcpd.conf.man5: dhcpd.conf.5
95 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
96 -e "s#RUNDIR#$(VARRUN)#g" < dhcpd.conf.5 >dhcpd.conf.man5
98 dhcpd.leases.cat5: dhcpd.leases.man5
99 nroff -man dhcpd.leases.man5 >dhcpd.leases.cat5
101 dhcpd.leases.man5: dhcpd.leases.5
102 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
103 -e "s#RUNDIR#$(VARRUN)#g" < dhcpd.leases.5 >dhcpd.leases.man5
105 dhcpd: $(OBJS) $(COBJ) $(DHCPLIB)
106 $(CC) $(LFLAGS) -o dhcpd $(OBJS) $(DHCPLIB) $(LIBS)
108 # Dependencies (semi-automatically-generated)