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
24 CATMANPAGES = dhclient.cat8 dhclient.conf.cat5 dhclient-script.cat8 \
26 SEDMANPAGES = dhclient.man8 dhclient.conf.man5 dhclient-script.man8 \
28 SRCS = dhclient.c clparse.c
29 OBJS = dhclient.o clparse.o
31 MAN = dhclient.8 dhclient.conf.5 dhclient-script.8 dhclient.leases.5
33 INCLUDES = -I$(TOP) $(BINDINC) -I$(TOP)/includes
34 DHCPLIB = ../common/libdhcp.a $(BINDLIB) ../omapip/libomapi.a ../dst/libdst.a
35 CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS) \
36 -DCLIENT_PATH=${CLIENT_PATH}
38 all: $(PROG) $(CATMANPAGES)
41 for dir in $(CLIENTBINDIR) $(ETC) $(FFMANDIR) $(ADMMANDIR) $(VARDB); \
44 for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \
46 if [ ! -d $$foo ]; then \
52 $(INSTALL) dhclient $(DESTDIR)$(CLIENTBINDIR)
53 $(CHMOD) 755 $(DESTDIR)$(CLIENTBINDIR)/dhclient
54 if [ x$(SCRIPT) = xnone ]; then \
55 echo "No client script available."; \
57 $(INSTALL) $(TOP)/client/scripts/$(SCRIPT)\
58 $(DESTDIR)$(CLIENTBINDIR)/dhclient-script; \
59 $(CHMOD) 700 $(DESTDIR)$(CLIENTBINDIR)/dhclient-script; \
61 $(MANINSTALL) $(MANFROM) dhclient.$(MANCAT)8 $(MANTO) \
62 $(DESTDIR)$(ADMMANDIR)/dhclient$(ADMMANEXT)
63 $(MANINSTALL) $(MANFROM) dhclient-script.$(MANCAT)8 $(MANTO) \
64 $(DESTDIR)$(ADMMANDIR)/dhclient-script$(ADMMANEXT)
65 $(MANINSTALL) $(MANFROM) dhclient.conf.$(MANCAT)5 $(MANTO) \
66 $(DESTDIR)$(FFMANDIR)/dhclient.conf$(FFMANEXT)
67 $(MANINSTALL) $(MANFROM) dhclient.leases.$(MANCAT)5 $(MANTO) \
68 $(DESTDIR)$(FFMANDIR)/dhclient.leases$(FFMANEXT)
71 $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRCS)
77 -rm -f $(PROG) $(CATMANPAGES) $(SEDMANPAGES) *~ #*
83 @for foo in $(SRCS) $(MAN); do \
84 if [ ! -b $$foo ]; then \
87 ln -s $(TOP)/client/$$foo $$foo; \
90 # These should only be done on 4.4 BSD-based systems, since the mandoc
91 # macros aren't available on older unices. Catted man pages are
92 # provided in the distribution so that this doesn't become a problem.
94 dhclient.cat8: dhclient.man8
95 nroff -man dhclient.man8 >dhclient.cat8
97 dhclient.man8: dhclient.8
98 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
99 -e "s#CLIENTBINDIR#$(CLIENTBINDIR)#g" \
100 -e "s#RUNDIR#$(VARRUN)#g" < dhclient.8 >dhclient.man8
102 dhclient-script.cat8: dhclient-script.man8
103 nroff -man dhclient-script.man8 >dhclient-script.cat8
105 dhclient-script.man8: dhclient-script.8
106 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
107 -e "s#CLIENTBINDIR#$(CLIENTBINDIR)#g" \
108 -e "s#RUNDIR#$(VARRUN)#g" < dhclient-script.8 \
109 >dhclient-script.man8
111 dhclient.conf.man5: dhclient.conf.5
112 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
113 -e "s#CLIENTBINDIR#$(CLIENTBINDIR)#g" \
114 -e "s#RUNDIR#$(VARRUN)#g" < dhclient.conf.5 \
117 dhclient.conf.cat5: dhclient.conf.man5
118 nroff -man dhclient.conf.man5 >dhclient.conf.cat5
120 dhclient.leases.man5: dhclient.leases.5
121 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
122 -e "s#CLIENTBINDIR#$(CLIENTBINDIR)#g" \
123 -e "s#RUNDIR#$(VARRUN)#g" < dhclient.leases.5 \
124 >dhclient.leases.man5
126 dhclient.leases.cat5: dhclient.leases.man5
127 nroff -man dhclient.leases.man5 >dhclient.leases.cat5
130 dhclient: $(OBJS) $(DHCPLIB)
131 $(CC) $(LFLAGS) -o $(PROG) $(OBJS) $(DHCPLIB) $(LIBS)
133 # Dependencies (semi-automatically-generated)