move 32-bit libs to lib/i386 subdirs & 64-bit libs to lib/
[unleashed.git] / usr / src / cmd / cmd-inet / usr.sbin / Makefile
bloba69af6bfe59295f9fffbc6311e7eab98f1cd8d29
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
23 # Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
25 # Copyright (c) 2018, Joyent, Inc.
28 SYNCPROG= syncinit syncloop syncstat
30 PROG= 6to4relay arp if_mpadm \
31 in.comsat in.fingerd in.rarpd \
32 in.rwhod in.telnetd in.tftpd ipaddrsel \
33 ndp $(SYNCPROG)
35 MANIFEST= rarp.xml telnet.xml comsat.xml finger.xml
36 SVCMETHOD= svc-sockfilter
38 ROOTFS_PROG= hostconfig route soconfig
39 SBINLINKS= hostconfig route
41 RPCSVCPROG= hostconfig
42 PAMPROG= in.telnetd
43 SOCKETPROG= 6to4relay arp hostconfig if_mpadm in.comsat \
44 in.fingerd in.rarpd \
45 in.rwhod in.telnetd in.tftpd ipaddrsel ndp route
46 NSLPROG= 6to4relay arp hostconfig in.comsat in.rarpd \
47 in.rwhod in.telnetd \
48 in.tftpd ipaddrsel ndp route
49 CMDPROG= in.telnetd
50 K5PROGS= in.telnetd
51 DLADMPROG= 6to4relay
52 DEFAULTFILES= telnetd.dfl
54 PROGSRCS= $(PROG:%=%.c)
55 TFTPDOBJS= in.tftpd.o tftpsubs.o
56 OTHERSRC= ../usr.bin/tftp/tftpsubs.c
57 K5TELNETOBJS= in.telnetd.o
58 SRCS= $(PROGSRCS) $(OTHERSRC)
60 SUBDIRS= ifconfig ilbadm in.rdisc in.routed \
61 in.talkd inetadm inetconv ipadm ipmpstat ipqosconf ipsecutils \
62 nwamadm nwamcfg ping \
63 snoop sppptun traceroute wificonfig
65 MSGSUBDIRS= ifconfig ilbadm in.routed in.talkd \
66 inetadm inetconv ipadm ipmpstat ipqosconf ipsecutils \
67 nwamadm nwamcfg sppptun snoop wificonfig
69 include ../../Makefile.cmd
70 ROOTMANIFESTDIR= $(ROOTSVCNETWORK)
71 $(ROOTMANIFEST) := FILEMODE= 444
72 include ../Makefile.cmd-inet
74 ROOTSBINPROG = $(ROOTFS_PROG:%=$(ROOTSBIN)/%)
75 ROOTUSRSBINLINKS = $(SBINLINKS:%=$(ROOTUSRSBIN)/%)
77 CERRWARN += -Wno-uninitialized
78 CERRWARN += -Wno-unused-variable
79 CERRWARN += -Wno-unused-function
80 CERRWARN += -Wno-parentheses
81 CERRWARN += -Wno-char-subscripts
82 CERRWARN += -Wno-extra
83 CERRWARN += -Wno-address
85 # "missing type for func"
86 SMATCH=off
89 # Message catalog
91 POFILES= 6to4relay.po if_mpadm.po in.comsat.po ipaddrsel.po route.po \
92 soconfig.po
93 POFILE= usr.sbin.po
95 all:= TARGET= all
96 install:= TARGET= install
97 clean:= TARGET= clean
98 clobber:= TARGET= clobber
99 _msg:= TARGET= _msg
101 CLOBBERFILES += $(ROOTFS_PROG) $(PROG)
102 CLEANFILES += $(TFTPDOBJS) $(K5TELNETOBJS)
104 CPPFLAGS += -DSYSV -DBSD_COMP -I$(CMDINETCOMMONDIR) -I
106 include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
107 K5LIBS=
109 $(SYNCPROG) := LDLIBS += -ldlpi
110 $(PAMPROG) := LDLIBS += -lpam
111 $(RPCSVCPROG) := LDLIBS += -lrpcsvc
112 $(K5PROGS) := LDFLAGS += $(KRUNPATH) \
113 -L$(ROOT)$(KLIBDIR)
114 $(K5PROGS) := K5LIBS= -lmech_krb5
115 $(K5PROGS) := CPPFLAGS += -I$(SRCTOP)/include \
116 -I$(SRC)/uts/common/ \
117 -I$(SRC)/uts/common/gssapi/mechs/krb5/include \
118 -I$(SRC)/lib/gss_mechs/mech_krb5/include \
119 -I$(SRC)/lib/pam_modules/krb5
120 LDLIBS += $(K5LIBS)
121 $(DLADMPROG) := LDLIBS += -ldladm
123 in.rarpd := LDLIBS += -linetutil -ldlpi
124 if_mpadm := LDLIBS += -linetutil -lipmp
125 if_mpadm.po := XGETFLAGS += -a
126 route := CPPFLAGS += -DNDEBUG
127 in.comsat := LDFLAGS += $(MAPFILE.NGB:%=-Wl,-M%)
129 .KEEP_STATE:
131 .PARALLEL:
133 all: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) THIRDPARTYLICENSE.arp
136 # message catalog
138 _msg: $(MSGSUBDIRS) $(POFILE)
140 syncutil: $(SYNCPROG)
142 $(POFILE): $(POFILES)
143 $(RM) $@
144 cat $(POFILES) > $@
146 %.o: $(CMDINETCOMMONDIR)/%.c
147 $(COMPILE.c) -o $@ $<
149 in.telnetd: $(K5TELNETOBJS)
150 $(LINK.c) $(K5TELNETOBJS) -o $@ $(LDLIBS)
151 $(POST_PROCESS)
153 in.tftpd: $(TFTPDOBJS)
154 $(LINK.c) $(TFTPDOBJS) -o $@ $(LDLIBS)
155 $(POST_PROCESS)
157 tftpsubs.o: $(OTHERSRC)
158 $(COMPILE.c) $(OTHERSRC) -o $@
159 $(POST_PROCESS_O)
161 $(ROOTUSRSBINLINKS):
162 -$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
164 install: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) .WAIT $(ROOTUSRSBINPROG) \
165 $(ROOTSBINPROG) $(ROOTUSRSBINLINKS) $(ROOTETCDEFAULTFILES) \
166 $(ROOTMANIFEST) $(ROOTSVCMETHOD) THIRDPARTYLICENSE.arp
168 THIRDPARTYLICENSE.arp: arp.c
169 $(SED) -n '/University of California/,/SUCH DAMAGE/p' arp.c > $@
171 CLOBBERFILES += THIRDPARTYLICENSE.arp
174 # The reason this rule checks for the existence of the
175 # Makefile is that some of the directories do not exist
176 # in our exportable source builds.
178 $(SUBDIRS): FRC
179 @if [ -f $@/Makefile ]; then \
180 cd $@; pwd; $(MAKE) $(TARGET); \
181 else \
182 true; \
185 FRC:
187 check: $(CHKMANIFEST)
189 clean: $(SUBDIRS) clean_local
190 clean_local:
191 $(RM) $(CLEANFILES)
193 clobber: $(SUBDIRS) clobber_local
194 clobber_local: clean_local
195 $(RM) $(CLOBBERFILES)