Initial import from FreeBSD RELENG_4:
[games.git] / contrib / isc-dhcp / omapip / Makefile.dist
1 # Makefile.dist
2 #
3 # Copyright (c) 1996-2001 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 = omapi.cat3
21 SEDMANPAGES = omapi.man3
22 SRC    = protocol.c buffer.c alloc.c result.c connection.c errwarn.c \
23          listener.c dispatch.c generic.c support.c handle.c message.c \
24          convert.c hash.c auth.c inet_addr.c array.c trace.c mrtrace.c \
25          toisc.c
26
27 OBJ    = protocol.o buffer.o alloc.o result.o connection.o errwarn.o \
28          listener.o dispatch.o generic.o support.o handle.o message.o \
29          convert.o hash.o auth.o inet_addr.o array.o trace.o mrtrace.o \
30          toisc.o
31
32 MAN    = omapi.3
33
34 INCLUDES = $(BINDINC) -I$(TOP)/includes
35 CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
36
37 all:    libomapi.a svtest $(CATMANPAGES)
38
39 svtest: test.o libomapi.a $(BINDLIB) ../dst/libdst.a
40         $(CC) $(DEBUG) $(LFLAGS) -o svtest test.o $(BINDLIB) \
41                         libomapi.a ../dst/libdst.a $(LIBS)
42
43 libomapi.a:     $(OBJ)
44         rm -f libomapi.a
45         ar cruv libomapi.a $(OBJ)
46         $(RANLIB) libomapi.a
47
48 install: all
49         for dir in $(LIBDIR) $(LIBMANDIR) $(INCDIR)/omapip $(INCDIR)/isc-dhcp;\
50          do \
51           foo=""; \
52           for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \
53             foo=$${foo}/$$bar; \
54             if [ ! -d $$foo ]; then \
55               mkdir $$foo; \
56               chmod 755 $$foo; \
57             fi; \
58           done; \
59         done
60         $(INSTALL) libomapi.a $(DESTDIR)$(LIBDIR)
61         $(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libomapi.a
62         for file in alloc.h buffer.h omapip.h; do \
63           $(INSTALL) $(TOP)/includes/omapip/$$file \
64                                                 $(DESTDIR)$(INCDIR)/omapip; \
65           $(CHMOD) 644 $(DESTDIR)$(INCDIR)/omapip/$$file; \
66         done
67         for file in boolean.h dst.h int.h lang.h list.h result.h types.h; do \
68           $(INSTALL) $(TOP)/includes/isc-dhcp/$$file \
69                                                 $(DESTDIR)$(INCDIR)/isc-dhcp; \
70           $(CHMOD) 644 $(DESTDIR)$(INCDIR)/isc-dhcp/$$file; \
71         done
72         for man in $(MAN); do \
73           prefix=`echo $$man |sed -e 's/\.[0-9]$$//'`; \
74           suffix=`echo $$man |sed -e 's/.*\.\([0-9]\)$$/\1/'`; \
75           $(MANINSTALL) $(MANFROM) $${prefix}.$(MANCAT)$${suffix} $(MANTO) \
76                         $(DESTDIR)$(LIBMANDIR)/$${prefix}$(LIBMANEXT); \
77         done
78
79 depend:
80         $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRC)
81
82 clean:
83         -rm -f $(OBJ) test.o svtest
84
85 realclean: clean
86         -rm -f libomapi.a *~ $(CATMANPAGES) $(SEDMANPAGES)
87
88 distclean: realclean
89         -rm -f Makefile
90
91 links:
92         @for foo in $(SRC) $(MAN) test.c; do \
93           if [ ! -b $$foo ]; then \
94             rm -f $$foo; \
95           fi; \
96           ln -s $(TOP)/omapip/$$foo $$foo; \
97         done
98
99 omapi.cat3:     omapi.man3
100         nroff -man omapi.man3 >omapi.cat3
101
102 omapi.man3:     omapi.3
103         sed -e "s#ETCDIR#$(ETC)#g" -e "s#DBDIR#$(VARDB)#g" \
104                 -e "s#RUNDIR#$(VARRUN)#g" < omapi.3 >omapi.man3
105
106 # Dependencies (semi-automatically-generated)