1# 2# CDDL HEADER START 3# 4# The contents of this file are subject to the terms of the 5# Common Development and Distribution License, Version 1.0 only 6# (the "License"). You may not use this file except in compliance 7# with the License. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or http://www.opensolaris.org/os/licensing. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22# 23# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27# 28 29SYNCPROG= syncinit syncloop syncstat 30DHCPPROG= dhcpconfig dhtadm pntadm 31 32# EXPORT DELETE START 33XMODPROG= wanbootutil 34# EXPORT DELETE END 35 36PROG= 6to4relay arp gettable if_mpadm ikeadm ikecert \ 37 in.comsat in.fingerd in.rarpd in.rdisc in.rexecd in.rlogind \ 38 in.rshd in.rwhod in.telnetd in.tftpd in.tnamed ipaddrsel \ 39 ipsecalgs ipsecconf ipseckey ndd $(SYNCPROG) $(DHCPPROG) \ 40 $(XMODPROG) 41 42MANIFEST= rarp.xml telnet.xml comsat.xml finger.xml \ 43 login.xml shell.xml rexec.xml tname.xml 44 45ROOTFS_PROG= hostconfig route routeadm soconfig 46SBINLINKS= hostconfig route routeadm 47 48RPCSVCPROG= hostconfig 49AUDITPROG= in.rexecd in.rlogind in.rshd in.telnetd 50PAMPROG= in.rexecd in.rlogind in.rshd in.telnetd 51SOCKETPROG= 6to4relay arp gettable hostconfig if_mpadm in.comsat \ 52 in.fingerd in.rarpd in.rdisc in.rexecd in.rlogind in.rshd \ 53 in.rwhod in.telnetd in.tftpd in.tnamed ipaddrsel \ 54 ipsecalgs ipsecconf ipseckey route routeadm 55NSLPROG= 6to4relay arp gettable hostconfig ikeadm in.comsat in.rarpd \ 56 in.rdisc in.rexecd in.rlogind in.rshd in.rwhod in.telnetd \ 57 in.tftpd in.tnamed ipaddrsel ipsecalgs ipsecconf ipseckey route 58CMDPROG= in.telnetd 59IPSECUTILPROG= ikeadm ipsecalgs ipsecconf ipseckey 60K5PROGS= in.telnetd in.rlogind in.rshd 61DEFAULTFILES= telnetd 62 63PROGSRCS= $(PROG:%=%.c) 64TFTPDOBJS= in.tftpd.o tftpsubs.o 65OTHERSRC= ../usr.bin/tftp/tftpsubs.c 66K5RLOGINOBJS= in.rlogind.o 67K5RSHDOBJS= in.rshd.o 68SRCS= $(PROGSRCS) $(OTHERSRC) 69 70SUBDIRS= bootconfchk htable ifconfig in.ftpd in.routed \ 71 in.talkd inetadm inetconv ipqosconf mipagentconfig \ 72 mipagentstat ping snoop sppptun traceroute 73 74MSGSUBDIRS= bootconfchk htable ifconfig in.ftpd in.routed in.talkd \ 75 inetadm inetconv ipqosconf mipagentconfig mipagentstat \ 76 sppptun snoop 77 78# As programs get lint-clean, add them here and to the 'lint' target. 79# Eventually this hack should go away, and all in PROG should be 80# lint-clean. 81LINTCLEAN= 6to4relay arp ikeadm in.rlogind in.rshd in.telnetd in.tftpd \ 82 ipaddrsel ipsecalgs ipseckey ipsecconf route routeadm \ 83 in.rarpd $(SYNCPROG) 84# Likewise, as subdirs get lint-clean, add them here. Once 85# they're all clean, replace the dependency of the lint target 86# with SUBDIRS. Also (sigh) deal with the commented-out build lines 87# for the lint rule. 88LINTSUBDIRS= bootconfchk in.routed in.talkd inetadm inetconv ipqosconf \ 89 mipagentstat ping sppptun traceroute 90# And as programs are verified not to attempt to write into constants, 91# -xstrconst should be used to ensure they stay that way. 92CONSTCLEAN= ikeadm 93 94include ../../Makefile.cmd 95ROOTMANIFESTDIR= $(ROOTSVCNETWORK) 96$(ROOTMANIFEST) := FILEMODE= 444 97include ../Makefile.cmd-inet 98 99ROOTSBINPROG = $(ROOTFS_PROG:%=$(ROOTSBIN)/%) 100ROOTUSRSBINLINKS = $(SBINLINKS:%=$(ROOTUSRSBIN)/%) 101 102COMMONOBJS= kcmd.o 103COMMONSRCS= $(CMDINETCOMMONDIR)/$(COMMONOBJS:.o=.c) 104SRCS+= $(COMMONSRCS) 105 106# 107# Message catalog 108# 109POFILES= 6to4relay.po if_mpadm.po ikeadm.po in.comsat.po ipaddrsel.po \ 110 ipsecalgs.po ipsecconf.po ipseckey.po route.po routeadm.po 111POFILE= usr.sbin.po 112 113all:= TARGET= all 114install:= TARGET= install 115clean:= TARGET= clean 116clobber:= TARGET= clobber 117lint:= TARGET= lint 118_msg:= TARGET= _msg 119 120CLOBBERFILES += $(ROOTFS_PROG) $(PROG) 121CLEANFILES += $(COMMONOBJS) $(K5RLOGINOBJS) $(K5RSHDOBJS) $(TFTPDOBJS) 122 123CPPFLAGS += -DSYSV -DBSD_COMP -I$(CMDINETCOMMONDIR) -I. 124 125include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5 126K5LIBS= 127 128# Eventually just plain CFLAGS should be += -v, but not until all in 129# PROGS are lint clean. 130$(LINTCLEAN) := CFLAGS += $(CCVERBOSE) 131$(CONSTCLEAN) := CFLAGS += $(XSTRCONST) 132 133$(SYNCPROG) := LDLIBS += -ldlpi 134$(SOCKETPROG) := LDLIBS += -lsocket 135$(NSLPROG) := LDLIBS += -lnsl 136$(AUDITPROG) := LDLIBS += -lbsm 137$(PAMPROG) := LDLIBS += -lpam 138$(RPCSVCPROG) := LDLIBS += -lrpcsvc 139$(CMDPROG) := LDLIBS += -lcmd 140$(K5PROGS) := LDFLAGS += $(ZLAZYLOAD) $(KRUNPATH) \ 141 -L$(ROOT)$(KLIBDIR_DO) -L$(ROOT)$(KLIBDIR_GL) 142$(K5PROGS) := K5LIBS= -lmech_krb5 143$(K5PROGS) := CPPFLAGS += -I$(SRC)/head \ 144 -I$(SRC)/uts/common/ \ 145 -I$(SRC)/uts/common/gssapi/mechs/krb5/include \ 146 -I$(SRC)/lib/gss_mechs/mech_krb5/include \ 147 -I$(SRC)/lib/pam_modules/krb5 148LDLIBS += $(K5LIBS) 149$(IPSECUTILPROG) := LDLIBS += -lipsecutil 150 151in.rarpd := LDLIBS += -linetutil 152route := CPPFLAGS += -DNDEBUG 153 154.KEEP_STATE: 155 156.PARALLEL: 157 158all: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) 159 160# 161# message catalog 162# 163_msg: $(MSGSUBDIRS) $(POFILE) 164 165syncutil: $(SYNCPROG) 166 167$(POFILE): $(POFILES) 168 $(RM) $@ 169 cat $(POFILES) > $@ 170 171$(COMMONOBJS): $(COMMONSRCS) 172 $(COMPILE.c) $(COMMONSRCS) 173 174in.rlogind: $(K5RLOGINOBJS) $(COMMONOBJS) 175 $(LINK.c) $(K5RLOGINOBJS) $(COMMONOBJS) -o $@ $(LDLIBS) 176 $(POST_PROCESS) 177 178in.rshd: $(K5RSHDOBJS) $(COMMONOBJS) 179 $(LINK.c) $(K5RSHDOBJS) $(COMMONOBJS) -o $@ $(LDLIBS) 180 $(POST_PROCESS) 181 182in.tftpd: $(TFTPDOBJS) 183 $(LINK.c) $(TFTPDOBJS) -o $@ $(LDLIBS) 184 $(POST_PROCESS) 185 186tftpsubs.o: $(OTHERSRC) 187 $(COMPILE.c) $(OTHERSRC) -o $@ 188 $(POST_PROCESS_O) 189 190$(ROOTUSRSBINLINKS): 191 -$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@ 192 193$(ROOTETCDEFAULT)/%: %.dfl 194 $(INS.rename) 195 196install: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) .WAIT $(ROOTUSRSBINPROG) \ 197 $(ROOTSBINPROG) $(ROOTUSRSBINLINKS) $(ROOTETCDEFAULTFILES) \ 198 $(ROOTMANIFEST) 199 200# 201# The reason this rule checks for the existence of the 202# Makefile is that some of the directories do not exist 203# in our exportable source builds. 204# 205$(SUBDIRS): FRC 206 @if [ -f $@/Makefile ]; then \ 207 cd $@; pwd; $(MAKE) $(TARGET); \ 208 else \ 209 true; \ 210 fi 211 212FRC: 213 214check: $(CHKMANIFEST) 215 216clean: $(SUBDIRS) 217 -$(RM) $(CLEANFILES) 218 219clobber: $(SUBDIRS) 220 -$(RM) $(CLEANFILES) $(CLOBBERFILES) 221 222lint: $(LINTSUBDIRS) 223 $(LINT.c) 6to4relay.c $(LDLIBS) -lsocket -lnsl 224 $(LINT.c) arp.c $(LDLIBS) -lsocket -lnsl 225 @# $(LINT.c) in.rexecd.c $(LDLIBS) -lbsm -lpam 226 $(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \ 227 -I$(SRC)/head -I$(SRC)/uts/common/ \ 228 -I$(SRC)/uts/common/gssapi/mechs/krb5/include \ 229 -I$(SRC)/lib/gss_mechs/mech_krb5/include \ 230 -I$(SRC)/lib/pam_modules/krb5 \ 231 in.rlogind.c $(COMMONSRCS) $(LDLIBS) -lbsm -lpam -lsocket -lnsl 232 $(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \ 233 -I$(SRC)/head -I$(SRC)/uts/common/ \ 234 -I$(SRC)/uts/common/gssapi/mechs/krb5/include \ 235 -I$(SRC)/lib/gss_mechs/mech_krb5/include \ 236 -I$(SRC)/lib/pam_modules/krb5 \ 237 in.rshd.c $(COMMONSRCS) $(LDLIBS) -lbsm -lpam -lsocket -lnsl 238 $(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 \ 239 -erroff=E_GLOBAL_COULD_BE_STATIC2 \ 240 -I$(SRC)/head -I$(SRC)/uts/common/ \ 241 -I$(SRC)/uts/common/gssapi/mechs/krb5/include \ 242 -I$(SRC)/lib/gss_mechs/mech_krb5/include \ 243 -I$(SRC)/lib/pam_modules/krb5 \ 244 in.telnetd.c $(LDLIBS) -lbsm -lpam -lsocket -lnsl 245 $(LINT.c) ipaddrsel.c $(LDLIBS) -lsocket -lnsl 246 $(LINT.c) ipsecalgs.c $(LDLIBS) -lsocket -lnsl -lipsecutil 247 $(LINT.c) ipsecconf.c $(LDLIBS) -lsocket -lnsl -lipsecutil 248 $(LINT.c) ipseckey.c $(LDLIBS) -lsocket -lnsl -lipsecutil 249 $(LINT.c) ikeadm.c $(LDLIBS) -lnsl -lipsecutil 250 $(LINT.c) route.c $(LDLIBS) -lsocket -lnsl 251 $(LINT.c) routeadm.c $(LDLIBS) -lsocket 252 $(LINT.c) syncinit.c $(LDLIBS) -ldlpi 253 $(LINT.c) syncloop.c $(LDLIBS) -ldlpi 254 $(LINT.c) syncstat.c $(LDLIBS) -ldlpi 255 $(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 in.rarpd.c $(LDLIBS) \ 256 -lsocket -lnsl 257 $(LINT.c) in.tftpd.c ../usr.bin/tftp/tftpsubs.c $(LDLIBS) \ 258 -lsocket -lnsl 259 260# EXPORT DELETE START 261EXPORT_SRC: 262 $(RM) Makefile+ 263 sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \ 264 < Makefile > Makefile+ 265 $(RM) Makefile 266 $(MV) Makefile+ Makefile 267 $(CHMOD) 444 Makefile 268# EXPORT DELETE END 269