3 # Copyright (c) 2004-2005 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 = dhcpctl.cat3 omshell.cat1
26 SEDMANPAGES = dhcpctl.man3 omshell.man1
27 SRC = dhcpctl.c callback.c remote.c
28 OBJ = dhcpctl.o callback.o remote.o
29 MAN = dhcpctl.3 omshell.1
32 INCLUDES = $(BINDINC) -I$(TOP)/includes
33 CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
34 DHCPCTLLIBS = libdhcpctl.a ../common/libdhcp.a $(BINDLIB) \
35 ../omapip/libomapi.a ../dst/libdst.a
37 all: libdhcpctl.a omshell cltest $(CATMANPAGES)
39 omshell: omshell.o $(DHCPCTLLIBS)
40 $(CC) $(DEBUG) $(LFLAGS) -o omshell omshell.o $(DHCPCTLLIBS) $(LIBS)
42 cltest: cltest.o $(DHCPCTLLIBS)
43 $(CC) $(DEBUG) $(LFLAGS) -o cltest cltest.o $(DHCPCTLLIBS) $(LIBS)
47 ar cruv libdhcpctl.a $(OBJ)
48 $(RANLIB) libdhcpctl.a
50 install: all $(CATMANPAGES)
51 for dir in $(LIBDIR) $(LIBMANDIR) $(INCDIR) $(USRMANDIR) \
54 for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \
56 if [ ! -d $$foo ]; then \
62 $(INSTALL) libdhcpctl.a $(DESTDIR)$(LIBDIR)
63 $(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libdhcpctl.a
64 $(INSTALL) dhcpctl.h $(DESTDIR)$(INCDIR)
65 $(CHMOD) 644 $(DESTDIR)$(INCDIR)/dhcpctl.h
66 for man in $(MAN); do \
67 prefix=`echo $$man |sed -e 's/\.[0-9]$$//'`; \
68 suffix=`echo $$man |sed -e 's/.*\.\([0-9]\)$$/\1/'`; \
69 $(MANINSTALL) $(MANFROM) $${prefix}.$(MANCAT)$${suffix} $(MANTO) \
70 $(DESTDIR)$(LIBMANDIR)/$${prefix}$(LIBMANEXT); \
72 $(INSTALL) omshell $(DESTDIR)$(USERBINDIR)
73 $(CHMOD) 755 $(DESTDIR)$(USERBINDIR)/omshell
74 $(MANINSTALL) $(MANFROM) omshell.$(MANCAT)1 $(MANTO) \
75 $(DESTDIR)$(USRMANDIR)/omshell$(USRMANEXT)
78 $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRC)
81 -rm -f $(OBJ) omshell.o omshell cltest.o cltest
84 -rm -f libdhcpctl.a *~ $(CATMANPAGES) $(SEDMANPAGES)
90 @for foo in $(SRC) $(MAN) omshell.c cltest.c $(HDRS); do \
91 if [ ! -b $$foo ]; then \
94 ln -s $(TOP)/dhcpctl/$$foo $$foo; \
97 dhcpctl.cat3: dhcpctl.man3
98 nroff -man dhcpctl.man3 >dhcpctl.cat3
100 dhcpctl.man3: dhcpctl.3
101 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
102 -e "s#RUNDIR#$(VARRUN)#g" < dhcpctl.3 >dhcpctl.man3
104 omshell.cat1: omshell.man1
105 nroff -man omshell.man1 >omshell.cat1
107 omshell.man1: omshell.1
108 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
109 -e "s#RUNDIR#$(VARRUN)#g" < omshell.1 >omshell.man1
111 # Dependencies (semi-automatically-generated)