dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / cmd-inet / usr.sbin / Makefile
blob5e56bd74a18abbb0c0aefc13682de7c65d640f9a
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>
27 SYNCPROG= syncinit syncloop syncstat
29 PROG= 6to4relay arp if_mpadm \
30 in.comsat in.fingerd in.rarpd \
31 in.rwhod in.telnetd in.tftpd ipaddrsel \
32 ndp $(SYNCPROG)
34 MANIFEST= rarp.xml telnet.xml comsat.xml finger.xml
35 SVCMETHOD= svc-sockfilter
37 ROOTFS_PROG= hostconfig route soconfig
38 SBINLINKS= hostconfig route
40 RPCSVCPROG= hostconfig
41 AUDITPROG= in.telnetd
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-implicit-function-declaration
78 CERRWARN += -Wno-uninitialized
79 CERRWARN += -Wno-unused-variable
80 CERRWARN += -Wno-unused-function
81 CERRWARN += -Wno-parentheses
82 CERRWARN += -Wno-char-subscripts
83 CERRWARN += -Wno-extra
84 CERRWARN += -Wno-address
87 # Message catalog
89 POFILES= 6to4relay.po if_mpadm.po in.comsat.po ipaddrsel.po route.po \
90 soconfig.po
91 POFILE= usr.sbin.po
93 all:= TARGET= all
94 install:= TARGET= install
95 clean:= TARGET= clean
96 clobber:= TARGET= clobber
97 _msg:= TARGET= _msg
99 CLOBBERFILES += $(ROOTFS_PROG) $(PROG)
100 CLEANFILES += $(TFTPDOBJS) $(K5TELNETOBJS)
102 CPPFLAGS += -DSYSV -DBSD_COMP -I$(CMDINETCOMMONDIR) -I
104 include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
105 K5LIBS=
107 $(SYNCPROG) := LDLIBS += -ldlpi
108 $(AUDITPROG) := LDLIBS += -lbsm
109 $(PAMPROG) := LDLIBS += -lpam
110 $(RPCSVCPROG) := LDLIBS += -lrpcsvc
111 $(K5PROGS) := LDFLAGS += $(KRUNPATH) \
112 -L$(ROOT)$(KLIBDIR_DO) -L$(ROOT)$(KLIBDIR_GL)
113 $(K5PROGS) := K5LIBS= -lmech_krb5
114 $(K5PROGS) := CPPFLAGS += -I$(SRCTOP)/include \
115 -I$(SRC)/uts/common/ \
116 -I$(SRC)/uts/common/gssapi/mechs/krb5/include \
117 -I$(SRC)/lib/gss_mechs/mech_krb5/include \
118 -I$(SRC)/lib/pam_modules/krb5
119 LDLIBS += $(K5LIBS)
120 $(DLADMPROG) := LDLIBS += -ldladm
122 in.rarpd := LDLIBS += -linetutil -ldlpi
123 if_mpadm := LDLIBS += -linetutil -lipmp
124 if_mpadm.po := XGETFLAGS += -a
125 route := CPPFLAGS += -DNDEBUG
126 in.comsat := LDFLAGS += $(MAPFILE.NGB:%=-Wl,-M%)
128 .KEEP_STATE:
130 .PARALLEL:
132 all: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) THIRDPARTYLICENSE.arp
135 # message catalog
137 _msg: $(MSGSUBDIRS) $(POFILE)
139 syncutil: $(SYNCPROG)
141 $(POFILE): $(POFILES)
142 $(RM) $@
143 cat $(POFILES) > $@
145 %.o: $(CMDINETCOMMONDIR)/%.c
146 $(COMPILE.c) -o $@ $<
148 in.telnetd: $(K5TELNETOBJS)
149 $(LINK.c) $(K5TELNETOBJS) -o $@ $(LDLIBS)
150 $(POST_PROCESS)
152 in.tftpd: $(TFTPDOBJS)
153 $(LINK.c) $(TFTPDOBJS) -o $@ $(LDLIBS)
154 $(POST_PROCESS)
156 tftpsubs.o: $(OTHERSRC)
157 $(COMPILE.c) $(OTHERSRC) -o $@
158 $(POST_PROCESS_O)
160 $(ROOTUSRSBINLINKS):
161 -$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
163 install: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) .WAIT $(ROOTUSRSBINPROG) \
164 $(ROOTSBINPROG) $(ROOTUSRSBINLINKS) $(ROOTETCDEFAULTFILES) \
165 $(ROOTMANIFEST) $(ROOTSVCMETHOD) THIRDPARTYLICENSE.arp
167 THIRDPARTYLICENSE.arp: arp.c
168 $(SED) -n '/University of California/,/SUCH DAMAGE/p' arp.c > $@
170 CLOBBERFILES += THIRDPARTYLICENSE.arp
173 # The reason this rule checks for the existence of the
174 # Makefile is that some of the directories do not exist
175 # in our exportable source builds.
177 $(SUBDIRS): FRC
178 @if [ -f $@/Makefile ]; then \
179 cd $@; pwd; $(MAKE) $(TARGET); \
180 else \
181 true; \
184 FRC:
186 check: $(CHKMANIFEST)
188 clean: $(SUBDIRS) clean_local
189 clean_local:
190 $(RM) $(CLEANFILES)
192 clobber: $(SUBDIRS) clobber_local
193 clobber_local: clean_local
194 $(RM) $(CLOBBERFILES)