]> git.ipfire.org Git - thirdparty/dhcp.git/blob - dhcpctl/Makefile.dist
Merge changes between 3.0rc7 and 3.0rc8pl2.
[thirdparty/dhcp.git] / dhcpctl / Makefile.dist
1 # Makefile.dist
2 #
3 # Copyright (c) 1996-1999 Internet Software Consortium.
4 # Use is subject to license terms which appear in the file named
5 # ISC-LICENSE that should have accompanied this file when you
6 # received it. If a file named ISC-LICENSE did not accompany this
7 # file, or you are not sure the one you have is correct, you may
8 # obtain an applicable copy of the license at:
9 #
10 # http://www.isc.org/isc-license-1.0.html.
11 #
12 # This file is part of the ISC DHCP distribution. The documentation
13 # associated with this file is listed in the file DOCUMENTATION,
14 # included in the top-level directory of this release.
15 #
16 # Support and other services are available for ISC products - see
17 # http://www.isc.org for more information.
18 #
19
20 CATMANPAGES = dhcpctl.cat3 omshell.cat1
21 SEDMANPAGES = dhcpctl.man3 omshell.man1
22 SRC = dhcpctl.c callback.c remote.c
23 OBJ = dhcpctl.o callback.o remote.o
24 MAN = dhcpctl.3 omshell.1
25 HDRS = dhcpctl.h
26
27 INCLUDES = $(BINDINC) -I$(TOP)/includes
28 CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
29 DHCPCTLLIBS = libdhcpctl.a ../common/libdhcp.a $(BINDLIB) \
30 ../omapip/libomapi.a ../dst/libdst.a
31
32 all: libdhcpctl.a omshell cltest $(CATMANPAGES)
33
34 omshell: omshell.o $(DHCPCTLLIBS)
35 $(CC) $(DEBUG) $(LFLAGS) -o omshell omshell.o $(DHCPCTLLIBS) $(LIBS)
36
37 cltest: cltest.o $(DHCPCTLLIBS)
38 $(CC) $(DEBUG) $(LFLAGS) -o cltest cltest.o $(DHCPCTLLIBS) $(LIBS)
39
40 libdhcpctl.a: $(OBJ)
41 rm -f libdhcpctl.a
42 ar cruv libdhcpctl.a $(OBJ)
43 $(RANLIB) libdhcpctl.a
44
45 install: all $(CATMANPAGES)
46 for dir in $(LIBDIR) $(LIBMANDIR) $(INCDIR) $(USRMANDIR) \
47 $(USERBINDIR); do \
48 foo=""; \
49 for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \
50 foo=$${foo}/$$bar; \
51 if [ ! -d $$foo ]; then \
52 mkdir $$foo; \
53 chmod 755 $$foo; \
54 fi; \
55 done; \
56 done
57 $(INSTALL) libdhcpctl.a $(DESTDIR)$(LIBDIR)
58 $(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libdhcpctl.a
59 $(INSTALL) dhcpctl.h $(DESTDIR)$(INCDIR)
60 $(CHMOD) 644 $(DESTDIR)$(INCDIR)/dhcpctl.h
61 for man in $(MAN); do \
62 prefix=`echo $$man |sed -e 's/\.[0-9]$$//'`; \
63 suffix=`echo $$man |sed -e 's/.*\.\([0-9]\)$$/\1/'`; \
64 $(MANINSTALL) $(MANFROM) $${prefix}.$(MANCAT)$${suffix} $(MANTO) \
65 $(DESTDIR)$(LIBMANDIR)/$${prefix}$(LIBMANEXT); \
66 done
67 $(INSTALL) omshell $(DESTDIR)$(USERBINDIR)
68 $(CHMOD) 755 $(DESTDIR)$(USERBINDIR)/omshell
69 $(MANINSTALL) $(MANFROM) omshell.$(MANCAT)1 $(MANTO) \
70 $(DESTDIR)$(USRMANDIR)/omshell$(USRMANEXT)
71
72 depend:
73 $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRC)
74
75 clean:
76 -rm -f $(OBJ) test.o svtest cltest.o cltest
77
78 realclean: clean
79 -rm -f libdhcpctl.a *~ $(CATMANPAGES) $(SEDMANPAGES)
80
81 distclean: realclean
82 -rm -f Makefile
83
84 links:
85 @for foo in $(SRC) $(MAN) omshell.c cltest.c $(HDRS); do \
86 if [ ! -b $$foo ]; then \
87 rm -f $$foo; \
88 fi; \
89 ln -s $(TOP)/dhcpctl/$$foo $$foo; \
90 done
91
92 dhcpctl.cat3: dhcpctl.man3
93 nroff -man dhcpctl.man3 >dhcpctl.cat3
94
95 dhcpctl.man3: dhcpctl.3
96 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
97 -e "s#RUNDIR#$(VARRUN)#g" < dhcpctl.3 >dhcpctl.man3
98
99 omshell.cat1: omshell.man1
100 nroff -man omshell.man1 >omshell.cat1
101
102 omshell.man1: omshell.1
103 sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
104 -e "s#RUNDIR#$(VARRUN)#g" < omshell.1 >omshell.man1
105
106 # Dependencies (semi-automatically-generated)